Skip to content

Wrong price formatting in Apple/Google Pay #4479

@Mayisha

Description

@Mayisha

Description

When the store currency is a 2-decimal currency but the number of decimals is set as 0 in the WooCommerce settings, Apple/Google Pay displays the wrong amount on the modal.

We transform the price here to express checkout format. The decimal value sent from the backend is considering the WooCommerce decimal. This is causing the issue in the calculation when 0 is set in the setting for a 2 decimal currency.

Steps to reproduce

  • Go to WooCommerce > Settings > General and scroll to Currency options
  • Set USD as the store currency
  • Set 0 as the Number of decimals
  • Enable express checkout in your Stripe settings page
  • As a shopper, add a product priced $18 to your cart and go to the checkout page.
  • Notice that, Google/Apple Pay is not present
  • Go to your cart and increase the number of products to 5 so that the cart total becomes $90.
  • Notice that, Google/Apple Pay is now present.
  • Click the express checkout button and notice that the displayed price is wrong.

Screenshots

Order Total
Image

Price on Google Pay modal
Image

Expected behavior

  • The displayed and charged price should be correct.

Reports

  1. https://wordpress.org/support/topic/issue-with-price-formatting-and-apple-pay-after-recent-stripe-plugin-update/
  2. 9977884-zd-a8c

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions