Zhang Zhan
Zhang Zhan

Reputation: 905

How to change Stripe's currency display on website?

I have done a easy website with stripe checkout, the javascript is pretty simple:

                    <script
                        src="https://checkout.stripe.com/checkout.js" class="stripe-button"
                        data-key="${homeForm.public_token}"
                        data-amount="4750"
                        data-name="My Product"
                        data-description="Something interesting"
                        data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
                        data-locale="auto"
                        data-zip-code="true">
                    </script>

It works fine. However, the amount "4750" in the above code is Australia Dollar, the problem is when Stripe checkout page appears, it shows "USD" as the screenshot: enter image description here

Is there a way to change "USD" to "AUD" and make sure the customer is charged with $47.5 AUD instead of USD?

Thank you!

Upvotes: 3

Views: 9135

Answers (1)

Spiff
Spiff

Reputation: 596

Checkout has a lot of additional parameters and the one you want here is data-currency. If you add data-currency=aud to the data attributes you'll get what you want. You can find all the options here: https://stripe.com/docs/checkout#optional

This is only for display purpose in the frontend though. To actually charge your customer in AUD you need to pass AUD to the currency parameter of your server side create charge call: https://stripe.com/docs/api#create_charge-currency

Upvotes: 3

Related Questions