#mateuszinsys_93238
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.
- mateuszinsys_93238, 18 hours ago, 34 messages
Hi 👋 I'm not quite sure I'm grasping what you're asking, so let me know if the below doesn't clear things up.
A default payment method can be set at the Customer object level:
https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method
or at the Subscription object level:
https://stripe.com/docs/api/subscriptions/object#subscription_object-default_payment_method
Default Payment Methods on the Subscription level will take precedence, but we will fall back to looking at the Customer object for a default Payment Method if a Subscription is configured to charge automatically but doesn't have a default payment method.
Subscriptions have a payment_settings.save_default_payment_method parameter that can be set to on_subscription to have the Subscription automatically save the payment method used for it as its default:
https://stripe.com/docs/api/subscriptions/object#subscription_object-payment_settings-save_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.
Thanks
So we are using payment_settings.save_default_payment_method during creating subscritpion, but the problem is that automatically the new provided credit card is conncted with subscritpion, and what we wanted is:
- save the cc as a default payment method for user
- ignore default_payment_method in subscritpion and by ignoring that subscritpion will use default payment method
There isn't a way to do that automatically, you'll need to avoid using the save_default_payment_method parameter, and manually set the default payment method on the Customer object when you determine it's appropriate to do so.
Why we wanted that -> when somehow user will have multiple subscriptions we wold like to have one source of payment and it should be default payment method configured on our side and connected to customer object not subscription object
But when I will ignore: payment_settings[save_default_payment_method] = on_subscription then payment method will not be saved am I correct?
I tested it, and when i will ignore payment_settings[save_default_payment_method] then payment method will be added, but not as a default
Yup, and that sounds like you want, right? You don't want the default payment method being set on the Subscription level. So you will need to manually set the default payment method at the Customer level when appropriate for your flow.