#m0uka_api
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/1222613088491143178
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, the Payment Element would not show a payment method that is not supported in that country. You can confirm that Klarna, https://docs.stripe.com/payments/klarna > 'Supported customer countries' is available for customers who are located outside of the US.
Yes, but our US-based business cannot transact with customers outside the US, as stated in your linked article
The same thing occurs with Cash App Pay too
The payment method is displayed, but once attempting to pay, an error occurs:
Cash App Pay does not support 'CZ' as the billing country, it only supports 'US'.
To confirm, you have a customer who has a 'CZ' billing address. You pass that address when you create the Element on an account that is located in the US and the customer can see Cash App?
exactly
๐ stepping in
To be clear, you are setting billing address as a default value here before Payment Element creation?
yes. we are passing in billing details like this
That looks like you are passing this to confirmPayment(), no?
You would want to pass this to defaultValues: https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-defaultValues
So that the billing country is set to CZ
oh I see
At that point, CashApp shouldn't appear
does the React Stripe.js library support this?
got it, we are probably on an older version so I don't see it in the props
sorry for the confusion, thanks for the help
No worries
hmm, just tried to populate the defaultValues with the address in the PaymentElement options, and it still seems to display the other methods, could it be due to me being in test mode?
You see the country of PaymentElement set to CZ and you still see CashApp?
Can you show me a screenshot?
yes, attached some screenshots
Hmmm odd. Give me a min to look further
My colleague is still doing some testing here
I was under the impression it would hide Cash App in this case.
Will circle back shortly
no rush, trying out stuff on my end too
i can provide the client secrets/IDs if needed
Okay @west crypt sorry for the delay. Looks like this is actually a bit more complex than expected and for a variety of reasons we don't hide CashApp in this scenario. I'm going to file feedback internally as I think we should look at changing the behavior here.
For now, your workarounds are either to:
- Just throw an error in this case if the customer tries to use CashApp
- listen for the
changeEvent (https://docs.stripe.com/js/element/events/on_change?type=paymentElement) and show an error proactively if the customer selects CashApp - User the Payment Methods Config API (https://docs.stripe.com/payments/multiple-payment-method-configs?dashboard-or-api=api) to select which payment method types you show... so for a non-US customer you exclude CashApp
that's a shame because we already do 1 and it confuses a lot of EU customers. thanks for the help anyway
will look at 3 though
Yeah agree that this isn't the best experience right now.
But yeah I'll file feedback and hopefully we will adjust this for better UX
thanks, enjoy the rest of your day