第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用點表示法和JSON嘗試從Stripe API獲取特定鍵值時遇到麻煩

使用點表示法和JSON嘗試從Stripe API獲取特定鍵值時遇到麻煩

慕勒3428872 2021-04-25 08:11:03
我正在從測試發(fā)票中從Stripe API中提取數(shù)據(jù)。我正在嘗試縮小使用點表示法提取特定鍵值對的方法,但是由于從嵌套值看似比其余數(shù)據(jù)更嵌套,我無法從特定鍵值中提取數(shù)據(jù)(不確定是否正確)術(shù)語)。這些數(shù)據(jù)我想拉數(shù)據(jù)從從period: end:從period: start:從線44-46粗略。如果我在代碼中使用點表示法,則當鍵值對位于同一行時,它可以工作,例如sheet.getRange(3,2).setValue([content.amount_due]);。但是似乎“ period:end”和“ period:start”嵌套得更深了。我嘗試做類似的事情,[content.lines.data.period.end]但沒有成功。它返回此錯誤:TypeError: Cannot read property "end" from undefined.以下是從API中提取的完整數(shù)據(jù)(注意:"xxxxxxxxxxxxxxxx"代表已隱藏的數(shù)據(jù)):  ""id"": ""in_xxxxxxxxxxxxxxxx"",  ""object"": ""invoice"",  ""amount_due"": 800,  ""amount_paid"": 800,  ""amount_remaining"": 0,  ""application_fee"": null,  ""attempt_count"": 1,  ""attempted"": true,  ""auto_advance"": false,  ""billing"": ""charge_automatically"",  ""billing_reason"": ""subscription_cycle"",  ""charge"": ""ch_xxxxxxxxxxxxxxxx"",  ""closed"": true,  ""created"": 1552077120,  ""currency"": ""usd"",  ""custom_fields"": null,  ""customer"": ""cus_xxxxxxxxxxxxxxxx"",  ""date"": 1552077120,  ""default_payment_method"": null,  ""default_source"": null,  ""description"": null,  ""discount"": null,  ""due_date"": null,  ""ending_balance"": 0,  ""finalized_at"": 1552080770,  ""footer"": null,  ""forgiven"": false,  ""hosted_invoice_url"": ""https://pay.stripe.com/invoice/invst_xxxxxxxxxxxxxxxx"",  ""invoice_pdf"": ""https://pay.stripe.com/invoice/invst_xxxxxxxxxxxxxxxx/pdf"",  ""lines"": {    ""object"": ""list"",    ""data"": [      {        ""id"": ""sub_xxxxxxxxxxxxxxxx"",        ""object"": ""line_item"",        ""amount"": 800,        ""currency"": ""usd"",        ""description"": null,        ""discountable"": true,        ""livemode"": false,        ""metadata"": {        },        ""period"": {          ""end"": 1554755515,          ""start"": 1552077115        },
查看完整描述

1 回答

?
SMILET

TA貢獻1796條經(jīng)驗 獲得超4個贊

數(shù)據(jù)是一個數(shù)組,請嘗試content.lines.data[0].period.end。


查看完整回答
反對 回復(fù) 2021-05-06
  • 1 回答
  • 0 關(guān)注
  • 152 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號