#enis-checkout-default-pm
1 messages ยท Page 1 of 1 (latest)
Hello ๐
AFAIK we don't automatically store the payment method on customer
It is likely that the payment method was stored on the subscription itself
I tried to update customer with
invoice_settings: {
default_payment_method: event.data.object.default_payment_method,
}.
did you get an error or did that work?
Everything works fine, only default source is null on customer
default_source is for when you use Sources API
https://stripe.com/docs/api/customers/object?lang=curl#customer_object-default_source
if you're using payment methods API then you'd look at customer.invoice_settings.default_payment_method
const updatedCustomer = await this.stripeService.updateCustomer(customer.id, {
invoice_settings: {
default_payment_method: event.data.object.default_payment_method,
},
});
I tried this way..
and? do you not see the payment method on customer.invoice_settings.default_payment_method?
I get this info. Response:
invoice_settings: {
custom_fields: null,
default_payment_method: 'pm_1LVEiwJ6eUeCLTBYeDYfule6',
footer: null,
rendering_options: null
How can I get default_source, I need cardId property example: card_i213sdads
you keep referring to default_source but that's not what you're using
Why exactly do you need a card ID? what's the use-case?
I need to update customer payment card (billing information)..
You don't need a card ID for that
You can update the billing information on the payment method object using the API
https://stripe.com/docs/api/payment_methods/update#update_payment_method-billing_details
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.