我正在使用 laravel 收银员进行订阅系统,我实现了这样的付款:
public function orderPost(Request $request)
{
$user = auth()->user();
$input = $request->all();
$token = $request->stripeToken;
$paymentMethod = $request->paymentMethod;
$newSubscription = $user->newSubscription('default ', 'price_1IFyPsB9YMR57in7UrNtRb9G')->create($request->payment_method, ['email' => $user->email]);
dd($newSubscription);
我的观点如下:
<form action="{{route('order-post')}}" id="payment-form" method="post">
@csrf
{{-- {!! Form::open(['url' => route('order-post'), 'data-parsley-validate', 'id' => 'payment-form']) !!}--}}
@if ($message = Session::get('success'))
<div class="alert alert-success alert-block">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>{{ $message }}</strong>
</div>
@endif
<div class="form-group" id="product-group">
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div id="card-element"></div>
</div>
</div>
</div>
<div class="form-group">
<button id="card-button" class="btn btn-lg btn-block btn-success btn-order">Place order !</button>
</div>
<div class="row">
<div class="col-md-12">
<span class="payment-errors" id="card-errors" style="color: red;margin-top:10px;"></span>
</div>
</div>
</form>
现在在我收到 dd 后会发生什么,数据库充满了数据,条带显示我得到了这个计划,但我有一个问题,就像下图一样,字段 ends_at
具有空值:
现在我想知道如何检测用户帐户何时到期以及用户是否有活动订阅。谢谢。