#rocket_subscription-defaultpm
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/1285287979727982755
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
@queen trellis there is no such property really. If the Invoice is for $0, then nothing is paid, so there's no card brand to look for or show.
My guess is that you have a completely different question to ask. Like maybe you want to do what the default payment method is? Or something like that
im trying to mimic how the customer portal UI shows a card when upgrading or downgrading, so the question is how can i show the default payment method for a customer?
but im not entirely certain how it works on stripe's end, if a user then ads a different card and pays with that, will it become the default card? i dont want to show the wrong card
It depends how you integrated in the first place. There are multiple layers of default PaymentMethods. See https://docs.stripe.com/billing/subscriptions/payment-methods-setting#payment-method-priority
But assuming it's at the Subscription level you would look at the default_payment_method on the Subscription and it'd have an id pm_123 that you can retrieve.
Or your'd cache this in your own database
understood
so a subscription has a default payment method, correct?
thats probably what i was looking for, thank you
rocket_subscription-defaultpm
A Subscription can have a default PaymentMethod. It's not guaranteed, it depends on your integration so that's what you'd look for
my integration is just making user go to stripe hosted customer portal to manage subscription
okay then you likely want to look at the Customer's default payment method in invoice_settings[default_payment_method]
if a user pays with a different card, will it become default payment method? in such a case i have a concern that i would show wrong card
Damn I'm sorry this is really subtle and it depends on different things. There is no "one size answer" unfortunately. You will have to handle edge-cases so look at the Invoice and its underlying PaymentIntent/Charge if any. If there is, use that PaymentMethod's information, otherwise should the default PM on the Subscription and if none the one on the Customer.