简体   繁体   English

Stripe 3d 使用 PaymentIntent 安全支付

[英]Stripe 3d secure payment using PaymentIntent

I am trying to implement Stripe PaymentIntent.我正在尝试实施 Stripe PaymentIntent。 When I create the PaymentIntent object I pass it request_three_d_secure to payment_method_options but the created PaymentIntent is not requesting 3d secure payment on confirmation.当我创建 PaymentIntent object 时,我将它 request_three_d_secure 传递给 payment_method_options 但创建的 PaymentIntent 没有在确认时请求 3d 安全付款。 Here is how I am creating the PaymentIntent object.以下是我创建 PaymentIntent object 的方式。

$paymentIntent = \Stripe\PaymentIntent::create([
     'amount' => 1099,
     'currency' => 'usd',
     'customer' => 'cus_XXXXXXXXXXXXX',
     'payment_method_types' => ['card'],
     'payment_method_options' => '[card][request_three_d_secure][any]',
     'payment_method' => 'card_XXXXXXXXXXXXXXXXXXXXX',
]);

$paymentIntent =  $stripe->paymentIntents->confirm(
    $paymentIntent->id,
    ['payment_method' => 'pm_card_visa']
);

Am I am creating the PaymentIntent object correctly?我是否正确创建了 PaymentIntent object? Has anyone else faced any issues related to this?还有其他人遇到与此相关的任何问题吗?

In your confirm call you're replacing whatever the card_xxx is with another test payment method that is "not enrolled".在您的confirm电话中,您将card_xxx替换为另一种“未注册”的测试付款方式。 See here for details of the manual 3D Secure support for test cards.有关手册 3D 对测试卡的安全支持的详细信息,请参见此处 There are also SCA test cards here.这里也有SCA测试卡。

For this case, you likely want to attach pm_card_threeDSecureOptional instead, then manual 3DS requests should work like you expect.对于这种情况,您可能希望改为附加pm_card_threeDSecureOptional ,然后手动 3DS 请求应该会像您预期的那样工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM