#.jovanm_

1 messages · Page 1 of 1 (latest)

uneven zephyrBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

obsidian hollow
#

Hello

#

What integration are you using to start a Subscription here?

#

Is this a custom flow with Payment Element?

topaz heath
#

Yes, custom flow with Payment Element.

obsidian hollow
uneven zephyrBOT
topaz heath
#

How do you know that the customer is currently using this payment method? Since, currently, the customer has different payment methods.

obsidian hollow
#

Not sure what you mean by that? That screenshot is not one of our UIs.

#

Are you using a plugin?

topaz heath
#

Ah yes, I've created it.

obsidian hollow
#

So are you asking how to know which PaymentMethod is set as the default on the Subscription?

topaz heath
#

Yep

obsidian hollow
topaz heath
#

Thanks!

#

Is this also possible for one-time payment? To know which card being used in one-time payment?

obsidian hollow
#

No, there is no concept of a "default" for one-time payments

#

You pass the PaymentMethod ID to the PaymentIntent each time

#

So if you want the customer to have a "default" for that, then you would control that yourself outside of Stripe

#

And just pass Stripe the correct PaymentMethod ID that corresponds

topaz heath
#

I see, now I understand.

#

Thanks for your help here.

obsidian hollow
#

Sure thing

topaz heath
#

After confirmSetup(), I want the payment method to be set as a default payment method to the customer or subscription. Should I call these API:
https://stripe.com/docs/api/subscriptions/update#update_subscription-default_payment_method
https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method

in this part:
https://passimage.in/i/9db0a84714c443e6abbd.png

to set the default payment method? Or is there another way to set a default payment method?

obsidian hollow
#

See above

#

That will set it automatically

#

Unless you are talking about updating an already-started Subscription

#

Like changing the PaymentMethod

#

Not setting it

topaz heath
#

Yep, I'm talking about that hehe.

obsidian hollow
#

Ah okay then either of the above options work. Setting a default on the Customer means that PaymentMethod will be used for all Subscriptions for the Customer

#

Setting the default on the Subscription means it will be used for that Subscription as the default but it wouldn't affect other Subscriptions for the Customer if they have multiple

#

To be clear, both of those methods are called from your server

#

So you pass the PaymentMethod ID back to your server and then use one of those options

topaz heath
#

I see, sounds good. When should I passed the PaymentMethodId, is it in this part? After confirmSetup?

obsidian hollow
#

Yep