在使用 Laravel Cashier 集成 Stripe 系统后,我们在网站上进行了测试,使用了几张测试卡片,有些成功了,有些失败了。我尝试适应 3D 安全/SCA。问题是,4000003800000446、4000002500003155 和 4000000000003055 成功了,而 4000000000003220 和 4000002760003184 失败了,返回未完成的状态。我的系统用于杂志的年度订阅。当我确认身份验证时,会出现弹出窗口,如图所示:确认弹出窗口截图,然后重定向到我的代码以创建订阅。
$payement_intent = $request->get('intent');
$plan_key = 'plan_*******';
try{
$payement_info = $subscriber->newSubscription('yearly', $plan_key)->create($payement_intent, [
'email'=>$subscriber->email
]);
}catch(IncompletePayment $e){
dd($e);
Session::flash('message', 'Payment is incomplete. Extra verification is needed. You will receive an email with further payment confirmation instructions.');
return redirect()->to(route('acc_success'));
}
自从我放弃了未完成的付款后,异常截图在这里输入图片描述。 我很困惑,因为我已经在弹出窗口上点击了完成身份验证,难道它不应该验证3D身份验证并使支付成功吗?还是我在收银台方面漏掉了什么,因为Stripe文档中说:“只有当尝试第一次扣款失败或需要SCA时,订阅才会进入未完成状态。”