-
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
chore: cleanup of PRB implementation in favor of ECE #9698
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: -16.8 kB (-1%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
@@ -207,9 +205,9 @@ export default class WCPayAPI { | |||
result.error.setup_intent.id ); | |||
|
|||
// In case this is being called via payment request button from a product page, |
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.
In case this is being called via payment request button from a product page
If this line is meant for cases where the Payment Request Button is called from a product page, it might no longer be relevant since you’re removing the PRB implementation, right?
Additionally, to align with the comment, shouldn’t the code try to use getConfig
first, like this?
const ajaxUrl = getConfig( 'ajaxUrl' ) ?? getExpressCheckoutConfig( 'ajax_url' );
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.
Those are good questions, and I honestly don't know the answers to them :D
I couldn't find anything in the PRB implementation that would trigger these functions, so I'm not sure when or the reasons why this was introduced.
The comment says:
the getConfig function won't work
So it would make sense to have getPaymentRequestData
be called first.
It could be that the implementation over the years changed so much that this would have no longer been relevant anymore in either case.
When a payment is being attempted, the backend could return a redirect_url
with a #wcpay-confirm-....hash prefix, used to confirm the PI. In turn, the JS will call this function. The backend has the ability to return such URL for PRBs, ECE, and any other payment method. So I'd be wary of removing it or changing it, since the
confirmIntent()` function could be called from the ECE as well.
client/settings/express-checkout-settings/general-payment-request-button-settings.js
Show resolved
Hide resolved
client/settings/express-checkout-settings/payment-request-button-preview.js
Show resolved
Hide resolved
client/settings/express-checkout-settings/general-payment-request-button-settings.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.
@frosso I reviewed the code which looks good, I left a few questions and one suggestion to remove the ajax method if it's not used anymore.
No more code comments from me at the moment, I will start testing.
PS I also see that tests started to fail after the most recent commit.
includes/express-checkout/class-wc-payments-express-checkout-ajax-handler.php
Outdated
Show resolved
Hide resolved
includes/express-checkout/class-wc-payments-express-checkout-button-display-handler.php
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.
I went through the testing steps outlined in the description as well as tested the subscriptions, incl. lack of ECE for free trial physical subscription as per instructions here. Things work well.
The comments I've left are non-blocking so I'm approving the PR while you're responding to them and fixing the failing e2e tests.
@timur27 I see similar failures from that suite also on other PRs. I asked for assistance here: p1731518139549869-slack-CGGCLBN58 I'll hold off until we get clarity, but it looks like the failures are not related to these changes. |
Fixes #8950
Fixes #8529
Changes proposed in this Pull Request
Cleaning up the PRB implementation in favor of the ECE implementation.
Maintaining the tokenized payment request implementation behind a feature flag for future reference.
Within this PR:
client/checkout/api/index.js
with thepaymentRequest*
prefix to have theexpressCheckoutECE
prefix insteadclient/checkout/api/index.js
with thepaymentRequest
prefix that were no longer usedece_*
prefixisExpressCheckoutElementEnabled
,isStripeEceEnabled
,PaymentRequestButtonElement
,WC_Payments_Features::is_stripe_ece_enabled()
,_wcpay_feature_stripe_ece
includes/class-wc-payments-payment-request-button-handler.php
, but kept some of its logic for the tokenized carts. Keep in mind that some of those handlers are already duplicated inincludes/express-checkout/class-wc-payments-express-checkout-ajax-handler.php
Testing instructions
develop
and this branchnpm 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