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/214-v2: Fix Digital Wallets and Cash App Payment Issues in WooCommerce 9.8 #301

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

Conversation

Sidsector9
Copy link
Member

@Sidsector9 Sidsector9 commented Mar 11, 2025

All Submissions:

  • Does your code follow the WooCommerce Sniffs variant of WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Will this change require new documentation or changes to existing documentation?

Changes proposed in this Pull Request:

  • This PR adds a util deferExecution(), a workaround that defers execution to the next event loop cycle to ensure state updates are committed.
  • I'm fixing this using a workaround because I could not find a proper fix.
  • The PR also removes a redundant file.

Things I tried that did DID NOT work.

  1. Using useRef() to persist the Token.
  2. Using useTransition() to prioritize state updates.
  3. Using the Functional Updater Pattern: setTokenResult( ( prev ) => newToken ).
  4. Moving onSubmit() inside useEffect().
  5. Using queueMicrotask() to delay execution.

Closes #214
Closes #307

Steps to test the changes in this Pull Request:

  • Test Digital Wallets and CashApp.
  • Wait for E2E tests to pass.

Changelog entry

Fix - Fix Digital Wallets and Cash App Payment Issues in WooCommerce 9.8

@qasumitbagthariya
Copy link
Contributor

qasumitbagthariya commented Mar 14, 2025

QA Update ✅


I have verified this PR in the fix/214-v2 branch which has been fixed and is functioning as intended.

I tested the following on this branch:

  • Google pay
  • Cashapp
  • As Apple Pay is not supported in my region, I was unable to test it.
Screen.Recording.2025-03-14.at.4.12.51.PM.mov

Testing Environment

  • WordPress: 6.7.2
  • Theme: Storefront 4.6.1
  • Theme: Twenty Twenty-Four 1.3
  • WooCommerce - 9.8.0-beta.1
  • PHP: 8.0.30
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS 15.2
  • Branch: fix/214-v2

Steps to Test- As mentioned in the PR description.
Test Results - It is working as expected.
Functional Demo / Screencast -
Special Notes - Ready for code review (Woo)
Testing Document status:
Cases related to this Issue/PR are added to the Critical Flow Wiki pages:

  • Yes
  • Not Required/Applicable for this PR

@qasumitbagthariya qasumitbagthariya requested a review from a team March 14, 2025 11:01
@Sidsector9 Sidsector9 requested review from opr and senadir March 16, 2025 14:55
@Sidsector9 Sidsector9 removed the request for review from a team March 16, 2025 14:55
@Sidsector9
Copy link
Member Author

@opr / @senadir , pinging you guys as you're involved in the upstream issue: woocommerce/woocommerce#52473

Requesting review for the approach taken in this PR.

@opr
Copy link

opr commented Mar 18, 2025

@opr / @senadir , pinging you guys as you're involved in the upstream issue: woocommerce/woocommerce#52473

Requesting review for the approach taken in this PR.

Hi, thanks for working on this! I am unlikely to have time to review this until next week at the very earliest, if you have other folks who can help test/review this please could you reach out to them instead? Thanks 🙇🏼

Copy link
Member

senadir commented Mar 18, 2025

Thank you for the workaround @Sidsector9 I think it's a valid, clean hack. I haven't tested the flow but the code make sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants