#reymon359

1 messages ยท Page 1 of 1 (latest)

untold gyroBOT
cinder ore
#

hello! can you share how you're integrating with Stripe?

untold gyroBOT
hollow drift
#

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

tepid dawn
#

@hollow drift I'm taking over this thread.

hollow drift
#

Thanks @tepid dawn

tepid dawn
hollow drift
#

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

tepid dawn
#

You mean reuse a existing PaymentIntent when creating a Checkout session? I'm afraid not.

hollow drift
#

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

tepid dawn
#

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.

hollow drift
#

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?

tepid dawn
#

A new payment mode checkout session.

hollow drift
#

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

tepid dawn
#

Sure thing.

#

Then you'll need to build a frontend integration like I said earlier.

hollow drift
#

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 payment mode checkout session.

as you said, can I use my payment intent or do I have to create a new one?

tepid dawn
#

You mean reuse a existing PaymentIntent when creating a Checkout session? I'm afraid not.

hollow drift
#

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

???

tepid dawn
#

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.

hollow drift
#

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?

tepid dawn
#

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.

hollow drift
#

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?

tepid dawn
#

No. There's no way to avoid 3DS if the issuer requests it.

hollow drift
#

and what happens if that occurs? The paymentIntent gets updated to what status?

tepid dawn
#

The paymentIntent's status would become requires_action, and you need to call stripe.confirmCardPayment() in frontend to begin the 3DS authentication flow.

hollow drift
#

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?

tepid dawn
#

Provided the 3DS is authenticated successfully and issuer approves the transaction

hollow drift
#

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

tepid dawn
#

It's up to the issuer and I'd strongly suggest you to make your integration ready to handle requires_action PaymentIntents.

hollow drift
#

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

tepid dawn
#

When do you intent to cancel the payment?

hollow drift
#

which payment? If I only collect the card details there would be no payment

tepid dawn
#

Can you tell me the full flow? i.e., are you using setup mode or payment mode Checkout Session? manual capture or automatic capture?

hollow drift
#

I am using setup mode, then I listen to the webhook checkout.session.completed and charge that setupintent.paymentmethod in the server

tepid dawn