Stripe payments Laravel出纳未设置试用和结束日期
我刚刚将我的项目更新为Laravel 5.2和出纳6.0。Stripe payments Laravel出纳未设置试用和结束日期,stripe-payments,laravel-5.2,laravel-cashier,Stripe Payments,Laravel 5.2,Laravel Cashier,我刚刚将我的项目更新为Laravel 5.2和出纳6.0。 我按照文档的说明添加了新的订阅表,但在测试时,收银员没有设置试用期结束列 在我的stripe计划中,我有14天的试用期,在我的stripe帐户中,我可以看到,如果我今天添加了一个新客户,那么第一个账单将在14天后设置 这是我的订阅代码: // Create the user $user = $this->create( $request->all() ); // Find the plan in the DB $plan
我按照文档的说明添加了新的
订阅
表,但在测试时,收银员没有设置试用期结束列
在我的stripe计划中,我有14天的试用期,在我的stripe帐户中,我可以看到,如果我今天添加了一个新客户,那么第一个账单将在14天后设置
这是我的订阅代码:
// Create the user
$user = $this->create( $request->all() );
// Find the plan in the DB
$plan = Plan::find( $request->get( 'plan' ) );
// Charge the user ( 14 days trial )
$user->newSubscription( $plan->slug , $plan->stripe_id )->create( $request->get( 'stripeToken' ),
[
'email' => $request->get( 'email' ),
'description' => ''
] );
$plan->slug
是我与我的计划关联的名称,例如annual
,而$plan->stripe\u id
与我在stripe dashboard上设置的名称相同
如果我注册了一个新客户,那么除了试用期在
结束和和在
结束之外,所有的试用期都已设置
我做错了什么?我自己弄明白了。
新的出纳代码需要手动设置试用期,包括:
trialDays($trialDays)
所以我的代码应该是:
$user->newSubscription( $plan->slug , $plan->stripe_id )->trialDays(14)->create( $request->get( 'stripeToken' ),
[
'email' => $request->get( 'email' ),
'description' => ''
] );
我自己想出来的。
新的出纳代码需要手动设置试用期,包括:
trialDays($trialDays)
所以我的代码应该是:
$user->newSubscription( $plan->slug , $plan->stripe_id )->trialDays(14)->create( $request->get( 'stripeToken' ),
[
'email' => $request->get( 'email' ),
'description' => ''
] );