Stripe:订阅不收费

Stripe: Subscriptions without charging

在我们的应用程序中,我们需要根据应用程序本身的某些条件稍后向客户收费。我可以通过在制作 charge 时指定 capturefalse 来轻松地为单笔付款执行此操作,但我没有看到任何此类订阅选项,并且客户最初会被收费,这是我们想要避免的.

有没有办法在创建订阅时不向客户收费?

2 个选项:

正如@Zico 在评论中所说,在订阅选项中,您可以定义一个 "trial period"。

在此处查看文档:https://stripe.com/docs/subscriptions/trials

When creating a subscription with a trial period, no payment method is required for the customer. An immediate invoice is still created, but for [=13=].

满足您的要求的一种更有效的方法是将订阅金额设置为 0,然后使用 webhooks 开具任何您想要的账单,在每个账单周期结束时添加发票项目。您可以使用 invoice.created 事件来执行一些业务逻辑,并在您想要开具账单时将项目添加到发票中。如果您不添加任何项目,则不会收取任何费用,因为订阅金额为 0.

此处有更多详细信息https://stripe.com/docs/subscriptions/invoices

When Stripe automatically generates an invoice for a recurring payment, your site is notified via webhooks (an invoice.created event). Stripe waits approximately an hour before attempting to pay that invoice. In that time, you can add invoice items to the recently-created invoice so that the forthcoming payment covers it.