#Emerson Garrido-checkout-session

1 messages · Page 1 of 1 (latest)

weary sonnet
#

Hello 👋
could you provide more context on the usecase here?

fiery snow
#

I want to charge 1 time, but I want to save the card data to charge the customer later

#

error mode setup

#

I can only use it with mode payment but it doesn't save the card data

weary sonnet
#

I see.
Let me quickly check few things

fiery snow
#

ok i will test

#

I'll be back if it's going to work

#

Error: Mode cannot be setup when using prices.

weary sonnet
#

Ah you can change it to 'payment'

fiery snow
#

How can I set it as the default payment method?

weary sonnet
#

How can I set it as the default payment method?
do you mean for a customer?

fiery snow
#

yes

weary sonnet
#

as far as I can remember, you'd have to update the customer later with the payment_method ID
I'm checking to see if there are any arguments you can include with the checkout session that can take care of it

fiery snow
#

okay

weary sonnet
#

any arguments you can include with the checkout session that can take care of it
Have not found anything on this yet but updating the customer with the payment method once the checkout session is complete, should work.

limpid crown
#

As hanzo said, unfortunately there is not a parameter to automatically do this. It is common to use the API to set the Payment Method as the default for the Customer after the Checkout Session has completed