fix(commerce-elastic-path): a saved shipping address is a quoted address - #597
Merged
Merged
Conversation
…ipping address changes The update cleared the rates on an address change and left fetching new ones to a second request. A checkout without one held an address and no rates, so nothing could select a rate and /pay failed closed. The update now runs the shipping rate resolver on the updated session and persists the address and the rates in one write. The condition that clears the rates is the condition that requotes. A resolver failure is logged and leaves the address saved with an empty list. The managed form stops calling the requote after the update, so the resolver runs once per address change. The standalone requote is unchanged and documented as on-demand. Closes #592 Closes #593 Closes #584
The logger read its level only from localStorage, so on the server every message was dropped, errors included. A shipping-line write that could not authenticate, or an order that failed to reconcile, left no trace. With no localStorage the logger now reads EP_DEBUG from the environment, with the same values, and defaults to warn. The browser default is unchanged.
…wn client The checkout context paired EP_CLIENT_SECRET with the Plasmic project's client ID. When the two differ the client_credentials grant is rejected, so picking a rate never wrote the shipping line and /pay could not authenticate.
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.
The checkout-session update cleared the shipping rates when the address changed and left fetching new ones to a second request. When that request was missing, the session held an address and no rates, nothing could select a rate, and
/payfailed closed.shippingRateResolveron the updated session and saves the address and the new rates in one write. The check that clears the rates is the check that requotes. An equivalent address keeps the rates and the selected rate./shippingroute, its handler and thecalculateShippingref action are unchanged, and their docs now describe on-demand requoting. The README gains a checkout-session route table.Two related fixes found while verifying this:
localStorage, so every server-side message was dropped, errors included.EP_DEBUGin the server environment sets the level;EP_DEBUG=silentrestores the old behaviour.EP_CLIENT_ID, the client its secret belongs to, instead of the Plasmic project's client ID. With the two different, theclient_credentialsgrant was rejected, so picking a rate never wrote the shipping line and/paycould not authenticate.No registered surface is added or removed, and there is no version bump.
Closes #592
Closes #593
Closes #584