#raxkumar
1 messages · Page 1 of 1 (latest)
Hi there, it's not recommended to use Sources/Tokens API anymore, as it doesn't support 3DS authentication well. You should update to PaymentIntents API instead.
https://stripe.com/docs/payments/accept-a-payment you can use this doc to get started with PaymentIntent
Understood,
But i don't want to use the check out session
So i have added the card to 5he customer
And created the payment intent with the parameter setConfirm as true
And setOffSession as true
Which deduct the amount from the card automatically if i am using the test card(4242 4242 4242 4242)
But how will I handle the case which required the authentication for the first time ?
Is there way to authenticate a card via api ?
Just with out moving to stripe checkout page ?
https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements It's not mandatory to use Checkout Session. you can refer to this link to see how to use PaymentIntent with PaymentElement
The PaymentElemement will automatically trigger the 3DS authentication flow when you call stripe.confirmPayment, it will launch a 3DS authentication page where your customer can confirm the payment.
I have tried this way ,
The problem I was facing here was that payment methods attached to the customer were not coming on the pop up page of the custom flow
Can you help me with that please ?
How to bring the saved payment method in the custom flow ?
So basically I was creating the payment intent secret with automatic payment method enable as true,
My front end team was using the that client secret to pop a page
Stripe page
Which again asks for the card details
Which I actually don't want to happen as I have already given the card details to the customer.
OK. The main purpose of PaymentElement is collect a new PaymentMethod from a customer, so it won't show the existing payment methods that are already attached to a customer.
You can build you own UI to render the payment methods and let customer to choose.
Understood,
But if we see the checkout page
It actually pre poluates the existing cards attached to the customer,
Is there any element of stripe which allow the same flow without actually redirecting to stripe?
Beacuse if i use checkout page it redirects to stripe page ryt ?
yes, the stripe checkout will pre-populate existing payment methods if any
No there's no elements to render existing payment methods at this moment
Ohk thank you! @wheat cloud