#rocket_subscription-defaultpm

1 messages ¡ Page 1 of 1 (latest)

next mantleBOT
#

👋 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.

wet crescent
#

@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

queen trellis
#

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

wet crescent
queen trellis
#

understood

#

so a subscription has a default payment method, correct?

#

thats probably what i was looking for, thank you

wet crescent
#

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

queen trellis
#

my integration is just making user go to stripe hosted customer portal to manage subscription

wet crescent
#

okay then you likely want to look at the Customer's default payment method in invoice_settings[default_payment_method]

queen trellis
#

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

wet crescent
#

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.

queen trellis
#

okay, i fully understand, deeply appreciate this information

#

thanks again ⭐