Skip to content

feature(PayPal): collect and send device_info to determine app switch eligibility#1600

Draft
santugowda wants to merge 1 commit into
braintree:mainfrom
santugowda:paypal-app-switch-device-info
Draft

feature(PayPal): collect and send device_info to determine app switch eligibility#1600
santugowda wants to merge 1 commit into
braintree:mainfrom
santugowda:paypal-app-switch-device-info

Conversation

@santugowda
Copy link
Copy Markdown

@santugowda santugowda commented May 14, 2026

Summary of changes

Sends device information as a nested app_switch_context object in PayPal Hermes requests when enablePayPalAppSwitch is enabled. This data is used downstream to determine app switch eligibility.

JSON structure sent to BTGW:

{
  "launch_paypal_app": true,
  "app_switch_context": {
    "device_info": {
      "model": "SM-A166U",
      "memory_available_mb": 350,
      "memory_total_mb": 4096
    },
    "native_app": {
      "app_url": "https://...",
      "os_type": "ANDROID",
      "os_version": "35"
    }
  }
}

Changes:

  • PayPalVaultRequest / PayPalCheckoutRequest: replaced flat os_type, os_version, merchant_app_return_url keys with nested app_switch_context.native_app object
  • PayPalInternalClient: injectDeviceInfo() adds device_info (model, memory_available_mb, memory_total_mb) into app_switch_context
  • PayPalRequest: updated constants for new nested key structure
  • Updated unit and instrumentation tests to verify nested structure

AI Usage

Which AI Agent Was Used?

  • Claude

How was AI used?
Code generation, cross-codebase analysis (Android SDK, BTGW, backend), refactoring from flat to nested JSON structure, and writing tests.

Estimated AI Code Contribution

  • less than 30%
  • 30 - 60%
  • 60 - 100%

Checklist

  • Added a changelog entry
  • Tested and confirmed payment flows affected by this change are functioning as expected

Authors

… eligibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant