#llamayama.
1 messages · Page 1 of 1 (latest)
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.
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?
I think you are looking for this https://stripe.com/docs/billing/subscriptions/overview#requires-payment-method
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?
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.
Okay, and if a customer wants to provide new payment details, is the way I described still okay, or would you recommend another way?
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
Oh, so I can use the existing payment_intent and just update the payment method on it?
You need to confirm the payment_intent with a new payment_method.
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
Sorry, just bumping this incase you missed it.
Sorry and thanks for waiting!
If the customer wants to update payment method details of a subscription, I'd recommend using Setup Intent https://stripe.com/docs/payments/save-and-reuse and update it to default_payment_method of the subscription
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?