【发布时间】:2018-11-29 14:53:06
【问题描述】:
我正在实施订阅,但我在使用 webhook 逻辑时遇到了问题。
我首先为初始订阅创建一个发票项目,在订阅时将支付这样的费用:
var invoiceItem = await _invoiceItemRepo.CreateInitialSubscriptionPaymentAsync(product, stripeCustomer);
var plans = await _planRepo.GetAllPlansAsync();
await _subscriptionRepo.CreateSubscriptionAsync(stripeCustomer.Id, plans);
succesful case :
IiThenSub@su.su subscribed to Pro_Service 3 and 2 more…
IiThenSub@su.su was charged €3,000.00
IiThenSub@su.su's invoice for €3,000.00 was paid
IiThenSub@su.su has a new invoice for €3,000.00
IiThenSub@su.su's invoice item was added to an invoice
IiThenSub@su.su's details were updated
An invoice item for €3,000.00 was created for IiThenSub@su.su
Failed payment case:
IiThenSubFail@su.su's payment for €3,000.00 failed
IiThenSubFail@su.su's details were updated
An invoice item for €3,000.00 was created for IiThenSubFail@su.su
在成功的情况下,我看到首先创建了 Invoice 项目,然后将其添加到发票中,创建了费用,付款成功并完成了订阅。
然而,在付款失败的情况下,我只收到一个收费失败事件,其中不包含发票项目的 ID,也不包含发票的 ID。
所以我不知道如何将此失败的费用与我的订阅尝试相关联。请您指出正确的方向吗?
【问题讨论】:
标签: .net stripe-payments webhooks