#cm5061_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1408551016366084168
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
I couldn't post as much context as I wanted to. But:
- I was surprised that a Subscription created from a checkout session would inherit that checkout session's
payment_method_types. I thought that only applied to the payment methods available in the checkout session. - We have exposed, for a long time, the ability for users to change their payment methods via a Stripe Billing Portal Session, and this is the first time we've seen this particular error. Has something changed recently?
This seems like it'd prevent a customer who started their Subscription with one payment method (at least via a checkout session) from switching to a different kind of payment method? card <-> us_bank_account and vice versa.
I also see the same error when trying to save the Subscription (sub_1Rw2nK2nDm85BVWRzlTxBl28) in the Stripe dashboard fwiw.
Subscriptions created from Checkout Sessions will inherit the settings specified in the Session. That is where we obtain the subscription settings from.
Does that mean that a Subscription created from a checkout session with payment_method_types=['us_bank_account'] could never change their payment method to a card method?
You can update the payment_method_types of the subscription [0].
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Right, we can update via the API. I think more specifically:
Does that mean that a Subscription created from a checkout session with payment_method_types=['us_bank_account'] could never change their payment method to a card method through a BIlling Portal Session, i.e. us issuing an API request?
No, the billing portal session will not update payment method type specified in the subscription.
I assumed that's what features.payment_method_update: true does in the billing portal configuration? https://docs.stripe.com/api/customer_portal/configurations/object#portal_configuration_object-features-payment_method_update
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
We've let customers update their payment methods through the billing portal for years
That allows customers to change their payment methods (one card to another or one account to another for example) not change the payment_method_type specified in the Subscription object.
Ah, I see. One more question if you have time
sub_1Q8lIG2nDm85BVWRajCYrF0h is an example of a Subscription that was created via a checkout session with payment_method_types (evt_1Q8lIK2nDm85BVWRaA16q5fn). You can see that it has payment_settings.payment_method_options and payment_settings.payment_method_types is null.
The Subscription that started this conversation, sub_1Rw2nK2nDm85BVWRzlTxBl28, was also created via a checkout session with payment_method_types. In this case payment_settings.payment_method_options is null and payment_settings.payment_method_types is ['us_bank_account'].
I guess I'm just looking for clarity on when one of payment_method_options and payment_method_types will be set, but not the other?
We only retain events for 30 days so I can't see what was included in the payload.
However, I can see that sub_1Q8lIG2nDm85BVWRajCYrF0h was created from cs_live_a197uFnyTsE8wI7A5YpAQsPKutako2n6Bfljx0vzr19Fk6E2QaDo9yEA6g and the following was specified in the Session
payment_method_types: {
0: "card",
},
However, I can see that sub_1Q8lIG2nDm85BVWRajCYrF0h was created from cs_live_a197uFnyTsE8wI7A5YpAQsPKutako2n6Bfljx0vzr19Fk6E2QaDo9yEA6g and the following was specified in the Session
Yeah, sorry if I wasn't clear, that's the point I'm trying to make. sub_1Q8lIG2nDm85BVWRajCYrF0h has null for payment_settings.payment_method_types.
Where are you seeing payment_settings.payment_method_types set to null for sub_1Q8lIG2nDm85BVWRajCYrF0h?
I'm looking at the event payload and we returned
payment_method_options: {
card: {
request_three_d_secure: "automatic"
}
},
payment_method_types: [
"amazon_pay",
"card",
"cashapp"
],
Sorry, was looking at the request that created the Subscription req_oefewO1UsEm2WL
This makes sense, payment_method_options are payment method specfic options. Only a handful of payment method types we support have options. Some include card, bank transfers, ach debit, etc.
Oh, this is not the request that created the subscription, this is a subscription update request.
I see what you're saying and I can see how this can be confusing.
Yeah sorry, I'm not doing a good job explaining it
req_og1WVwAbhor9Be is the request that created the subscription we return
payment_method_options: {
card: {
request_three_d_secure: "automatic",
},
},
payment_method_types: [
"amazon_pay",
"card",
"cashapp",
],
Which also matches what wsa included in the event you shared.
I'm not sure why the update request does not share the same information.
Discord closed at 5 EST and I have to run now unfortunately please send an email to support@stripe.com and someone will continue the conversation.
Here's what I think the most confusing thing is. The Subscription that started this conversation, sub_1Rw2nK2nDm85BVWRzlTxBl28, was created with payment_settings.payment_method_types = ['us_bank_account'].
Then at some point the user updated their default (customer) payment method to a card.
Somehow Stripe charged that card for the Subscription payment (even though it wasn't included in payment_settings.payment_method_types).
Now, through no action of ours, the Subscription record is invalid in Stripe. Unless we change payment_settings.payment_method_types, this Subscription cannot be saved.