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

Fix order attribution data with ECE and Blocks API #3722

Merged
merged 35 commits into from
Jan 20, 2025

Conversation

wjrosa
Copy link
Contributor

@wjrosa wjrosa commented Jan 14, 2025

Fixes #1573
Base PR #3691

Changes proposed in this Pull Request:

With the introduction of #3691, order attribution data was lost (it was added in #3629). This PR fixes that by applying a new filter on the frontend.

This is heavily inspired by the implementation done in WooPayments here. Except that we are not calling or organising this part of the code as "tokenized express checkout".

Testing instructions

  • Checkout and build this branch on your test environment (fix/order-attribution-data-with-blocks-api)
  • Connect your Stripe account and enable express payment methods (Google Pay, Apple Pay, Link)
  • Enable the use of Blocks API for ECE. You can do it by hardcoding true as the returning value of use_blocks_api
  • Access your store by a public-facing address (with either JN website or something like Ngrok)
  • As a shopper, add the following query string to your cart URL to simulate a source attribution: ?utm_source=Facebook
  • Purchase any product using express methods (on both blocks checkout and shortcode checkout)
  • Confirm you can complete the transaction
  • As a merchant, open the new order page
  • Confirm you can see the correct attribution on the sidebar:
    Screenshot 2025-01-14 at 12 34 15

  • Covered with tests (or have a good reason not to test in description ☝️)
  • Added changelog entry in both changelog.txt and readme.txt (or does not apply)
  • Tested on mobile (or does not apply)

Post merge

@wjrosa wjrosa self-assigned this Jan 14, 2025
@wjrosa wjrosa marked this pull request as ready for review January 14, 2025 15:35
@wjrosa wjrosa requested review from a team and diegocurbelo and removed request for a team January 14, 2025 15:35
Copy link
Member

@diegocurbelo diegocurbelo left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @wjrosa!

The code looks good, and it tests well 🚢

Base automatically changed from tweak/using-blocks-api-to-process-ece-orders to develop January 20, 2025 13:28
@wjrosa wjrosa merged commit a92867d into develop Jan 20, 2025
33 of 37 checks passed
@wjrosa wjrosa deleted the fix/order-attribution-data-with-blocks-api branch January 20, 2025 13:55
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.

Spike: use the Blocks API instead of our AJAX APIs for the Payment Request Buttons
3 participants