#captainhash

1 messages · Page 1 of 1 (latest)

molten robinBOT
delicate hollow
#

Hi! Let me help you with this.

timber thistle
#

I'm setting the default payement method like this

#

await this.stripe.customers.update(session.customer, {
invoice_settings: {
default_payment_method: paymentMethods.data[0].id,
},
});

delicate hollow
#

Are you setting invoice_settings.default_payment_method?

#

Yes, it's only used for Invoces and Subscriptions but not PaymentIntents.

timber thistle
#

and I'm doing my intent like this await this.stripe.paymentIntents.create({
customer: customerId,
payment_method_types: ['card'],
description: ${service}-token x ${quantity},
amount: unitPrice * quantity,
currency: 'eur',
confir

#

How can I set a default card for payement intent ?

#

Should I retrieve the default pm ?

delicate hollow
#

You can retrieve the Customer and get the invoice_settings.default_payment_method. And then set it in PaymentIntent.payment_method

timber thistle
#

Perfect ❤️

#

Have a nice day

delicate hollow
#

Happy to help!

#

You too