#_obo_
1 messages · Page 1 of 1 (latest)
There's no such thing as a general default for the customer for one-off payments
You can set a default for invoice payments using invoice_settings[default_payment_method] but for Payment Intents that you manage yourself you always need to specify a saved payment method by id
@eternal moth We'll be using this payment method for a monthly subscription
Ok, then you can use that customer setting
basically we'll be creating the payment method via payment elements react component
and want it to automatically be set as the default payment method for the customer
can we not do this with a singular action? you're saying we have to first create the payment method and then update the customer in a second follow-up request?
yes, you need to make an api call to set that on the customer explicitly, there is currently no way to do that otherwise
Is this the recommended path then for subscriptions?
or do we not really need a "Default" payment method
(basically am I trying to do something weird and should actually be handling this whole flow differently)
It's not weird, no, you're trying to set a customer default for all subscriptions and invoices that dont specify a payment method themselves
When you set up the subscription, if collecting a new payment method then, you can have it set automatically on the subscription (subscription.default_payment_method) but not the customer
https://stripe.com/docs/api/subscriptions/create?lang=curl#create_subscription-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.
good to know. Thank you