【问题标题】:stripe api invoice charge is nullstripe api 发票费用为空
【发布时间】: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


【解决方案1】:

该发票是一张零美元发票,因此不收取任何费用,因为没有什么可退款的。

【讨论】:

    猜你喜欢
    • 2018-11-05
    • 2021-12-28
    • 1970-01-01
    • 2022-01-19
    • 2021-12-21
    • 1970-01-01
    • 2013-11-10
    • 2021-12-29
    • 2020-04-17
    相关资源
    最近更新 更多