fix: PayPal Express rule-based shipping methods not switched on country change#663
Closed
Chuc Le (untilu29) wants to merge 1 commit into
Closed
fix: PayPal Express rule-based shipping methods not switched on country change#663Chuc Le (untilu29) wants to merge 1 commit into
Chuc Le (untilu29) wants to merge 1 commit into
Conversation
dbf511d to
bcf5675
Compare
…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.
bcf5675 to
6bccb9a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.