Laravel Cashier:我也应该在Stripe中添加试用期吗? [英] Laravel Cashier: should I add a trial period in Stripe too?

查看:85
本文介绍了Laravel Cashier:我也应该在Stripe中添加试用期吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

引用 Laravel Cashier文档:

如果您想在继续收集付款方式信息的同时为客户提供试用期,则在创建订阅时应使用trialDays方法.

If you would like to offer trial periods to your customers while still collecting payment method information up front, You should use the trialDays method when creating your subscriptions.

假设我要为订阅添加30天的试用期,则可以使用以下代码创建订阅:

Assuming I want to add a 30 days trial period to my subscriptions, I can create a subscription with this code:

$user->newSubscription('main', 'monthly')
        ->trialDays(30)
        ->create($stripeToken);

作为Stripe用户,我也应该在Stripe计划中添加试用期吗?

As a Stripe user, should I add a trial period in Stripe plan too?

我不确定在这里理解Laravel Cashier的逻辑.在两个不同的地方声明某些内容似乎是多余的.

I'm not sure to understand the logic of Laravel Cashier here. It seems redundant to declare something at two different places.

推荐答案

我会说这是没有必要的.如果您要在创建订阅时添加试用期(使用时 trial_end 参数则直接使用该API),无论如何,这将优先于计划中定义的试用日期!

I would say its not necessary. If you're adding trial days at the time of subscription creation (trial_end parameter when using the API directly), that will take precedence over the trial days defined on a plan anyway!

这篇关于Laravel Cashier:我也应该在Stripe中添加试用期吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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