Skip to content

Conversation

@wjrosa
Copy link
Contributor

@wjrosa wjrosa commented Sep 19, 2025

Towards STRIPE-724
Depends on #4710

Changes proposed in this Pull Request:

As part of the removal of the legacy checkout, we are also removing code related to Payment Request Buttons (PRBs), which were deprecated along with it.

Another motivation to remove it now is to make our frontend code compatible with the latest version of @wordpress/scripts. A PR upgrading it can be seen here.

Here I am removing only the frontend files. The PR removing the backend part can be seen here.

Testing instructions

  • Checkout and build this branch on your test environment (update/removing-prbs-frontend-code)
  • Connect your Stripe account
  • Enable express checkout methods
  • As a shopper, access the store using a public accessible URL
  • Add a product to your cart
  • Confirm express checkout buttons are still shown in cart, checkout, and product pages
  • Confirm you can complete a purchase with them

  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

Post merge

@wjrosa wjrosa self-assigned this Sep 19, 2025
@wjrosa wjrosa changed the base branch from develop to update/removing-upe-checkout-filter September 19, 2025 15:13
@wjrosa wjrosa marked this pull request as ready for review September 26, 2025 18:21
@wjrosa wjrosa changed the title Removing PRBs frontend code Removing all the frontend code related to PRBs Sep 26, 2025
Base automatically changed from update/removing-upe-checkout-filter to develop September 26, 2025 18:24
@wjrosa wjrosa requested review from a team, Mayisha and daledupreez and removed request for a team September 26, 2025 18:27
Copy link
Contributor

@Mayisha Mayisha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wjrosa We can not remove the files under client/entrypoints/payment-request-settings/*.
These are the codes for the customization page for the express checkout. As the admin settings were exactly the same for PRB and ECE (except for the buttons preview), we did not create new duplicate code for ECE.

Screenshot 2025-09-30 at 9 40 50 PM Screenshot 2025-09-30 at 9 41 35 PM

We should transfer these settings related code under client/entrypoints/express-checkout-settings/* and load the correct assets.

@wjrosa
Copy link
Contributor Author

wjrosa commented Sep 30, 2025

Thanks for the heads up, Mayisha! I started to rename the files, but I got into a rabbit hole. Then I decided to revert this part to handle it in another PR later.

@wjrosa wjrosa requested a review from Mayisha September 30, 2025 20:23
@wjrosa wjrosa changed the title Removing all the frontend code related to PRBs Removing frontend code related to PRBs from the checkout page Sep 30, 2025
@wjrosa
Copy link
Contributor Author

wjrosa commented Sep 30, 2025

Okay, I gave it another try, and now it works. I renamed all the frontend files 👍 . I will leave some stuff, like the global variable, for another time.

Copy link
Contributor

@Mayisha Mayisha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

✅ Settings page is loaded and the changes made to the express checkout settings persist on save.
✅ Express checkout buttons are loading correctly on all the pages,

  • Product
  • Shortcode cart
  • Shortcode checkout
  • Block card
  • Block checkout
    ✅ Appearance of the buttons follow the saved settings.
Screenshot 2025-10-02 at 1 08 51 PM

✅ Can pay using Google Pay without any errors.

Screenshot 2025-10-02 at 1 06 13 PM

public function admin_scripts() {
// Webpack generates an assets file containing a dependencies array for our built JS file.
$script_asset_path = WC_STRIPE_PLUGIN_PATH . '/build/payment-requests-settings.asset.php';
$script_asset_path = WC_STRIPE_PLUGIN_PATH . '/build/express-checkout-settings.asset.php';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to remember, we should rename this controller when we remove the backend side of the code.

@daledupreez
Copy link
Contributor

@wjrosa, I will continue testing this later today, but how should we test the case where someone previously had payment request buttons enabled in an earlier version and then upgrade to this version? Do we have a PR that ensures that path is handled correctly? In my mind, that is the main test path for this, as express checkout has been the default for some time.

Copy link
Contributor

@daledupreez daledupreez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to test some more tomorrow, but I think we need to ship the back end changes before we ship this change, as we could get really weird behaviour in cases where the back end still enables the feature and/or tries to queue up the removed JS files.

@wjrosa wjrosa requested a review from daledupreez October 6, 2025 14:18
Copy link
Contributor

@daledupreez daledupreez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me and are working well. My only note is that I think we should merge #4710 first or soon after this change, as setting the _wcstripe_feature_ece option to 'no' successfully broke this PR. 😁

@wjrosa wjrosa enabled auto-merge (squash) October 7, 2025 13:01
@wjrosa wjrosa merged commit ee97d97 into develop Oct 7, 2025
40 checks passed
@wjrosa wjrosa deleted the update/removing-prbs-frontend-code branch October 7, 2025 13:08
@daledupreez daledupreez added this to the 10.0.0 milestone Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants