最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to change Stripe's currency display on website? - Stack Overflow

programmeradmin1浏览0评论

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

                    <script
                        src=".js" class="stripe-button"
                        data-key="${homeForm.public_token}"
                        data-amount="4750"
                        data-name="My Product"
                        data-description="Something interesting"
                        data-image=".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!

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

                    <script
                        src="https://checkout.stripe./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./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!

Share Improve this question asked Dec 18, 2017 at 13:13 Zhang ZhanZhang Zhan 9159 silver badges30 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

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./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./docs/api#create_charge-currency

发布评论

评论列表(0)

  1. 暂无评论