#shahanajoy

1 messages · Page 1 of 1 (latest)

frosty questBOT
balmy parcel
#

Hi there!

#

How are you accepting payments? Checkout Session, Payment Element, something else?

polar adder
#

const options = {
mode: 'payment',
amount: Number(val),
currency: 'usd',
paymentMethodCreation: 'manual',

#

const elements = this.stripe.elements(options);

this.paymentElement = elements.create('payment');
this.paymentElement.mount('#payment-element');

balmy parcel
#

So you are using the Payment Element.

polar adder
#

yes

balmy parcel
#

In this case, if you want to show a different currency depending on the lcoation, then that's something that you'll need to build yourself.

polar adder
#

Can you plz help to do that

balmy parcel
#

Not really, since it's not supported by Stripe. But basically try to guess (or ask) the location of the user. Then map the location to a currency, and convert the amont to the. corresponding currency.

polar adder
#

Here in the image, you can see the country is coming

#

so like that, shall we get cureency as well

#

?

balmy parcel
#

Like I said, that's not something that Stripe support with the Payment Element. So you'll need to build that yourself.
And if you want to use the coutry field of the Payment Element itself to change the currency, it will be tricky. Because I don't think there's a way to read that value before the form is submitted.

polar adder
#

ohh okie, will go through the documents

#

anyone implemented the same? do you have sample code or anything?

balmy parcel
#

No idea sorry. The simplest option here would be to use Checkout Session instead of the Payment Element.

polar adder
#

ok, Let me use checkout option then, So if I use checkout option anything need to be change in backend as our mone is deducting viaour service API call

balmy parcel
#

Yes you'll need to change pretty much everything. It's a completely different integration.

polar adder
#

Sure, Thank a lot