我刚刚将我的项目更新到 Laravel 5.2 和 Cashier 6.0。
我已经按照文档添加了新subscriptions
表,但是当我测试它时,收银员没有设置试用结束列。
在我的条带计划中,我有 14 天的试用期,在我的条带帐户中,我可以看到,如果我今天添加一个新客户,则第一次计费是在 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_id
我在 Stripe 仪表板上设置的名称相同。
如果我注册了一个新客户,但trials_ends_at
已经ands_at
设置好了。
我究竟做错了什么?