为客户订阅定期付款计划后如何获取费用 ID? [英] How to get the charge Id after subscribing a customer to a plan with recurring payment?

查看:35
本文介绍了为客户订阅定期付款计划后如何获取费用 ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功地创建了一个订阅计划的条带客户.成功付款后我无法获得费用 ID,因为在订阅了一个计划的客户后.它会自动生成发票.那么是什么方式呢?我可以从 stripe 中获取那个特定的 Charge stripe Id 并将其存储在我的系统数据库中.

解决方案

可以通过 他们的 webhooks 集成.您需要在您的应用程序中公开一个 API,以便 Stripe 可以触发这些请求.您可以在那里订阅各种事件,但在您的情况下,您需要在 charge.succeeded 上订阅.费用 ID 将位于事件对象的 data 结构中.

查看可以与 webhooks 一起使用的各种其他生命周期事件.>

I have successfully created a customer in stripe with a subscription of plan .After successful payment I am not able to get the charge Id because after subscribing a customer to a plan.It automatically generates an invoice.So what is the way that I can get that particular charge stripe Id from stripe and store it in my system database.

解决方案

Getting the charge ID for a subscription (or an invoice) can be done via their webhooks integration. You need to expose an API in your app where Stripe can fire these requests. You can subscribe to various events there, but in your case you'd need to do so on charge.succeeded. The charge ID will be in the data structure of the event object.

Take a look at the various other lifecycle events you can use with webhooks.

这篇关于为客户订阅定期付款计划后如何获取费用 ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆