Skip to content

Limit shipping countries to US-only (5956)#4312

Merged
stracker-phil merged 9 commits into
dev/PCP-4891-agentic-commercefrom
dev/PCP-5956-validate-shipping-to-us
Apr 30, 2026
Merged

Limit shipping countries to US-only (5956)#4312
stracker-phil merged 9 commits into
dev/PCP-4891-agentic-commercefrom
dev/PCP-5956-validate-shipping-to-us

Conversation

@stracker-phil

@stracker-phil stracker-phil commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Description

In the first phase, the agentic commerce integration only allows shipping to US customers.

This limitation should be hard-coded at plugin level for extra safety. Later, the country list is extended gradually. Here we ensure that carts with a non-US shipping address trigger a ValidationIssue, regardless of the WooCommerce shipping settings.

Note: There is no indicator, whether the country was rejected by WooCommerce' settings, or by the hardcoded PayPal platform restriction. From a customer perspective, all that matters is, if the country is available or not.

Postman verification

Scenario Screenshot
Valid Country - accepted by WooCommerce and PayPal 2026-04-29 - shipping-country-accepted
Invalid Country - WooCommerce or PayPal does not ship to this country 2026-04-29 - shipping-error-woocommerce

@github-actions

github-actions Bot commented Apr 28, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

🔗 Test this pull request with WordPress Playground

What's included:

  • ✅ WordPress (latest)
  • ✅ WooCommerce (latest)
  • ✅ PayPal Payments plugin v4.0.2-pr4312-25103730022-ga8c2f35 (built from this PR)

Login credentials:

  • Username: admin
  • Password: password

Plugin Details:

  • Version: 4.0.2-pr4312-25103730022-ga8c2f35
  • Commit: 0a224e7
  • Artifact: woocommerce-paypal-payments-4.0.2-pr4312-25103730022-ga8c2f35

💡 The demo environment resets each time you refresh. Perfect for testing!

🔄 This link updates automatically with each new commit to the PR.

⚠️ This URL is valid for 30 days from when this comment was last updated.


🤖 Auto-generated for commit 0a224e7 • Last updated: 2026-04-29T10:36:31.956Z

@stracker-phil
stracker-phil marked this pull request as ready for review April 29, 2026 10:30

@danieldudzic danieldudzic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! One nit :)

Comment thread tests/PHPUnit/StoreSync/CartValidation/ShippingValidatorTest.php Outdated
@stracker-phil
stracker-phil force-pushed the dev/PCP-5956-validate-shipping-to-us branch from 1ef3693 to 11eb443 Compare April 30, 2026 12:14
@stracker-phil
stracker-phil merged commit b6d96d6 into dev/PCP-4891-agentic-commerce Apr 30, 2026
9 of 10 checks passed
@stracker-phil
stracker-phil deleted the dev/PCP-5956-validate-shipping-to-us branch April 30, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants