【发布时间】:2021-01-10 08:43:09
【问题描述】:
这是我的条纹订阅:
subscription = Stripe::Subscription.retrieve('sub_I4wF')
当用户将refund的未使用余额降级为customer through refund.时
要创建退款文档说In the API call, include the charge ID to refund.
我试图从subscription.latest_invoice获取费用ID
latest_invoice = Stripe::Invoice.retrieve(subscription.latest_invoice)
但费用 ID 为空 "charge": null,
#<Stripe::Invoice:0x3fc07bb95a20 id=in_1HUmNoHHVd> JSON: {
"id": "in_1HUmNoHHVdsLap10",
"object": "invoice",
"account_country": "AU",
"account_name": null,
"amount_due": 0,
"amount_paid": 0,
"amount_remaining": 0,
"application_fee_amount": null,
"attempt_count": 0,
"attempted": true,
"auto_advance": false,
"billing_reason": "subscription_update",
"charge": null,
"collection_method": "charge_automatically",
"created": 1600922920,
【问题讨论】:
-
您确定向客户收费了吗? :)
-
是的。它第一次工作。然后第二次充电变为空降级。
标签: ruby-on-rails stripe-payments