-
Notifications
You must be signed in to change notification settings - Fork 67
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
Render ECE buttons #8818
Render ECE buttons #8818
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: +10.5 kB (+1%) Total Size: 1.27 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 looks good overall! Before I dive into testing, I wanted to point out some suggestions. Mostly are about renaming some methods and variables, which is reasonable since we're splitting the approaches.
includes/express-checkout/class-wc-payments-express-checkout-button-handler.php
Outdated
Show resolved
Hide resolved
client/express-checkout/index.js
Outdated
let paymentRequestType; | ||
|
||
// Track the payment request button click event. | ||
const trackPaymentRequestButtonClick = ( source ) => { |
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.
Should we rename this to trackExpressCheckoutButtonClick
?
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.
It's unclear how much of this code will be retained once we start processing payments.
I also plan to refactor these files once I jump into payment processing. I'll assess whether it's easier to delete everything that is currently unused or simply rename everything 🤔
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.
I've updated some variable names and cleaned up the JavaScript to achieve a near-minimal implementation. I've requested another review.
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.
Thanks for the latest changes and cleaning things up a bit. I've tested it and everything worked as expected, except for ApplePay which I can't test it. I left one last (and minor 🤏) suggestion before giving the final approval.
Before enabling ECE
- Checkout with GooglePay at the checkout page ✅
- Checkout with GooglePay in the product page ✅
- Checkout with ApplePay
⚠️ - I don't have ApplePay set up, if needed, feel free to ask someone else from the team to test it.
- Checkout with the WooPay button from the checkout page ✅
- Checkout with the WooPay button from the product page ✅
- Ensure the ECE buttons are not rendered when the feature flag is disabled ✅
- Checked product page, shortcode cart, shortcode checkout, cart Block and checkout Block.
After enabling ECE
- Confirm that the ECE buttons are rendering ✅
- Checked product page, shortcode cart, shortcode checkout, cart Block and checkout Block.
- Ensure that the PRB buttons are not rendered ✅
- Checked product page, shortcode cart, shortcode checkout, cart Block and checkout Block.
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
Closes #8772
Closes #8825
Changes proposed in this Pull Request
Render the ECE buttons behind a feature flag. The buttons are rendered in:
It also relocates functions that were used by other parts of the application, such as the WooPay button, from
payment-request/utils
to a new high-level utility directory,utils/express-checkout
. This move aims to decouple these helpers from any specific express checkout implementation.Testing instructions
Before you enable the feature flag, test the PRB buttons and ensure there are no regressions. Also test the WooPay express checkout button.
npm run wp option update _wcpay_feature_stripe_ece 1
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