#ledevfoufoufou-default-pm
1 messages · Page 1 of 1 (latest)
Hi there. Do you already have the payment method that you want to change the default payment method to? Or are you looking for a flow to collect new payment method details and then set those to the default pm?
yes I have already a default payment method, but I'm looking for a flow to collect a new payment method. exemple if customer payment method is card and would change to sepa_debit
or he lost his card
Got it. What flow did you use to collect the initial payment method on the subscription?
card (with applepay and googlepay) and sepa_debit
No what flow
How did you collect their payment method details initially
Payment Element?
Payment Link?
Stripe Checkout?
payment element
Got it. So would you like another flow hosted on your site similar to how you initially collected details? Or would you like a Stripe-hosted flow?
i have create session with $stripe->checkout->sessions->create but result doesn't suit me
My question is do you want to collect the new payment method on your site (via payment element) or do you want a Stripe-hosted flow?
via payment element please
Got it. You can use this flow then: https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements. That will set up a new payment method for future usage. Then, you can grab the pm_ id from the setupintent and then update it as the subscription's default payment method: https://stripe.com/docs/api/subscriptions/update#update_subscription-default_payment_method