#alphazero_best-practices

1 messages ยท Page 1 of 1 (latest)

ivory gateBOT
#

๐Ÿ‘‹ 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/1235220858944098374

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

tropic marsh
spare peak
#

but for that I need to explicitly provide currency correct?

#

I want a solution that would directly present correct currency based on the currency available on the product

tropic marsh
#

You only specify the currency if you want to override the checkout behaivor of currency localisation. If you don't pass currency then Checkout handles it automatically
https://docs.stripe.com/payments/checkout/multi-currency-prices#specify-currency

When you use multi-currency Prices in a Session, Checkout automatically handles currency localisation for your customers.

However, you can override this behaviour by specifying a currency during Checkout Session creation.

spare peak
#

alright

#

but there is another issue

#

for example current product has few subscription active rather than being able to add currency to that product I am only able to add new price

tropic marsh
#

Oh I wasn't aware of that limitation, let me check

#

I think i misunderstood you there.

Are you saying you can't add a new price with different currency to the product? OR are you saying you can't update the current currency of the price that your customers are subscribed to?

spare peak
#

Let me provide the screenshot

#

sorry my laptop is glitching

#

didn't get a notification

tropic marsh
#

Ah so you're trying to update currency on an existing price. That's not something we support. You can only create a new price with the new currency.

#

Taking a step back, why are you trying to update an existing price currency? I thought you wanted to present currency based on location?

spare peak
#

Yes, but some limitation on development side is such that they are leveraging price id rather than product Id to get subscription rate

#

I understand this is wrong

#

and it's a complete mess, and I really dont want to refactor the payment module

tropic marsh
#

Yes, but some limitation on development side is such that they are leveraging price id rather than product Id to get subscription rate
I don't know what you mean by that. Can you elaborate?

spare peak
#

as you can see this leverages the price Id being presented to the backend

lusty marshBOT
opal notch
#

Hello ๐Ÿ‘‹ catching up but I am having trouble understanding what you are blocked on here. Is it updating the price on the existing subscriptions that were created at this current price? Or something else?

spare peak
#

No, it isn't updating price on currently active subscription. I am trying to implement geolocation based pricing. Well as hanzo mentioned above that I cant update currency on existing price. So I'll have to reference a new priceId

#

however there is only one issue left in checkout

opal notch
#

Gotcha, and what is that issue?

spare peak
#

I have configured new price for the same product however it is unable to load PKR price in pakistan region

opal notch
#

Interesting, so the price's other geos work but specifically Pakistan is not localizing properly?

#

Can you send me the ID of that price? (price_1234)

spare peak
#

price_1PBLK7HsXs2PHaSLZPdhtHTx

opal notch
spare peak
#

So how can I charge in PKR?

#

from checkout

#

do I have to check IP address and show localised pricing from there?

#

that can be circumvented via VPN

opal notch
#

Yep, to present in PKR you would specifically need to specify it. So I think for now that would meant that you would need to have some geolocation logic to know when to specify PKR

spare peak
#

and to use currency within context of checkout session, I'll have to utilize productId rather than priceId

opal notch
spare peak
#

though it presents few issues

#

You cannot combine currencies on a single customer. This customer has an active subscription, subscription schedule, discount, quote, or invoice item with currency usd.

#

that's the error

opal notch
#

To have two subscriptions with different currencies, you would need to make another Customer object to represent that same person. I understand that that may not be ideal but that is the workaround at the moment

spare peak
#

Alright

#

You were of great help.

#

thanks a lot for helping me solve this