Skip to content

fix: PayPal Express rule-based shipping methods not switched on country change#663

Closed
Chuc Le (untilu29) wants to merge 1 commit into
trunkfrom
fix/paypal-express-rule-based-shipping
Closed

fix: PayPal Express rule-based shipping methods not switched on country change#663
Chuc Le (untilu29) wants to merge 1 commit into
trunkfrom
fix/paypal-express-rule-based-shipping

Conversation

@untilu29
Copy link
Copy Markdown

@untilu29 Chuc Le (untilu29) commented May 12, 2026

No description provided.

@untilu29 Chuc Le (untilu29) self-assigned this May 12, 2026
@untilu29 Chuc Le (untilu29) force-pushed the fix/paypal-express-rule-based-shipping branch from dbf511d to bcf5675 Compare May 12, 2026 09:38
…ry change

When the buyer changes the delivery country in the PayPal Express popup,
the shipping callback switched the sales channel context to the new
country but kept the previously selected shipping method ID. If that
method was restricted by a country rule, the cart picked up a
ShippingMethodBlockedError and the callback hard-failed with
EXPRESS_SHIPPING_CALLBACK_METHOD_UNAVAILABLE — even when another
shipping method was available for the new country.

After the context switch, if the cart now has a ShippingMethodBlockedError
and ShippingOptionsProvider returns an available alternative, switch the
context to the first available method and recalculate the cart so PayPal
sees a valid selection.

Also guard ExpressCustomerService::getAddressData against
Shipping::$name being uninitialized — PayPal occasionally returns a
Shipping struct without a name (e.g., in local-development mode), which
caused a TypeError on the typed property access.
@untilu29 Chuc Le (untilu29) force-pushed the fix/paypal-express-rule-based-shipping branch from bcf5675 to 6bccb9a Compare May 12, 2026 09:48
@untilu29 Chuc Le (untilu29) removed their assignment May 12, 2026
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.

1 participant