#reymon359
1 messages ยท Page 1 of 1 (latest)
hello! can you share how you're integrating with Stripe?
sure. After my guest finishes sending a booking form, I create a booking for him and then I redirect him to a checkout session to get the card details.
Then I listen to the checkout.session.completed event and create + confirm a payment intent
I want to handle the case where the payment intent created has not a succeeded status
My idea was to send an email with a link to the user so him can attempt to pay the same payment intent again but dont know how to create that link
What I am trying to achieve is inside the if(paymentIntent.status !== "succeeded") condition
@hollow drift I'm taking over this thread.
Thanks @tepid dawn
You might want to build a frontend integration to collect the payment detail to confirm the paymentIntent, you can find details here https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-collect-payment-details
Thanks but I already have the paymentIntent and I also collected the payment method before. I just want the user to try again to pay that payment intent. Is there any way to do so with a paymentlink or checkout session? I don't want to create a full web interface for a sidecase
You mean reuse a existing PaymentIntent when creating a Checkout session? I'm afraid not.
mmm I guess that if the paymentintent fails it goes back to requires_payment_method
So maybe I can send a failed payment email with a link to another checkout session where the guest adds a new payment method and then on the webhook attempt to pay the same payment intent using the new payment method
If you don't plan to build a frontend integration, you can just create a new Checkout Session and send its URL to your customer.
you mean a checkout session for the paymentmethod as I explained above (mode: 'setup')
So maybe I can send a failed payment email with a link to another checkout session where the guest adds a new payment method and then on the webhook attempt to pay the same payment intent using the new payment method
or a checkout session for a payment?
A new payment mode checkout session.
alright, if I do so, can I use my payment intent or do I have to create a new one?
I would prefer to follow the docs advice of using the same payment intent for the whole lifecycle
Sorry, I think you didn't answered my quesiton here
alright, if I do so, can I use my payment intent or do I have to create a new one?
or I didn't understand the answer. ๐
So, to clarify, if I create
A new
paymentmode checkout session.
as you said, can I use my payment intent or do I have to create a new one?
You mean reuse a existing PaymentIntent when creating a Checkout session? I'm afraid not.
alright. thanks for confirming.
and am I able to
- get a new payment method
- update the payment intent with the new payment method
- try to confirm the payment intent with the new payment method
???
Sure you can do that, but I'd still suggest you to build a front end integration so that you can handle 3DS when required.
thanks for the recomendation.
If I create a checkout session with mode setup to get a payment method, The 3DS is handled in the checkout session right?
That's the 3DS during setup. It's also possible that another 3DS is required when you use the collected payment method to confirm a PaymentIntent.
thanks for that info.
I understand there is a setting called setup for future usage or similar to avoid that second 3DS, am I right?
No. There's no way to avoid 3DS if the issuer requests it.
and what happens if that occurs? The paymentIntent gets updated to what status?
The paymentIntent's status would become requires_action, and you need to call stripe.confirmCardPayment() in frontend to begin the 3DS authentication flow.
alright. thanks again for that info.
then, I understand that if I create a checkout session with the mode payment it will have the 3DS (if required by the issuer) and after that it will create a payment intent succeeded. Is that right?
Provided the 3DS is authenticated successfully and issuer approves the transaction
Also, how common is it that another 3DS is required when you use the collected payment method to confirm a PaymentIntent.
Because if it is too common I maybe need to update my flow and instead of collecting the card details and then charging in the backend (as this guide suggest https://stripe.com/docs/payments/save-and-reuse)
I should just charge the user in the first place
It's up to the issuer and I'd strongly suggest you to make your integration ready to handle requires_action PaymentIntents.
Allright. Thanks @tepid dawn .
Then, how would be the best way to handle last-minute cancellations? My idea was to charge the card an amount depending on the cancellation policy but looks like that may fail because of 3DS may be asked
When do you intent to cancel the payment?
which payment? If I only collect the card details there would be no payment
Can you tell me the full flow? i.e., are you using setup mode or payment mode Checkout Session? manual capture or automatic capture?
I am using setup mode, then I listen to the webhook checkout.session.completed and charge that setupintent.paymentmethod in the server
https://stripe.com/docs/payments/place-a-hold-on-a-payment-method you can consider using auth-and-capture flow, so that you can cancel the paymentIntent when needed