Stripe:无法更改经过验证的 3DS 卡的计划?
Stripe: can't change plan for authenticated 3DS card?
我试图让客户通过 API 更改他们的 Stripe 计划,但 3D 安全测试卡失败,即使他们应该经过验证以供将来使用。
我的API调用如下:
$stripe->subscriptions->update(
$subscription_id, [
'items' => [
[
'id' => $subscription->items->data[0]->id,
'price' => $new_plan_id,
],
],
]);
使用标准卡号(例如 4242 4242 4242 4242)这绝对没问题
但是对于 3DS 卡它 returns 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 card, you need to explicitly set it up for future use with either a Setup Intent or using setup_future_usage
with a payment intent。它不会自动设置以供将来使用,只需通过第一次验证即可。
您可能希望使用 0446 卡来模拟此设置,但我鼓励您通过实际完成设置流程来确保您已为现实世界场景的实施做好准备。
我试图让客户通过 API 更改他们的 Stripe 计划,但 3D 安全测试卡失败,即使他们应该经过验证以供将来使用。
我的API调用如下:
$stripe->subscriptions->update(
$subscription_id, [
'items' => [
[
'id' => $subscription->items->data[0]->id,
'price' => $new_plan_id,
],
],
]);
使用标准卡号(例如 4242 4242 4242 4242)这绝对没问题
但是对于 3DS 卡它 returns 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 card, you need to explicitly set it up for future use with either a Setup Intent or using setup_future_usage
with a payment intent。它不会自动设置以供将来使用,只需通过第一次验证即可。
您可能希望使用 0446 卡来模拟此设置,但我鼓励您通过实际完成设置流程来确保您已为现实世界场景的实施做好准备。