#dragon.frost

1 messages · Page 1 of 1 (latest)

pulsar crescentBOT
opaque stirrup
#

Can you share share where you set the PaymentMethod ?

#

you set it at Subscription level or Customer level ?

glass lotus
#

Subscription level when creating a subscription

opaque stirrup
#

So yeah you want see it at Customer level in the Dashboard

glass lotus
#

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?

opaque stirrup
glass lotus
#

how to I use this api from node/react? I can't find anything

opaque stirrup
#

it's the customer update API in the sdk stripe.customers.update

glass lotus
#

how is this different from "stripe.paymentMethods.attach"?

opaque stirrup
#

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

glass lotus
#

do I need to call stripe.paymentMethods.attach before updating the invoice_settings.default_payment_method?

opaque stirrup
#

yes

pulsar crescentBOT
glass lotus
#

Is this how I do it on node?

  stripe.customers.update(customerId, {
    invoice_settings: {
      default_payment_method: paymentMethodId,
    },
  });
#

because its not working at expected

opaque stirrup
glass lotus
#

Sorry its working now. my seems like my hot reaload was not working at that time