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
⚙️ Environment
-
Platform: Android
-
Integration Type:
- PayPal (Chrome Custom Tabs)
- Venmo (App Switch)
-
OS Versions: Android 10+
-
Devices: Multiple
🚨 Actual Behavior
📌 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
Screenshots
No response
Braintree SDK Version
5.18.0
Environment
Both
Android Version & Device
10+
Braintree dependencies
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
⚙️ Environment
Platform: Android
Integration Type:
OS Versions: Android 10+
Devices: Multiple
🚨 Actual Behavior
Host app session expires during external flow
On return:
However:
No SDK API to abort or close:
Results in:
📌 Observations
This issue is caused by host app session lifecycle, not SDK token expiry
App switch is mandatory for:
Android platform restrictions prevent direct control of external apps
However, SDK does not provide any abstraction to handle this edge case
🧪 Acceptance Criteria
🏷️ Labels
bug,android,braintree-sdk,paypal,venmo,app-session,app-switch,lifecycleTo reproduce
🔁 Steps to Reproduce
Host app starts with a valid authenticated session
Initiate PayPal or Venmo payment via Braintree SDK
SDK launches:
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:
Screenshots
No response