#raghul-s_docs

1 messages ¡ Page 1 of 1 (latest)

queen quailBOT
#

👋 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/1308687672197517342

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

untold cypress
#

hello! Either the default_payment_method on the Subscription or the Customer is used. The Subscription's default_payment_method takes precedence. There's no quick and easy way to query this data from Stripe. You should save these details to your own DB to query for

versed epoch
#

Oh okay. Don't we need to check the payment_method field from latest_invoice's payment intent field in any case?

#

Looking at the default_payment_method of subscription & customer is sufficient, you mean?

untold cypress
#

what's your reasoning for checking the latest_invoice's payment intent?

versed epoch
#

When I reached to stripe discord last week to know which fields to refer for payment method used by subscription for billing, they responded as below,

Usually you'd look at default_payment_method Otherwise if that isn't set, you'd check on latest_invoice[payment_intent][payment_method] level to see how payment was made

untold cypress
#

I think the requirements here needs to be clarified - do you need to know the current default_payment_method set? Or do you need to know what was used to pay an invoice for a subscription?

A customer can pay an invoice with a different payment method than what was actually set as the default_payment_method. For example, maybe payment for an invoice failed and the customer used a different card to make payment, but didn't actually update the default_payment_method with that new card

versed epoch
#

I want to know the payment method which will be automatically charged for the next billing cycles by stripe

#

In the example case you mentioned in your message, the default payment method will be used for the next billing cycle?

untold cypress
#

then what i said is applicable, check the default_payment_method on the Subscription or the Customer. You don't need to check on latest_invoice[payment_intent][payment_method]

In the example case you mentioned in your message, the default payment method will be used for the next billing cycle?

yes

versed epoch
#

Only if a customer updates default_payment_method, the updated payment method will be used for the upcoming billing cycles. Am I correct?

untold cypress
#

yep, that's correct