-
Notifications
You must be signed in to change notification settings - Fork 215
Add filter for express checkout address normalization #4837
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
Add filter for express checkout address normalization #4837
Conversation
…normalize-address-processing
…normalize-address-processing
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.
Pull request overview
This PR adds a new WordPress filter wc_stripe_express_checkout_normalize_address that allows developers to customize address normalization for express checkout payment methods (Apple Pay, Google Pay, etc.). The filter is applied after WooCommerce Stripe's built-in normalization logic, enabling additional address data transformations as needed by merchants or extensions.
- Introduces the
wc_stripe_express_checkout_normalize_addressfilter in the AJAX address normalization handler - Provides access to both normalized and original address data for flexible customization
- Updates changelog and readme to document the new filter
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| includes/payment-methods/class-wc-stripe-express-checkout-ajax-handler.php | Adds the new filter after existing normalization methods, providing normalized and original address data as parameters |
| readme.txt | Documents the new filter addition in the changelog section |
| changelog.txt | Documents the new filter addition in the current version's changelog |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
includes/payment-methods/class-wc-stripe-express-checkout-ajax-handler.php
Outdated
Show resolved
Hide resolved
includes/payment-methods/class-wc-stripe-express-checkout-ajax-handler.php
Show resolved
Hide resolved
…normalize-address-processing
wjrosa
left a comment
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.
Looks good to me! I would consider Copilot's suggestion
diegocurbelo
left a comment
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, and it tests as indicated.
…normalize-address-processing
Fixes STRIPE-824
Fixes #4819
Changes proposed in this Pull Request:
This PR implements a new
wc_stripe_express_checkout_normalize_addressfilter that runs as part of our existingwc_stripe_normalize_addressAJAX action that normalizes addresses for express checkout. This will allow for additional normalization of address data for express checkouts.Testing instructions
Start with inspection. You can also verify that the hook is running and would be used by doing the following:
Note: I tried to write unit tests, but the fact that
ajax_normalize_address()usesfilter_input()means we can't mock the data in$_POST.Changelog entry
Changelog Entry Comment
Comment
Post merge