如何延迟开始条带式订阅? [英] How to start a subscription in stripe with delay?

查看:25
本文介绍了如何延迟开始条带式订阅?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有许多用户目前订阅了月度订阅.

I have a number of users who are currently subscribers to a monthly subscription.

出于商业原因,我希望能够

For business reason, I want to be able to

1) 当客户决定订阅我们的计划时向他收费

1) Charge the customer when he decides to subscribe to our plan

2) 让订阅在购买数天后生效

2) Let the subscription become effective a number of days after the purchase

目前,当以条带形式向客户添加订阅时,会立即尝试收费.

Currently a charge is immediately attempted when a subscription is added to a customer in stripe.

我想坚持使用 Stripe 订阅,因为 a) 我仍然希望在以后的日期使用 Stripe 来管理我的订阅,以及 b) 我已经为订阅模型编写了大量代码.

I want to stick to the stripe subscription because a) I still want to have stripe to manage subscription for me in future dates, and b) I have written a lot of code for the subscription model.

划定收费/发票和订阅开始日期是否可行?

Is it feasible at all to demarcate the charge/invoice and the subscription start date?

推荐答案

您可以使用 trial_end 参数在您的 订阅创建请求.只需将参数值设置为您希望 Stripe 开始自动向客户收费的确切时间的时间戳.

You can control the time when the subscription actually starts (i.e. when Stripe will start billing the customer) by using the trial_end parameter in your subscription creation request. Simply set the value of the parameter to the timestamp of the exact time you wish Stripe to start automatically billing the customer.

如果我正确理解您想要的付款流程,您会希望在客户注册时执行以下操作:

If I understand your desired payment flow correctly, you'd want to do something like this when a customer signs up:

  1. 收集和标记客户的付款信息(使用 Elements结帐).

使用生成的令牌,创建客户对象并保存生成的客户 ID在您的数据库中.

Using the resulting token, create a customer object and save the resulting customer ID in your database.

使用客户对象为第一次付款创建一次性费用.

使用客户对象和trial_end 参数设置为您希望 Stripe 开始自动向客户收费的时间.>

Create a subscription using the customer object and the trial_end parameter set to the time you want Stripe to start automatically billing the customer.

请参阅 https://stripe.com/docs/subscriptions/trials 了解更多关于使用试用期.

See https://stripe.com/docs/subscriptions/trials for more information about using trial periods.

这篇关于如何延迟开始条带式订阅?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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