Skip to content
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

Implement ECE for payment processing on block checkout page #3439

Merged
merged 39 commits into from
Sep 26, 2024

Conversation

Mayisha
Copy link
Contributor

@Mayisha Mayisha commented Sep 16, 2024

Fixes #3403 #3408

Changes proposed in this Pull Request:

  • Created hooks, event-handlers and utils functions for ECE in blocks.
  • The changes are made following the functions for payment-request and WooPayments.

Testing instructions

  • Enable the ECE feature flag (return true from is_stripe_ece_enabled function or in your database add an option _wcstripe_feature_ece and set yes as the value).
  • As a shopper add a product to your cart and go to the Block checkout page.
  • Confirm that the Google Pay and Apple Pay buttons are loaded.
  • Confirm that you can successfully place an order with Google Pay and Apple Pay.
  • As a shopper add a product to your cart and go to the Block cart page.
  • Confirm that the Google Pay and Apple Pay buttons are loaded.
  • Confirm that you can successfully place an order with Google Pay and Apple Pay.
  • Disable the feature flag and confirm that PRBs are still working without any regression.

@Mayisha Mayisha requested a review from wjrosa September 16, 2024 20:52
@Mayisha
Copy link
Contributor Author

Mayisha commented Sep 16, 2024

@wjrosa I have requested your review as you are also working on ECE issues. Feel free to unassign yourself if you are too occupied 🍫

@Mayisha
Copy link
Contributor Author

Mayisha commented Sep 24, 2024

@wjrosa @annemirasol this PR is ready for review again. The changes seems to work for block cart page as well. So please test this on both the block cart and block checkout pages.

There are 2 issues I am going to fix separately.

Screenshot 2024-09-25 at 1 02 55 AM Screenshot 2024-09-25 at 12 57 24 AM

Copy link
Contributor

@wjrosa wjrosa left a comment

Choose a reason for hiding this comment

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

Great work, Mayisha! Code is good and it works as expected:

Confirm that the Google Pay and Apple Pay buttons are loaded.

Screenshot 2024-09-25 at 11 56 13

Confirm that you can successfully place an order with Google Pay and Apple Pay.

Screenshot 2024-09-25 at 11 59 42

Confirm that the Google Pay and Apple Pay buttons are loaded.

Screenshot 2024-09-25 at 12 02 18

Confirm that you can successfully place an order with Google Pay and Apple Pay.

Screenshot 2024-09-25 at 12 03 00

Disable the feature flag and confirm that PRBs are still working without any regression.

Screenshot 2024-09-25 at 12 00 32

@annemirasol
Copy link
Contributor

This could be a me thing, but I can't get Apple Pay to show up on this branch, when ECE is enabled.

How it looks on develop, or for this branch when is_stripe_ece_enabled == false:
Screenshot 2024-09-25 at 12 04 59 PM

How it looks for this branch, with is_stripe_ece_enabled == true:
Screenshot 2024-09-25 at 12 06 48 PM

I was able to test Google Pay, and these scenarios worked as expected ✨

  • Checkout: Google Pay displayed and working when is_stripe_ece_enabled is false
  • Cart: Google Pay displayed and working when is_stripe_ece_enabled is false
  • Checkout: Google Pay displayed and working when is_stripe_ece_enabled is true
  • Cart: Google Pay displayed and working when is_stripe_ece_enabled is true

Some other things I observed, which I think are out-of-scope for this PR, but noting here to document. LMK if you want me to file issues for these.

Cart: Apple Pay/Google Pay are not enabled as payment methods, is_stripe_ece_enabled is true.
Screenshot 2024-09-25 at 11 25 41 AM

Checkout: Apple Pay/Google Pay are not enabled as payment methods, is_stripe_ece_enabled is true.
Screenshot 2024-09-25 at 11 25 52 AM

UAE addresses aren't being mapped correctly. This was recently fixed for PRBs:
Screenshot 2024-09-25 at 11 49 06 AM

@james-allan
Copy link
Contributor

james-allan commented Sep 26, 2024

This could be a me thing, but I can't get Apple Pay to show up on this branch, when ECE is enabled.

Not just a you thing I thing. I'm seeing the same thing.
Screenshot 2024-09-26 at 1 25 31 pm

I noticed the following error in my console log:

Screenshot 2024-09-26 at 1 24 43 pm

Fixing that (see this comment) will fix it for me. :)

Screenshot 2024-09-26 at 1 28 50 pm

@Mayisha
Copy link
Contributor Author

Mayisha commented Sep 26, 2024

Thanks everyone for the review.

@annemirasol these are good findings.

When Apple Pay/Google Pay are not enabled as payment methods, and is_stripe_ece_enabled istrue, I get empty boxes/sections.

I will fix it under #3470

Noting that we may need to copy over the PRB fix for UAE addresses: #3432

I have fixed this in a1896eb and noted it in #3412

@Mayisha Mayisha merged commit d4b9e3d into develop Sep 26, 2024
34 of 35 checks passed
@Mayisha Mayisha deleted the task/3403-ece-in-block-checkout branch September 26, 2024 15:01
@Mayisha Mayisha mentioned this pull request Sep 26, 2024
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.

[ECE] Implement ECE for payment processing on block checkout page
4 participants