#llamayama.

1 messages · Page 1 of 1 (latest)

orchid egretBOT
half orchid
#

I don't know if this will help but my plan is to use the Stripe hosted checkout flow and implement my own customer portal for managing subscriptions and updating payment details.

plush phoenix
half orchid
#

Thank you, how would I update the default payment method? I did some digging and I can see there's something called SetupIntent and web elements.

Is it correct for me to create a setup intent and use that with the payment element to collect payment details which I can then use to set the default payment method?

#

Would updating the default payment method automatically trigger Stripe to retry payment for that subscription as well, or do I need to trigger this somehow?

plush phoenix
half orchid
#

Thank you, I think I get most of the flow now. I just want to confirm I'm collecting the new payment details correctly. Is using SetupIntents with web elements an appropriate way of doing this, or should I be doing this in some other way?

plush phoenix
#

You can do that, but I'd suggest you just confirm the existing payment_intent of the latest_invoice. Once succeeded, get the payment_method from the payment_intent and use it to update the default_payment_method on the subscription.

half orchid
#

Okay, and if a customer wants to provide new payment details, is the way I described still okay, or would you recommend another way?

plush phoenix
#

You need to collect a new payment details anyway, and you can do it with SetupIntent, or PaymentIntent. Both would works

#

It's just that with SetupIntent flow, you need to create an extra SetupIntent, but with PaymentIntent flow, you can just use existing payment_intent of the latest_invoice

half orchid
#

Oh, so I can use the existing payment_intent and just update the payment method on it?

plush phoenix
#

You need to confirm the payment_intent with a new payment_method.

half orchid
#

I think I understand now, thank you. One last thing, so if a customer wanted to update their payment details for whatever reason, would the flow described on this page be correct, with the only change being that I'd need to use webhook events to update the customers/subscriptions default payment method with the payment method they created with the SetupIntent?

https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=setup

Build an integration where you can render the Payment Element prior to creating a PaymentIntent or SetupIntent.

orchid egretBOT
half orchid
#

Sorry, just bumping this incase you missed it.

unreal kindle
#

Sorry and thanks for waiting!

half orchid
#

Thanks, and am I correct in saying that I should be using the setup_intent.succeeded event to update the customer's default payment method in the background?