#.jovanm_
1 messages · Page 1 of 1 (latest)
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.
Hello
What integration are you using to start a Subscription here?
Is this a custom flow with Payment Element?
Yes, custom flow with Payment Element.
Gotcha, then the PaymentMethod will be attached to the Customer automatically but you want to set payment_settings.save_default_payment_method (https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-save_default_payment_method) to have the PM set as the default for the Subscription as well so that it is automatically charged in the future
How do you know that the customer is currently using this payment method? Since, currently, the customer has different payment methods.
Not sure what you mean by that? That screenshot is not one of our UIs.
Are you using a plugin?
Ah yes, I've created it.
So are you asking how to know which PaymentMethod is set as the default on the Subscription?
Yep
Gotcha, you look at default_payment_method: https://stripe.com/docs/api/subscriptions/object#subscription_object-default_payment_method
Thanks!
Is this also possible for one-time payment? To know which card being used in one-time payment?
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
Sure thing
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?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
See above
That will set it automatically
Unless you are talking about updating an already-started Subscription
Like changing the PaymentMethod
Not setting it
Yep, I'm talking about that hehe.
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
I see, sounds good. When should I passed the PaymentMethodId, is it in this part? After confirmSetup?
Yep