-
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
Ensure Shopper Can Still Checkout Through Direct Checkout When WooPay Is Slow or Unavailable #9050
Conversation
This allows WooPay to set a custom timeout for messages that are posted to WooPay. If this custom timeout is not set, it defaults to 5 seconds.
Previously, if a message was posted to WooPay and WooPay did not respond, it would be possible for the DC flow to hang. Now, a timeout is added so that if a response is not returned within the allotted time, an error is thrown and the DC flow short-circuits back to the standard checkout flow.
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: +1.51 kB (0%) Total Size: 1.26 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.
After addressing the message name mismatch we discussed this all tested well. I'll jsut re-iterate here the test flows I ran through on the WooPay PR:
- I ran through all four regression scenarios with both PRs applied and all four worked as expected.
- I tested commenting out the setPreemptiveSessionData and setRedirectSessionData listeners on WooPay and confirmed it fell back to the merchant checkout.
- I tested with WooPay "down" and confirmed that it goes directly to merchant checkout after the timeout.
- I also tested with an extremely low timeout on WooPay (30 ms) and confirmed it took me to merchant checkout in those cases. One thing to note is that the console error didn't show the timeout message and instead showed "Error: Could not retrieve WooPay checkout URL.", but I don't view this as a blocker just something to keep in mind if we see it in the wild.
- I tested it with the WooPayments changes applied, but not the WooPay changes and found that shoppers with third party cookies blocked will not get DC in that case. Third party cookies allowed still worked.
- I tested it with WooPay changes applied, but not WooPayments changes and it all worked as expected.
We'll coordinate the WooPay PR deployment in that PR, but otherwise this all tested well for me.
LGTM!
'get_is_reachable_success' to 'get_is_woopay_reachable_success'
Fixes #8986
Changes proposed in this Pull Request
The changes in this PR ensure that the WooPay Direct Checkout flow does not hang when a message is posted to WooPay and WooPay does not respond. Additionally, it ensures that WooPay is available before redirecting shoppers to WooPay Checkout.
Testing instructions
Note
The changes in this PR should be tested with the changes in 2794-gh-Automattic/woopay.
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