-
Notifications
You must be signed in to change notification settings - Fork 69
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
fix: pricing decimal formatting for tokenized cart #8998
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +26 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍 Left a few cosmetic non-blocking comments, and I also have one question: when using currencies with two decimal places (I tried with USD & Hungarian forint), no matter how many decimal points I set in the settings, Google Pay modal always displays the price with two decimal points. The price is correct so I don't think that this behavior is incorrect, but rather worth mentioning.
client/tokenized-payment-request/transformers/__tests__/wc-to-stripe.test.js
Outdated
Show resolved
Hide resolved
client/tokenized-payment-request/transformers/__tests__/wc-to-stripe.test.js
Outdated
Show resolved
Hide resolved
client/tokenized-payment-request/transformers/__tests__/wc-to-stripe.test.js
Outdated
Show resolved
Hide resolved
…stripe.test.js Co-authored-by: Timur Karimov <timur.karimow.95@gmail.com>
…stripe.test.js Co-authored-by: Timur Karimov <timur.karimow.95@gmail.com>
…stripe.test.js Co-authored-by: Timur Karimov <timur.karimow.95@gmail.com>
Yeah, it's up to GooglePay (or Stripe?) to decide whether decimals are displayed or not. With these changes, I'm just trying to ensure the correct price is sent over :) |
Co-authored-by: Timur Karimov <timur.karimow.95@gmail.com>
Fixes tokenized cart for #8277
Changes proposed in this Pull Request
The amount displayed for zero-decimal currencies is wrong when using the PRBs w/ tokenized cart.
This is because Stripe has a concept of "zero decimal currency". Usually, we pass the PRBs a value expressed in cents. But for zero-decimal-currencies (like the Japanese Yen), the amount should be in Yen (they don't have Yen-cents).
Fixing.
Before:
After:
Testing instructions
2
to0
(for example - you could also try1
)npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge