繁体   English   中英

条纹 API 发票费用为空

[英]stripe api invoice charge is null

这是我的条纹订阅:

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,

该发票是零美元发票,因此无需支付任何费用,因为无需退款。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM