#nancy-paymentmethod-attach

1 messages · Page 1 of 1 (latest)

royal hawk
#

Hello @tight dawn. In theory you should never use createPaymentMethod.There are some exceptions but it's really rare and it's not our default integration path

#

If you are creating a subscription you should
1/ Create a Customer
2/ Create a Subscription
3/ Get the Subscription's Invoice's PaymentIntent's client_secret
4/ Use that to collect payment method details client-side and confirm the payment

tight dawn
#

@royal hawk - this is for an existing customer, with an existing subscription when they want to update their default payment method (customer.invoice_settings.default_payment_method) (collected using cardElement). What would be that path in doing so? Don't we have to convert the cardElement to PaymentMethod and attached it to the customer? Or is there another suggested path

royal hawk
tight dawn
#

Do you need a setup intent for every payment method update?

royal hawk
#

SetupIntent is the API used to collect payment method details. So yes, you create one every time a customer wants to change their payment method details

royal hawk
#

@tight dawn did you have any other question?

tight dawn
#

not for now

#

this is good

#

Thanks again

royal hawk
#

Amazing, have a great day 🙂

tight dawn
#

Hi Jack!

#

thanks for unarchiving this

#

Early in the thread @royal hawk suggested to use setupIntent https://stripe.com/docs/payments/save-and-reuse to get payment Method. I created an setupIntent, but I am unsure how to connect this with cardElement and subsequently get a paymentMethod back that i can attached on to customter's invoice_settings[default_payment_method]. The document shared is for paymentElement. So, if you can shine some light on this, that would be great.

compact remnant
#

Sure no problem. You can also use SetupIntent with CardElement.

tight dawn
#

Do you have documentation on this?

compact remnant
tight dawn
#

but stripe.confirmCardSetup still return setupIntent? I guess my confusion is, I need a paymentMethod.id to update to the customer's invoice_setting, how do i get that?

compact remnant
tight dawn
#

cool! let me give that a try.

#

sorry, one more question. stripe.confirmCardSetup , is this to be done on client side or server side.

compact remnant
#

stripe.confirmCardSetup is a frontend API.