#AlexL
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Not sure I completely follow the ask. Do you have an example you can share so that I am on the same page?
One option could be to retrieve checkout session line items
https://stripe.com/docs/api/checkout/sessions/line_items
But not sure what data you're looking for exactly so more details would help
so, I create a Checkout Session, and I have a product with pricing in EUR, USD and GBP
when I open the Checkout Page, Stripe will show the currency based on user country
but, I would like to get somehow the currency before opening the stripe Checkou page, so I could show the right currency on my pricing page
so, as you see, the checkout page shows EUR
and I need tho get somehow the currency to show it on my pricing page
Also trying to do this. My current way has been like this on client:
try {
const geo = Intl.DateTimeFormat().resolvedOptions();
if(geo.locale.includes("-US"))
return "usd";
else if(geo.locale.includes("-GB"))
return "gbp";
else if(geo.locale.includes("-JP"))
return "jpy";
else if(geo.locale.includes("-AU"))
return "aud";
else if(geo.locale.includes("-CA"))
return "cad";
else if(geo.timeZone.includes("Europe"))
return "eur";
else
return null;
}
catch {
return null;
}
});```
would love to know if there was an best way to go about this
Gotcha. So you're use multi-currency pricing?
https://stripe.com/docs/payments/checkout/present-local-currencies?platform=multi-currency-prices
yes
Got it. Hmm, I don't think there's an API for this unfortunately.
You'd need to geolocate the customer yourself and then find the appropriate currency from the line-items once you've retrieved them.
Which seems like what you're doing already I guess.
@wheat seal I've created a multi-currency price, (Dollars and pounds), however my Checkout session always shows Dollars - is there a setting to show the local currency if available?
I test it with a VPN ๐
@zenith cedar either use a VPN or try setting customer email for a specific location as shown in our docs here
https://stripe.com/docs/payments/checkout/present-local-currencies?platform=multi-currency-prices#test-currency-presentment
Also, if you have follow ups then let's open up a new thread instead
hmm I am based in UK so I thought that would be enough to trigger?