#dan-paymentelement
1 messages · Page 1 of 1 (latest)
👋
To give you a specific example, have a look at the following request: req_SnPx9ayRuzeg2R
We make a request for a payment intent, deliberately including p24 (not supported outside of EUR or PLN).
{
"payment_method_types": {
"0": "card",
"1": "klarna",
"2": "afterpay_clearpay",
"3": "p24"
},
"amount": "12500",
"currency": "gbp",
"customer": "cus_KSK30VcZa3z65b"
}
The error we get back is:
{
"error": {
"message": "The currency provided (gbp) is invalid for one or more payment method types on this PaymentIntent. The payment method type p24 only supports the following currencies: eur, pln. Either correct the provided currency, or use a different PaymentIntent to accept this payment method type.",
"param": "currency",
"type": "invalid_request_error"
}
}
As per your documentation, we create a payment intent and then render Stripe Elements based on the secret returned. We don't know which payment methods are supported for the current currency, and so I can't see how this can be working correctly.
Our work flow is:
- Add to. basket
- Start checkout
- Create a payment intent
- Render Stripe Elements form
- Create an order and fulfil as a result of the redirect
We're using the lates versions of the Ruby gem server side, and the latest versions of both stripe.js and react-stripe-elements.
Additionally, if you take a look at this request: req_n0dCYfggVBw2aW you'll see that we're making a request for the following payment method types under the usd currency:
{
"payment_method_types": {
"0": "card",
"1": "klarna",
"2": "afterpay_clearpay"
},
"amount": "29900",
"currency": "usd",
"customer": "cus_KSK30VcZa3z65b"
}
The error we get back is this:
The currency provided (usd) is invalid for one or more payment method types on this PaymentIntent. The payment method type afterpay_clearpay only supports the following currencies: gbp, aud. Either correct the provided currency, or use a different PaymentIntent to accept this payment method type.
Whereas your docs state that this is available as a payment option in Australia, Ireland, UK, Canada, New Zealand and the United States.
first off, thanks so much for including clear details, the request ID, the full error msg and params passed, that helps me look quickly!
so for Afterpay, the currency is limited depending on what country you are: https://stripe.com/docs/payments/afterpay-clearpay#domestic-transactions-only
so for your account in UK, GBP is the acceptable currency, USD would work for US
Does that mean we can't process after pay payments in the uk from customers in the US?
you can, just that you cannot present in USD, you can present in GBP which US customers can pay, they pay the FX'ed equivalent in USD
Right, I see ok. That's a shame, but ok. Surely this means we need to keep track of which services are and aren't available in different currencies? Feels like we're always going to be out of sync with yourselves.
So I'm clear, we need to not send you payment methods that are unsupported by the current currency?
@unreal bloom to add to @snow hawk we're a little confused how this should work. on the site for Payment Element you say
Payment methods are also filtered to show only those supported by your customer’s local currency.
Which to me suggests that we pass the payment methods that we want to use and they'll only appear if supported by the users location/currency. We aren't seeing that though, instead our backend calls to Stripe::PaymentIntent.create fail if we pass methods that aren't supported by the currency. This is true for Klarna is it is for Afterpay it seems.
we need to not send you payment methods that are unsupported by the current currency?
correct, e.g. you cannot create a SEPA Debit PaymentIntent for USD as it only supports EUR for instance
Which to me suggests that we pass the payment methods that we want to use and they'll only appear if supported by the users location/currency. We aren't seeing that though, instead our backend calls to Stripe::PaymentIntent.create fail if we pass methods that aren't supported by the currency
answering that one sec
Payment methods are also filtered to show only those supported by your customer’s local currency.
do you have the doc where this line was mentioned?
Sure yeah its just here @unreal bloom https://stripe.com/docs/payments/payment-element
thanks, asking internally cause (full disclosure) that sentence isn't really clear and might imply something else when it means something different, one sec
ok clarified, they're going to fix that doc explanation as it isn't explaining what it means correctly
that feature is basically not referring to PaymentElement but rather, the combination of using PaymentElement with the upcoming (in beta) "Automatic Payment Methods" feature
With that feature, on the PaymentIntent.create() endpoint, say you pass currency: usd and payment_method_types: *
so instead of you passing n different p_m_types , the API will return all m PaymentMethods that your account supports for usd
and coupled with PaymentElement, PaymentElement will automatically display all m supported PaymentMethods on its UI (instead of you having to code m different UIs on your page)
and it will sort them based on the customer location too, so say (hypothetically) a location is more prone to using Afterpay, then Afterpay will be presented earlier in PaymentElement
in all cases, you ultimately do pass a currency for which you create a PaymentIntent so on the API side you do limit a PaymentIntent to a single currency
and then PaymentElement sorts the PaymentMethods by which a customer is better optimized to pay from