#JontyBehr

1 messages · Page 1 of 1 (latest)

somber frostBOT
simple sedge
#

Can you share the sub_xxx ID?

ancient plaza
#

@simple sedge - here is the customer: cus_MnFpju64YyWYLF.
First subscription is sub_1M3fJnGCgNDU122LjgrTbAgD (this one is Active)
Second subscription is sub_1M3gjMGCgNDU122LY5GcHSpg (this one is Incomplete)

simple sedge
#

Is this the actual problem and, if so, what is the best way to handle it? I can't see a way via the api to set a default payment method?; OR
You can set a default at subscription level: https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method
or on the Customer object: https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method

#

The Subscription default_payment_method takes precedence in instances where both are set

ancient plaza
#

So, for the second subscription, what do I actually need to show to the customer before they enable their second subs?

#

Do I need to actually show them the payment element again?

simple sedge
#

For that specific subscription you'd need to confirm the PI with Stripe.js yes. Whether you need to collect payment details from the customer would depend on whether they have saved PMs

ancient plaza
#

OK, but in this case we do have a saved PM

#

Is it not possible to just set the default payment method on the customer when they enable their first subscription?

#

And then that will automatically get used when they enable their second subs

simple sedge
ancient plaza
#

(without me having to show a payment element to them for the second subs)

simple sedge
ancient plaza
#

Is that not the most optimal way to handle it?

#

Because then its set as their default, so if they enable multiple subs, it will just always be used

#

(and this is how it used to work pre payment intents)

heady storm
#

you can use customer.invoice_settings.default_payment_method sure, whatever works for you

ancient plaza
#

When you say " you can use" - what do you mean by that exactly?

#

Do you mean I can set that PM as the default, and it will be used automatically for the next subscription?

heady storm
#

yes

#

the way it works is

#

an invoice needs to be paid. We look at the following in order to find the payment method to charge

  1. subscription.default_payment_method
  2. subscription.default_source
  3. customer.default_payment_method
  4. customer.default_source
#

so I think that's clear and I'm understanding your question?

ancient plaza
#

Yeah, so after the first subscription, I can just set the PM as the customer.default_payment_method, right?

#

Or is it customer.invoice_settings.default_payment_method?

heady storm
#

the latter

ancient plaza
#

Understood, thank you.

#

So my last question then, is how do I retrieve that PM so that I can set it as the default?

#

An API request to /customers/:id does not show that PM anywhere in the response

heady storm
#

it would

#

ah right

#

sorry, misunderstood