#nickjw - Multiple Setup Intents

1 messages · Page 1 of 1 (latest)

feral perch
#

I would create multiple setup intents. Off the top of my head I don't know if there is a timeout on the client secret but I don't think they are intended to be valid for long periods of time.

frail turret
#

ahh ok gotcha. so for instance if they load a page that has an option to pay, we can create a setupintent on each page load, correct?

feral perch
#

Yup, it's a mechanism to attach a payment method. That's about it. And I've tested it out with the same customer and card multiple times. Works like a charm.

frail turret
#

Awesome. Thanks!

feral perch
#

Happy to help 👍

vagrant rose
#

Sorry to interject but I just want to say that you can attach a new payment method to a setup intent or payment intent and re-use it. You should probably still not cache the client secret as I'm unsure if it changes, but you don't have to create new intent objects on each page load. You would do the same if a payment intent fails; attach a new payment method and try again.

frail turret
#

Do you have documentation somewhere that describes the ideal flow? I'm still a bit confused here. For context, our platform has a built-in 'payment plan' feature that we use to charge user's cards in the future for payment plans they agree to.

feral perch