#GeochiNova

1 messages ยท Page 1 of 1 (latest)

lilac kettleBOT
lean moon
#

Hi there!

#

You pass hidePostalCode: true in an options object

#

So it might look like <CardElement id="card-element" options={hidePostalCode: true} onChange={handleChange} />

olive kiln
#

options={{hidePostalCode: true}}

#

ok, I'll try

#

Yes, this works thank you!

lean moon
#

๐ŸŽ‰

olive kiln
#

@lean moon Can I also ask you how do I make it so that Stripe automatically displays the price in proper currency according to the country I'm in?
I'm using the following code to display the price:

<div>
<p className='text-purple-500 text-sm'>
{' '}
{price.unit_amount / 100 + '0'} {price.currency.toUpperCase()} / {price.recurring.interval}
</p>
</div>

I have two prices created for the product, with eur set as default. I'm in Spain
Another price is in GBP. Isn't Stripe supposed to select the one automatically? or ?

lean moon
#

No we don't handle any of that when you use Card Element. You build the entire UI yourself and Card Element solely collects the card details.

#

You would likely want to do geolocation via IP of your customer and then load the proper currency UI based on that (and create a PaymentIntent with proper currency within Stripe)

olive kiln
#

whoa.... sounds involved

#

so you're saying that I'd have to create different pages/components for each currency??

lean moon
#

Yes. If you want us to handle this for you then you should use Stripe Checkout and multicurrency Prices

olive kiln
#

what about PaymentElement instead of cardElement

#

same or not?

lean moon
#

Same in that Payment Element only collects the payment method. It doesn't display any UI about the purchase itself.

olive kiln
#

can I use the Multicurrency Prices with these elements? (don't know what they are yet)

lean moon
olive kiln
#

Since you understand this better. Can I pleas ask you to pretend that you're writing a chatGPT prompt, to write code for the, what was it - geolocation via IP and then loading proper currency UI and whatever else you think would make sense ?

lean moon
#

No can't really do that for you, sorry.

#

You as the developer should write this code.

olive kiln
#

๐Ÿ™‚ I tried

lean moon
#

Otherwise I'd recommend hiring someone to help you out on this.