#puttekool

1 messages · Page 1 of 1 (latest)

grim cedarBOT
torn crane
#

Once the setupIntent is confirmed successfully, the payment method will be attached to the customer that you specified in setupIntent. After that you can call update API to update the customer's invoice_settings.default_payment_method with the newly collect payment method.

uncut pewter
#

great, ok but how do I forward the paymentMethod to the update call ? Earlier I did that with a confirmCardSetup where I could extract the setupIntent and then its payment_method like this: const { error, setupIntent } = await stripe.confirmCardSetup( setupIntentClientSecret, { payment_method: { card: cardElement } } ); and then use it in the update call by forwarding this: const paymentMethodId = setupIntent.payment_method; but now I only have extracter error and no setupIntent from confirmSetup instead of confirmCardSetup ?

torn crane
#

What error? can you shall with me the details?

uncut pewter
#

I cant do this: const { error, setupIntent } = await stripe.confirmSetup but with confirmCardSetup I could do this: const { error, setupIntent } = await stripe.confirmCardSetup and get the paymentMehod forward via the setupIntent.payment_method.

#

Like the stripe.customers.update does need a paymentMethod Id passed to it ?

#

Before I used a CardElement and confirmCardSetup now I want to update to PaymentElement

torn crane
#

You haven't told me anything about the error. Can you share me the error message from your console log?

uncut pewter
#

The error is that I can not add: const { error, setupIntent } = await stripe.confirmSetup TS error says: Property 'setupIntent' does not exist on type '{ error: StripeError; }'

torn crane
uncut pewter
#

exactly so any idea how I can get the paymentMethod to the stripe.customers.update ?

torn crane
#

You can get the list of attached payment methods through this API