条纹:无法更改经过身份验证的 3DS 卡的计划?



我试图让客户通过API更改他们的条纹计划,但是3D安全测试卡失败,即使他们应该为将来使用进行身份验证。

我的API调用如下:
$stripe->subscriptions->update(
$subscription_id, [
'items' => [
[
'id' => $subscription->items->data[0]->id,
'price' => $new_plan_id,
],
],
]);

对于标准卡号(例如4242 4242 4242 4242 4242),这绝对可以正常工作

但是对于3DS卡片,它返回一个402错误:

{
"error": {
"code": "subscription_payment_intent_requires_action",
"message": "Payment for this subscription requires additional user action before it can be completed successfully. Payment can be completed using the PaymentIntent associated with `subscription.latest_invoice`. Additional information is available here: https://stripe.com/docs/billing/subscriptions/overview#requires-action",
"type": "card_error"
}
}

我使用第一次需要身份验证的测试卡号(这是在创建订阅时完成的),但应该根据此页面https://stripe.com/docs/testing成功后续次数。

我还尝试了Javascript路由作为替代方案,以便检查API调用的响应,然后在需要身份验证时触发stripe.ConfirmCardPayment()例程,但致命的PHP错误甚至在到达该点之前杀死了脚本。

有什么办法可以解决吗?

您具体使用哪张卡?您在初始设置中使用的确切流程是什么?

如果你谈论的是3155卡,你需要明确地设置它,以便将来使用设置意图或使用setup_future_usage与支付意图。它是而不是通过第一次验证自动设置以供将来使用。

您可能希望使用0446卡来模拟此设置,但是我鼓励您通过实际执行设置流程来确保您已经为实际场景准备好了实现。

最新更新