Skip to content
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 the "0.00" amount in Google Pay for virtual products (3696) #2636

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

stracker-phil
Copy link
Collaborator

Description

This PR addresses two issues with Google Pay:

  1. When shipping callback is disabled, the Google Pay sheet displayed the total amount of "0.00" instead of the actual product price.
  2. In Block Cart, certain plugin constellations led to transmitting the incorrect payment method ID for Google Pay

Details

Issue 1

  • It was only a "cosmetic" problem that was confusing for the customer, while the store did charge the correct amount during order processing.
  • The bug was caused by lack of shipping cost details, which resulted in shippingFee being set to NaN, which could not be used in an invalid total value that was rendered as "0.00"
  • Fixed by casting shipping fees to a number: 643a23c

Issue 2

  • Might be a bug in WooCommerce, and will be escalated. The current PR includes a workaround to ensure our plugin always sends the correct payment method on the Block Cart page
  • Note that the Google Pay payment from Block Cart currently only works when "Final confirmation on checkout" is enabled, as the express logic is not fully integrated in the Block system
  • Fixed using an internal WooCommerce dispatcher: c852bc9#diff-4031c86ec91715f38d15ad5de3c4cbed531cbc95e7b8e3326aaa9153faa376b8R82-R84

When shipping is disabled, the shippingFee is `undefined` which also resulted in the amount to become `NaN`
- Remove unused imports
- Use state instead of global window-variable (continuationFilled)
- Apply codestyle rules (spaces, change one let to const)
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