简体   繁体   中英

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: 在此处输入图片说明

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM