使用Chargebee创建订阅时触发Failed to create subscription TypeError错误求助
Chargebee创建订阅时触发Failed to create subscription错误求助
各位好,我在调用Chargebee API创建订阅的时候卡壳了,一直弹出这个错误:
Error: Failed to create subscription
以下是我写的代码片段,已经打印了传入的参数,看起来customerId和options都是符合预期的,但就是创建订阅这一步走不通,有没有有经验的朋友能帮我排查下问题?
async createSubscriptionForTeamMember(customerId, options) { try { // Proceed with subscription creation using Chargebee API console.log(customerId); // 16CMrdUBRD3oj1Wy5 console.log(options); // {subscription_items: [ { item_price_id: 'monthly', quantity: 1 } ]} const subscriptionResult = await chargebee.subscription.create_with_items(customerId, options).request(); const subscription = subscriptionResult.subscription; console.log('subscription', subscription.status); // Retrieve customer information including payment method const customerResult = await chargebee.customer.retrieve(customerId).request(); const customer = customerResult.customer; console.log('customer.payment_method', customer.id); // Parse subscription details const nextBillingTimestam... }
我已经确认了对应客户是存在的,而且item_price_id在Chargebee后台也正确配置了,但就是找不到订阅创建失败的原因,麻烦大家帮忙看看!
备注:内容来源于stack exchange,提问作者Omar Chakroun
相关产品推荐
相关产品推荐

