-
Notifications
You must be signed in to change notification settings - Fork 257
Bug: No Way to Abort PayPal/Venmo Flow When Host App Session Expires During App SwitchΒ #1552
Description
Braintree SDK Version
5.18.0
Environment
Both
Android Version & Device
10+
Braintree dependencies
// Braintree
implementation(libs.braintree.paypal)
implementation(libs.braintree.venmo)
Describe the bug
Summary
While integrating the Braintree Android SDK, the host app session (not the SDK) may expire when the app is backgrounded during PayPal (Chrome Custom Tab) or Venmo (app switch) flows. In such cases, the app cannot safely continue the payment. However, there is no SDK-supported way to programmatically abort or close the ongoing external flow, leading to inconsistent UX and broken payment handling.
π¦ Affected Library
- Braintree Android SDK
βοΈ Environment
-
Platform: Android
-
Integration Type:
- PayPal (Chrome Custom Tabs)
- Venmo (App Switch)
-
OS Versions: Android 10+
-
Devices: Multiple
π¨ Actual Behavior
-
Host app session expires during external flow
-
On return:
- App detects invalid session
- Payment flow is no longer valid
-
However:
-
No SDK API to abort or close:
- PayPal Chrome Custom Tab
- Venmo app flow
-
-
Results in:
- Broken user experience
- Forced manual restart of app/payment
π Observations
-
This issue is caused by host app session lifecycle, not SDK token expiry
-
App switch is mandatory for:
- PayPal (browser-based flow)
- Venmo (external app)
-
Android platform restrictions prevent direct control of external apps
-
However, SDK does not provide any abstraction to handle this edge case
π§ͺ Acceptance Criteria
- Host app can detect session expiry and safely invalidate payment
- SDK provides a structured way to abort or reset flow
- No undefined or broken state when user returns after session expiry
π·οΈ Labels
bug, android, braintree-sdk, paypal, venmo, app-session, app-switch, lifecycle
To reproduce
π Steps to Reproduce
-
Host app starts with a valid authenticated session
-
Initiate PayPal or Venmo payment via Braintree SDK
-
SDK launches:
- PayPal β Chrome Custom Tab
- Venmo β Venmo app
-
App goes to background
-
Host app session expires while user is in external flow
-
User completes or exits payment and returns to app
Expected behavior
β Expected Behavior
-
SDK should provide a mechanism to:
- Allow the host app to abort/cancel the payment flow when it detects session expiry
- Safely bring user back to app in a controlled state
- Prevent continuation of an invalid or unauthorized payment flow
Screenshots
No response