Reputation: 562
I followed the "create subscriptions with elements" tutorials on stripe website, and everything worked perfectly. But now I need to implement 3d secure before a user pays.
My problem, however, is that I don't use the SetupIntent or PaymentIntent. I directly create a subscription and then display a payment form (per the tutorial).
Here is my subscription creation code (backend-PHP):
$stripe = new \Stripe\StripeClient(...);
$subscription = $stripe->subscriptions->create([
'customer' => $customer_id,
'items' => [[
'price' => $price_id,
]],
'payment_behavior' => 'default_incomplete',
'expand' => ['latest_invoice.payment_intent'],
]);
My front code (JS):
stripe.confirmCardPayment(currentClientSecret, {
payment_method: {
card: card,
billing_details: {
name: "name"
},
}
How can I require 3d-secure?
Reading this page: https://stripe.com/docs/payments/3d-secure#when-to-use-3d-secure seems to show that I need SetupIntent or PaymentIntent.
Upvotes: 0
Views: 732
Reputation: 8737
You need to use the Payment Intent (or Setup Intent of there's a trial) created as part of the Subscription creation as part of the process in order to do 3D Secure. It's all described here: https://stripe.com/docs/billing/subscriptions/elements
Upvotes: -1