#Jayy
1 messages · Page 1 of 1 (latest)
You can't set the customer currency using the public API, that's a dashboard feature only.
awww okay :/ So i just use the currency option when creating the subscription then ?
You can specify the currency when creating a Subscription in fact.
Or the price currency will be used.
Just currious, why you want to specify the customer currency?
i'm not sure if it works as i think, but i'm fiddling through the dashboard creating a customer in a test-clock to try something. while creating a subscription i saw it filters the prices based on the customer's currency.
so i'm thinking what if a product of mine has 2 currencies for a price, USD and AUD, and the customer's price is USD, i think it would take the USD price rather than AUD based on customer's preference
i'm just thinking that's how it works xD haven't teseted it yet.. it helps me when creating subscriptions if that's infact how it works
because right now i have multiple prices for each product, 4 to be exact
2 in AUD (yearly and monthly)
2 in USD(yearly and monthly)
and i just use the price ID based on the customer's location to determine if they're paying in USD or AUD
but that would cause an issue if the customer uses a VPN and tries to pay in AUD when they already have a USD subscription. . locking the currency could save me from that
i'm not sure if it works as i think, but i'm fiddling through the dashboard creating a customer in a test-clock to try something. while creating a subscription i saw it filters the prices based on the customer's currency.
Correct
i think it would take the USD price rather than AUD based on customer's preference
i'm just thinking that's how it works xD haven't tested it yet.
Yes it should be like that, you can do a quick test to double check
but that would cause an issue if the customer uses a VPN and tries to pay in AUD when they already have a USD subscription. . locking the currency could save me from that
Currency isn't detected by customer location, it's detected by the first charge will be made by the customer, or you can force their currency when you create them via Dashboard.
alright so if their first charge is in USD, and the prices i have have 2 currencies (USD and AUD) then it will always choose the USD ?
cz right now rather than adding multiple currencies to each price, i have a different price ID for each currency
yes it should be like that, but I invite you to do a quick test to confirm this.
i'm doing so right now
it doesn't work like that 😦
so what i did is i created a customer (cus_O09PcTED76hMxi), and 2 products (prod_O09tggAiJm8ECm and prod_MjUFIbIvEBEu0s)
they each have 1 price ID, with 2 currencies (USD and AUD)
i subscribed to the first. which made the user's currency USD.
tried subscribing to the second it says
The currency of the selected prices (aud) does not match the customer currency (usd).
Ah because the price has aud currency as default one I think.
Did you had the chance to check this, between:
https://stripe.com/docs/payments/checkout/present-local-currencies?platform=multi-currency-prices
No I'll check it now
And yeah I intentionally did switch the main default currencies to see if stripe does the conversion
the reason this wont work is because we do not use the checkout feature directly to show the products. I am not sure why we choose the following flow:
customer chooses subscription + addons .. they link their payment payment method with the setup checkout API
await stripe.checkout.sessions.create({
mode: 'setup',
success_url: `${process.env.NEXTAUTH_URL}/payment/processing?sessionId={CHECKOUT_SESSION_ID}`,
cancel_url: `${process.env.NEXTAUTH_URL}/payment?canceled=true`,
customer: stripeId,
payment_method_types: ['card'],
})
which saves the payment in stripe. we use that to create/update the subscriptions
Ah ok I see, it should works to that. So in that case you need to manage currency of the customer in you rintegration.
i'll probably do that. Thank you so much for your help!
Happy to help!