#dragon.frost
1 messages · Page 1 of 1 (latest)
Can you share share where you set the PaymentMethod ?
you set it at Subscription level or Customer level ?
Subscription level when creating a subscription
So yeah you want see it at Customer level in the Dashboard
some thing like this?:
stripe.paymentMethods.attach(paymentMethodId, {
customer: customerId,
});
or am I missing something? because this does not seem to work as well
Where do I attach the default payement method to customer?
You need to update this field:
https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
how to I use this api from node/react? I can't find anything
it's the customer update API in the sdk stripe.customers.update
how is this different from "stripe.paymentMethods.attach"?
The payment method's atttach API is to attach a payment method to a customer, while this is to specify a payment method as a default for a customer
do I need to call stripe.paymentMethods.attach before updating the invoice_settings.default_payment_method?
yes
Is this how I do it on node?
stripe.customers.update(customerId, {
invoice_settings: {
default_payment_method: paymentMethodId,
},
});
because its not working at expected
Can you share the ID (req_xxx) of the failing API request?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
Sorry its working now. my seems like my hot reaload was not working at that time