-
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
Get WooPay 1st party auth flow to work on page load #7602
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: +1.02 kB (0%) Total Size: 1.44 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.
Code changes look good and test well 👍
I left a comment regarding the WooPay button behavior when the request to WooPay fails. For better UX, I strongly recommend that we immediately switch over to the OTP flow, as opposed to displaying an error message and requiring the user to click the WooPay button once again. This is not a blocker so I'll go ahead and approve.
Testing instructions
- ✅ Test 1st party authentication works on page load for the Product, Cart, and Checkout page.
- ✅ Test 1st party authentication works a few seconds after the page loads for the Product, Cart, and Checkout page.
- ✅ Test 1st-party authentication failure for the Product, Cart, and Checkout page.
client/checkout/woopay/express-button/test/woopay-express-checkout-button.test.js
Show resolved
Hide resolved
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.
LGTM 👍
Fixes https://github.com/Automattic/woopay/issues/2210
Changes proposed in this Pull Request
At the moment, when the product page, cart or checkout page loads and a user clicks right away at the WooPay button, it triggers the OTP modal flow instead of the first party auth flow. That's happening because the first party auth flow depends on the iframe being loaded and that can take from some milliseconds to a couple of seconds.
This PR addresses that behavior and makes the first party auth the default flow from the moment the page loads. The only moment the OTP flow should be triggered is when the first party auth fails at any point before redirecting to WooPay checkout.
Testing instructions
Test 1st party authentication works on page load
2.1. Product page
2.2. Cart page
2.3. Checkout page
Test 1st party authentication works a few seconds after the page loads
2.1. Product page
2.2. Cart page
2.3. Checkout page
Test 1st party authentication failure
2.1. Product page
2.2. Cart page
2.3. Checkout page
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