Skip to content

fix(payment): PAYPAL-7024 BT fastlane authentication flow - #3377

Open
bc-yaroslav-zhmutskyi wants to merge 1 commit into
masterfrom
PAYPAL-7024
Open

fix(payment): PAYPAL-7024 BT fastlane authentication flow#3377
bc-yaroslav-zhmutskyi wants to merge 1 commit into
masterfrom
PAYPAL-7024

Conversation

@bc-yaroslav-zhmutskyi

@bc-yaroslav-zhmutskyi bc-yaroslav-zhmutskyi commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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-utils and braintree-fastlane-shipping-strategy, the early-exit path now matches canceled auth: if profileData is 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-utils mark profileData as optional on the auth result and align BraintreeFastlaneAuthenticationState.CANCELED to the string canceled (was cancelled). Specs cover the undefined profileData case 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.

@bc-yaroslav-zhmutskyi
bc-yaroslav-zhmutskyi requested a review from a team as a code owner August 27, 2026 07:08
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.

3 participants