#szy_unexpected
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/1230883579446427660
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- szy_best-practices, 2 days ago, 17 messages
- szy_custom-checkout-beta, 3 days ago, 8 messages
Hello
Hey ๐
Can you share the Customer ID or Subscription ID from your reproduction?
I'd like to see exactly which properties you are using
customer id: cus_Px81GMk8bm4EAc
subscription id: sub_1P7DxGC5Vnk6f7u9H0DKdrWC
Thanks, looking
Alright yeah the invoice_settings.default_payment_method property is what you want to examine: https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method
If you don't have a default set on the Subscription then this is the PaymentMethod that will be charged
That does not change when you attach a new PaymentMethod to the Customer unless you explicitly update that property
that's what i used before to detect customer's payment method. The problem with that is that in such scenario: i deleted card that was default on a subscription -> the invoice_settings.default_payment_method is null. i think it's null until it's charged when the next payment happens.
From what I'm seeing on that customer specifically, the default payment method was always set explicitly by a dashboard action. It looks like our dashboard makes sure to specify invoice_settings.default_payment_method when you add a new card
https://dashboard.stripe.com/test/logs/req_h32ajhwEO3PsLS
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Whoops wrong request
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
That is the kind of call I am seeing for that customer. As far as I can see it wasn't automatically set
I think that was done on a different customer (removed from my app).
should i reproduce it on this customer?
If you can I would appreciate it, I will try myself as well
just did it
I see you removed the default. Are you saying that if you start a subscription now another card will be charged?
I removed the default from subscription. i want to be able to detect which one is the default now since no other default payment method was applied to a subscription after that.
From what i understand. the new default will be the latest added card, unless i change in dashboard the default card for the customer. that's a bit confusing if i want to display for the user what's their default payment method.
From what I understand, we try to use: the subscription's default -> the customer's default PM -> the customer's default source. Your customer currently does not have the last two, so as I understand it we wouldn't charge the existing card that is saved to that customer
Can you create a subscription on that customer to confirm if we charge that card or not? I think the doc you linked to is specific to our Sources behavior. Because the dashboard is setting the cards as the default Payment Method, I don't think that behavior applies.
there is a subscriptoin on that customer already
Right, but nothing will be charged on that subscription for a bit. I was saying create a new subscription to check what happens when a subscription charges a customer in that state
i can only have one subscription per user
i could simulate in stripe dashboard one month from now to see what will happen. should i?
Yes please
yup, i got a failed payment.
Attempted to charge the customer's payment method on file 9 times and failed. No more retries are scheduled.
okay, i think that's good then. i should basically not allow the user to remove the default payment method before switching to a different one and rely on the data from the invoice_settings.default_payment_method property.
(i mean i could allow but then i need to handle updating default payment method with one of the existing one when the user removes the default payment)
Thank you for confirming that behavior. And yes that makes sense as a way to handle this. Happy we could clear this behavior up
thank you