#cnguyen85
1 messages · Page 1 of 1 (latest)
Hello cnguyen85, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
• https://discord.com/channels/841573134531821608/1164196532980027393, 1 days ago, 6 messages
• https://discord.com/channels/841573134531821608/1163889854212485170, 2 days ago, 10 messages
Hi there!
Hi
It means this parameter can only be set when you confirm the PaymentIntent
If I create the PI from the back, I can't confirm the payment because it means tht it's like a payment off-session. No ?
For now, I create a SI fro mthe back. And I do a confirmCardSetup from the front to validate it
You can try confirming the PI on the backend. But if the bank requires 3DS, then you'll have to confirm it on the frontend.
Note that I'm assuming you already collected a PaymentMethod.
No. I don't have the PaymentMethod yet
Then first create the PI on the backend, then use the client_secret on the frontend to collect the paymentmethod and confirm the PI.
1 - Back => Create the SetupIntent
2 - Front => We have CardElement and use the confirmCardSetup with the SI token and the CardElement to do the confirm
This is explained in details here: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
OK but it's ok to create the PI on the backend with the network and the confirm true in the first step ?
Can you clarify exactly which parameter you want to set when creating the PI? You can see the full list here: https://stripe.com/docs/api/payment_intents/create?lang=node
Sure
For now, I do :
let params = {
automatic_payment_methods: { enabled: true },
usage: 'off_session',
customer: stripeCustomer.id,
metadata: additionalMeta,
payment_method_options: {
card: {
request_three_d_secure: 'any',
}
},
};
const response = await stripe.setupIntents.create(params);
Then, I send the clientSecret : response.client_secret
And in the front, I do
const responseCardSetup = await stripe?.confirmCardSetup(
clientSecret,
{
payment_method: {
card: cardNumber,
billing_details: {
name: ${customer.firstname} ${customer.lastname},
},
},
}
)
That seems correct to me. Does it work?
Sure. The problem is that I want to specifiy the network
So I have to update the SI creation by adding the params.payment_method_options.card.network = network;
But it's only possible if I add the confirm: true params too
But for me, if I add the confirm true here, it doesn't work anymore
But for me, if I add the confirm true here, it doesn't work anymore
Usingconfirm: trueonly makes sense if you already have a Payment Method.
But you could set that property when confirming the SetupIntent on the frontend maybe?
The network option doesn't exist on confirmCardSetup. I already tried
Give me a few minutes to look into this.
thank you
I see the option in confirmCardPayment at least: https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-data-payment_method_options-card
But yes it's not available for SetupIntent for some reasons.
Yes. I'll file a feedback internally about this, not sure why.