#zuccling

1 messages ยท Page 1 of 1 (latest)

short vergeBOT
coarse sigil
#

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)

neat pilot
#

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?

coarse sigil
#

It depends on what kind of payments you're doing. Can you elaborate?

neat pilot
#

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?

coarse sigil
#

How are you creating your subscription?

neat pilot
#

with the create subscription post request

coarse sigil
#

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

neat pilot
#

so it would be like create checkout session > set default PM > create subscription ?

coarse sigil
#

Yes exactly

neat pilot
#

perfect thank you

coarse sigil
#

np!

simple heath
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

neat pilot
#

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)

simple heath
neat pilot
#

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

simple heath
#

oh I see

#

that's a bit odd let me double check

neat pilot
#

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

simple heath
#

oh I see now

#

you can change the settings here ^

neat pilot
#

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

simple heath
#

could you please share the request id or the checkout session id?

neat pilot
#

cs_test_a16aneprUW4M1MoEThsGJZQ4GkKUPut7j4cXEmQlh7W4oIYoHbW8KHjajZ

#

so even though it was created with one payment method, it allows me to add card as another and use that

simple heath
#

taking a look

neat pilot
#

thanks

#

i guess the expected behaviour would that when setting checkout session to subscription, the payment method set also gets set for the subscription

simple heath
#

I think the Customer Portal Settings don't allow you to select which Payment method types to accept

neat pilot
#

ah okay

#

is there a way to turn off card in those settings?

simple heath
#

no not really I don't think so

#

you can try to contact support via https://support.stripe.com/?contact=true

#

at least to submit your feedback and state your use-case

neat pilot
#

okay thanks will do

#

really appreciate the help!

simple heath
#

no worries

#

would you mind me closing the thread now?