#zuccling
1 messages ยท Page 1 of 1 (latest)
Not currently possible. setup mode will save the payment method on the Customer object provided/created, but it won't set it as default (and there's no way to do that with Checkout)
You'll need to make a subsequent API call to make it the default: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-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.
thanks, just wondering, is there even a need to set a default payment? or will stripe automatically charge the available method even if its not set as default?
It depends on what kind of payments you're doing. Can you elaborate?
i want to create a usage based subscription for customers, where they first save their payment details for later (and can manage this through the stripe customer portal)
when they use the product, we will create usage charges for that subscription
the flow is pretty similar to the example https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=checkout
my question is that, if we create a checkout session in setup mode and the customer saves their bank details (and it is not a default payment method), when we subsequently create a subscription and usage charges for that customer, will they still be charged with that payment method given it is the only one on the customer account? ie would we even need to "set it as default" given its the only method?
How are you creating your subscription?
with the create subscription post request
In that case, if only passing the customer parameter and expecting it to charge their default PM (and subsequently not passing the payment_method parameter) you'd need to set it manually following the Checkout Session
so it would be like create checkout session > set default PM > create subscription ?
Yes exactly
perfect thank you
np!
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
just a follow up, if i create a checkout session with mode subscription, is it possible to set the payment method of the subscription e.g. to au_becs_debit?
i've found i can set the payment method of the checkout session, but when a customer goes back to manage payments, they can use more methods (since it was not specified in subscription creation)
yes you can specify which payment method types you want https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_method_types
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i've tried this and it only sets the payment method for the checkout session, but not the subscription that's created if that makes sense
e.g. i create a checkout session with payment method = au_becs_debit and mode = subscription
when customer goes back to manage payment methods through customer portal, it allows both card and au_becs_debit as valid methods since the subscription didnt have those flags
oh I see now
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
you can change the settings here ^
this doesnt really help with the issue
basically im trying to not allow customers from using their card and only enabling one payment method (au_becs_debit) for the subscription
stripe seems to have card on the payment elements by default
so the current work around i found was create checkout session (mode: setup, payment_method: au_becs_debit) > create subscription (payment_method: au_becs_debit)
but just checking if those two calls could be combined in one with the same result
since checkout session (mode:subscription, payment_method: au_becs_debit) still allows card to be added after the fact
could you please share the request id or the checkout session id?
cs_test_a16aneprUW4M1MoEThsGJZQ4GkKUPut7j4cXEmQlh7W4oIYoHbW8KHjajZ
so even though it was created with one payment method, it allows me to add card as another and use that
taking a look
thanks
i guess the expected behaviour would that when setting checkout session to subscription, the payment method set also gets set for the subscription
I think the Customer Portal Settings don't allow you to select which Payment method types to accept
so if you want to restrict to a certain PM type(s) you would have to "turn off" the other PM types in this settings page https://dashboard.stripe.com/test/settings/payment_methods
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
no not really I don't think so
you can try to contact support via https://support.stripe.com/?contact=true
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
at least to submit your feedback and state your use-case