#rock_code

1 messages ¡ Page 1 of 1 (latest)

chrome mesaBOT
#

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

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

polar baneBOT
#

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.

rigid sky
#

Hi hanzo.

One more information, similarly in the legacy code we have updaed the user card. and in except handling we have provided multiple error scenarios provided by Stripe such as stripe.error.CardError or stripe.error.InvalidRequestError or stripe.error.AuthenticationError

vestal grove
#

Hello
For these two payment methods, there's no way to test them out comprehensively in a way you would test, for example - a card

Also Since these methods don;t support non USD currencies and am not passing country so how will it take that amazon and cashapp is supported or not? And by chance it adds amazon pay as a default payment method for non USD currency then what might happen at renewal?
When you try to charge a payment method with a non-supported currency, you would see an API error.. You should be able to test it out..

rigid sky
#

But since when creating the checkout I am not passing amount or currency then how will take that the currency is supproted or not in this case?

#

It will directly update it and maybe then give error at time of subcription renewal.

vestal grove
#

How exactly are you charging these payment methods? You are creating subscriptions by calling the subscriptions API correct?

#

Oh.. You're using setup mode checkout sessions to update customer's attached payment methods

#

When you use checkout in setup mode, it doesn't really update their default payment method (which is used for subscriptions)

rigid sky
#

Yes, I just need the setup_intent to update the payment_methods

vestal grove
#

So you'd need to update that first and on renewal you'd see the error

rigid sky
#

I am updating the default payment method afterwards using the payment_method ID

vestal grove
rigid sky
#

And then updating the default payment method using the payment_method of the subscriptions obj

rigid sky
#

and hence I cam up with this solution

#

Which is working but not sure of error cases, one being currencies thing

vestal grove
#

To do this manually, you'd want to geolocate the customer using their IP or some other way.. Then create a checkout session for supported payment methods in their region..

#

does that help clarify?

rigid sky
#

i.e. while creating checkout session I should pass a additional param or maybe the user's ongoing subscription currency that will automatically detect and give me error

vestal grove
#

So there's a way for checkout to render only the supported methods (using automatic payment methods) but in your case, you're explicitly passing payment_method_types parameter and setting that to cashapp and amazon pay.

if you take out payment_method_types then checkout would only render supported payment methods for the customer_id you're passing in.. the customer should have a currency assigned after you create the subscription: https://docs.stripe.com/api/customers/object#customer_object-currency

rigid sky
#

Since I am not charging the user and only need amazon and cashapp to be enabled for the renewals. I did this.

chrome mesaBOT