-
Notifications
You must be signed in to change notification settings - Fork 6
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 CashApp Pay and Digital Wallet payments on Block Checkout for WooCommerce 9.3 #216
Conversation
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, thanks for the changes @iamdharmesh
Related #217 |
Note: The failing test (1 test is failing) is already fixed in the PR #204 |
QA Update ✅I have verified this PR in the I tested the following on this branch:
Testing Environment
Google.pay.movCash-app.mov |
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.
Code looks good to me. As discussed internally, Woo may be making changes in 9.3 that would remove the need for us to make this change. Going to hold off on moving this forward until we know for sure their decision
Going to close this out since the issue was resolved in Woo 9.3 itself and this fix is no longer needed |
All Submissions:
Changes proposed in this Pull Request:
This PR fixes the CashApp Pay and Digital Wallet payments on Block Checkout for WooCommerce 9.3. The issue was occurring only with WooCommerce 9.3, and I suspect it's due to the React 18 upgrade in WC 9.3. The token updates in the state are not reflected in
onPaymentSetup
whenonSubmit
is called.This PR fixes the issue by replacing
onSubmit();
withsetTimeout( onSubmit, 0 );
, breaking out of the current event loop to ensure state updates inonPaymentSetup
. We are having an ongoing discussion with the Woo Team to figure out the proper fix. However, with WC 9.3 releasing tomorrow, proceeding with this fix for now is fine.Closes #214
Steps to test the changes in this Pull Request:
Changelog entry