Adyen / adyen-magento2-express-checkout

Adyen Magento 2 Express Checkout Module
MIT License
11 stars 6 forks source link

[ECP-9565] Apple Pay - Invalid amount with JPY currency #153

Open dimitriBouteille opened 5 days ago

dimitriBouteille commented 5 days ago

Describe the bug

We have an issue in JP production. While loading, Apple Pay popup adds two extra zeros to the price before reverting back to the correct price. Please see below :

image

Looking a little in the Apple Pay code of the Adyen/adyen-web, I see that there is a system that formats the price according to currency. I think we should use the same logic to correct this bug.

packages/lib/src/components/ApplePay/payment-request.test.ts

Capture d’écran du 2024-11-25 17-47-04

https://github.com/Adyen/adyen-web/blob/7854997038bc384ed3acd47f702c58ee2cb7ebe6/packages/lib/src/utils/amount-util.ts#L27-L30

https://github.com/Adyen/adyen-web/blob/7854997038bc384ed3acd47f702c58ee2cb7ebe6/packages/lib/src/utils/amount-util.ts#L10

https://github.com/Adyen/adyen-web/blob/7854997038bc384ed3acd47f702c58ee2cb7ebe6/packages/lib/src/utils/constants/currency-decimals.ts#L1-L4

To Reproduce

Steps to reproduce the behavior:

  1. Add product in cart with JPY currency
  2. Go to cart
  3. Start Apple Pay express checkout
  4. 💥

Expected behavior

The price must be correctly formatted.

candemiralp commented 1 day ago

Hello @dimitriBouteille,

Thank you for reporting this issue. Indeed, I've confirmed this bug and created an internal ticket to solve this issue.

Best Regards, Can