[英]Chargebee: Uncaught TypeError: this.page.urlFetcher(…).then is not a function
[英]TypeError: chargebee.subscription.list is not a function
當我嘗試使用 Chargebee 發出請求時出現錯誤
類型錯誤:this.chargebee.subscription.list 不是 function
這是我提出請求的 function:
async test(){
return new Promise((resolve, reject) => {
this.chargebee.subscription.list({
limit: 2,
"plan_id[in]": ["basic", "no_trial"]
}).request(function (error, result) {
if (error) {
//handle error
console.log(error);
} else {
resolve(result)
for (var i = 0; i < result.list.length; i++) {
var entry = result.list[i]
console.log(entry);
var subscription = entry.subscription;
var customer = entry.customer;
var card = entry.card;
}
}
});
})
}
為什么在定義 function 時出現未定義的錯誤? 感謝任何幫助,謝謝!
為什么在定義 function 時出現未定義的錯誤?
您的錯誤不是 function 未定義,而是this.chargebee.subscription.list
不是 function。確實,看看您的調試 output: list = Object {request: }
- 它是 88282995409a848865,not 88863 ,但您試圖將其稱為 function: this.chargebee.subscription.list(...).request(...)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.