fix(browser): surface a failed Apple Pay credentials exchange on the error event - #1013
Closed
Alexander (alexander-rw) wants to merge 1 commit into
Conversation
CARD-1247. #exchangeApplePaymentData returned res.json() without checking res.ok, so a 500 from /frontend/apple-pay/credentials was handed back as if it were a successful exchange. It passed the tryCatch that guards the call and the handler then died on encrypted.card.displayName — thrown outside the caught region, so no error event fired and response.complete() was never called, leaving the sheet spinning until Apple timed it out. Check the status and the body shape, and complete the sheet as failed on the error path so a credentials failure reaches the merchant's error handler. The message is built from the documented API Error schema (detail, falling back to title) plus the HTTP status. Found while investigating the Upgrow outage, where this masked a five-day server-side failure across ~30 real customer authorizations.
🦋 Changeset detectedLatest commit: da533aa The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Author
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.
Closes CARD-1247. A failed Apple Pay credentials exchange currently dies as an uncaught
TypeErrorwith no error event and no sheet dismissal, which is why the Upgrow outage ran silent for five days — this puts the failure on the SDK's error channel where a merchant can actually see it.#1012 stacks on this. Replaces #1010, which GitHub auto-marked merged when a restack briefly made its head an ancestor of its base.