Skip to content

Fix: express checkout displays wrong amount for JPY #4395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Mayisha
Copy link
Contributor

@Mayisha Mayisha commented Jun 5, 2025

Fixes STRIPE-494

When the store currency is set to JPY, the express checkout modals/pages display 100x the amount. This only happens on the shortcode cart and shortcode checkout pages.

Changes proposed in this Pull Request:

We are using the currency_decimals field to calculate price in the frontend but its value is never set on the backend. So by default 2 is used for every currency during the calculation.
This PR sets the currency_decimals in params to be used in the frontend.

Testing instructions

  • Set store currency to JPY and set the Number of decimals to 0.
Screenshot 2025-06-05 at 5 44 01 PM
  • As a shopper, add a product to your cart and go to the shortcode checkout page.
  • In develop, click the Link button and notice that the amount displayed is 100x more than the actual total price.
Screenshot 2025-06-06 at 12 08 26 AM
  • In this branch, click the Link button and confirm that the correct amount.
Screenshot 2025-06-06 at 12 08 36 AM
  • Check Google Pay and Apple Pay modals and confirm that they are showing the correct amount as well.
  • Purchase the product with express checkout and confirm that correct amount has been charged in Stripe.
  • Change the store currency to USD/Euro and Number of decimals to 2. Confirm that the amount displayed in express checkout is correct for this currency.

@Mayisha Mayisha marked this pull request as draft June 5, 2025 07:11
@Mayisha Mayisha marked this pull request as ready for review June 5, 2025 19:20
@annemirasol annemirasol self-requested a review June 9, 2025 14:37
Copy link
Contributor

@annemirasol annemirasol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM!

  • Was able to reproduce the issue*
  • Verified this PR fixes it
Before After
Screenshot 2025-06-09 at 10 24 02 AM Screenshot 2025-06-09 at 10 25 47 AM

* I can only reproduce the issue when my Link is logged out. After logging in, it fixes the price. When logged in, the price is always correct.

In develop:

Logged out After logging in
Screenshot 2025-06-09 at 10 24 02 AM Screenshot 2025-06-09 at 10 24 23 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants