#torkise
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- torkise, 16 hours ago, 15 messages
Which APIs or UIs are you using to process payments?
How are prices shown on your website today?
I am a bit unsure. Relatively new to the codebase, and the developer that set it up has quit ๐ฆ
It seems like we are fetching the price objects belonging to each product object, and showing the currency and unit amout of that response.
If you can share a pi_xx ID for a payment that would help me
Yep, totally fine
That's the ID of the payment method. Is there a payment ID? pi_xxx
pi_3NmggbJmp1IbLmZS1YRdWMFq
Taking a look!
When you say 'price object has multiple currencies', is that configure in Stripe?
Because that payment is not using price_xxx objects: https://dashboard.stripe.com/logs/req_SZjx6ABg3pRGPI
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
yepp, multiple currencies are are added to the price object
But your integration is not using those price_xxx objects in your API calls (see above). You're simply passing the amount and currency parameters which probably reflect the values of what you've configured
If you want to use a different currency, your integration will need to provide that in your API call
So, all our payments are only done in 1 currency now?
I'm not sure if they all are, you've only provided me with one example
But you should be able to determine that from your code
I can see the products are fethed with this code
"""const stripeProducts = await stripe.products.list({
ids: ids,
});
const basicProduct = stripeProducts.data.find(
(p) => p.id === process.env.NEXT_PUBLIC_STRIPE_BASIC_PRODUCT_ID
);
const premiumProduct = stripeProducts.data.find(
(p) => p.id === process.env.NEXT_PUBLIC_STRIPE_PREMIUM_PRODUCT_ID
);
const basicPrices = await stripe.prices.list({
product: basicProduct.id,
});
const premiumPrices = await stripe.prices.list({
product: premiumProduct.id,
});
const premiumProductWithPrices = {
...premiumProduct,
prices: premiumPrices,
};
const basicProductWithPrices = {
...basicProduct,
prices: basicPrices,
};
"""
We aren't automatically changing the currency like you think we are though
I think i read somewhere in the docs that if a price has multiple currencies, Stripe chooses the appropriate currency based on the currency of the card of the customer?
Only if you're using Checkout surfaces, which it seems you're not: https://stripe.com/docs/payments/checkout/multi-currency-prices
ahh okei. I see we have most our payments in NOK, and a few that are done in Euro. Is the payment done in the correct currency, even tho only the main currency is shown in the interface?
How do I extract the correct currencie from the API call? Seems to me like the API only returns the main currency
Is the payment done in the correct currency, even tho only the main currency is shown in the interface?
The presentment currency would be whatever you pass to the API viacurrencyparameter. It may settle in a difeerent currency on your account dependent on bank accounts etc
How do I extract the correct currencie from the API call? Seems to me like the API only returns the main currency
Not sure what you mean by 'correct currency'
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
The corrrect currency is the currency in the country the user connects from. How do I get it from the API?
We wouldn't have that information in the API unless you provided it to us, which you're seemingly not
ok, so if I have understood it correctly, the payment may be done in one of the currencies added to the price depending on the bank account of the customer. So the issue seems to be the price that is shown to the customer on the shop interface
What d oyou mean by provide it to you?
Your integration seems to work like this:
- You fetch Price objects from the Stripe API
- There's some kind of checkout/store UI that renders them. Customers select a product that maps to a Price in Stripe
- You seemingly pass values (
unit_amount,currency) from those objects to the API when creating the Payment Intent - How you determine which currency is used for the payment would depend on your application logic
You keep referencing 'correct currency' and 'main currency', yet there's only one currency field on the payment and that is eur in the example you shared
Can I send you the id of a price object?
If you're charging customers in EUR for example, and they have a NOK nominated card/bank account then they will likely be a FX that happens at their bank
There's no currency conversion/FX done on Stripe
It's not really relevant I don't think. What is relevant is how your integration gets the amount and currency values that it sends to the API
hmmm okay. The Unit_amount and currency values are fetched from the Price API
Yes, I understand that. But how your application determines which currency to use is the missing piece and something you control, not us
okay
When I fetch a price object from the API, only one currency is returned in the response, correct? https://stripe.com/docs/api/prices/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I have not been able to get all available currencies in a price object in the response. How do I do that?
If I can get a hash with currency as key and the corresponding unit amount as the value I will be a happy man
You need to 'expand' currency_options: https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
It's not included in default API responses
okey! Thanx.
So seems like i should do the following:
- Expand the respons to get multiple CURRENCIES and the corresponding UNIT_AMOUNT.
- Pass the correct CURRENCY and UNIT_AMOUNT to the checkout (I should fix this with my own logic).
Anythin else I need to think about?
Sounds about right yep. Obviously you need to determine customer location somehow in order to use the local currency for them
Thank you!
Worth understanding too that if you present in non-settlement currency, then there will be FX on Stripe
You're a NO merchant, so you can only settle in NOK: https://stripe.com/docs/payouts?account-country=NO#supported-accounts-and-settlement-currencies