fix(payment): PAYPAL-7024 BT fastlane authentication flow - #3377
Open
bc-yaroslav-zhmutskyi wants to merge 1 commit into
Open
fix(payment): PAYPAL-7024 BT fastlane authentication flow#3377bc-yaroslav-zhmutskyi wants to merge 1 commit into
bc-yaroslav-zhmutskyi wants to merge 1 commit into
Conversation
andriiVitvitskyi1990
approved these changes
Aug 27, 2026
bc-nick
approved these changes
Aug 27, 2026
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.
What/Why?
Add defensive checks for undefined profileData in authentication flow to prevent potential crashes and ensure graceful handling when PayPal returns authentication state without profile data
Rollout/Rollback
Revert
Testing
Before
fastlane_before_cancel_error.webm
After
fastalane_cancel_no_error.webm
fastlane_success.webm
Note
Medium Risk
Changes payment-provider customer updates and auth state handling on the checkout critical path; the CANCELED enum string change could affect comparisons if the API still sends "cancelled".
Overview
Hardens Braintree Fastlane / PayPal authentication when PayPal returns an auth state without
profileData(e.g. cancel or failed flows), so checkout no longer tries to map addresses or instruments and avoids runtime errors.In
braintree-fastlane-utilsandbraintree-fastlane-shipping-strategy, the early-exit path now matches canceled auth: ifprofileDatais missing, the payment provider customer is updated with empty addresses/instruments, the Fastlane session cookie is cleared, and address prefill is skipped.Types in
braintree-utilsmarkprofileDataas optional on the auth result and alignBraintreeFastlaneAuthenticationState.CANCELEDto the stringcanceled(wascancelled). Specs cover the undefinedprofileDatacase in both integration and shipping strategy tests.Reviewed by Cursor Bugbot for commit 0e5d199. Bugbot is set up for automated code reviews on this repo. Configure here.