Skip to content

[MAJOR] Add Venmo eligibility checks, Checkout functionality#456

Merged
kgangineni merged 29 commits into
feature/venmofrom
venmoFunctionality
Jul 20, 2026
Merged

[MAJOR] Add Venmo eligibility checks, Checkout functionality#456
kgangineni merged 29 commits into
feature/venmofrom
venmoFunctionality

Conversation

@kgangineni

@kgangineni kgangineni commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add Venmo eligibility checks with VenmoClient.isEligible() suspend and callback methods
  • Breaking: CoreConfig constructor now requires merchantId parameter

API / Contract Changes

New

  • VenmoClient.isEligible(buyerCountry: String): VenmoEligibilityResult (suspend)
  • VenmoClient.isEligible(buyerCountry: String, callback: VenmoEligibilityCallback) (callback)
  • VenmoClient.start(activity: Activity, orderId: String): VenmoStartResult (suspend)
  • VenmoClient.start(activity: Activity, orderId: String, callback: VenmoStartCallback) (callback)
  • CoreConfig.merchantId property

Modified

  • CoreConfig constructor — now requires merchantId parameter

Breaking Changes

  • Breaking changes (describe migration steps below)

Migration:

CoreConfig Constructor Change

Before:

CoreConfig(clientId = "YOUR_CLIENT_ID", environment = Environment.SANDBOX)

After:

CoreConfig(clientId = "YOUR_CLIENT_ID", environment = Environment.SANDBOX, merchantId = "YOUR_MERCHANT_ID")

Checklist

  • Added a changelog entry

anibalb2500 and others added 18 commits July 8, 2026 18:54
…demo

- Add CreateVenmoOrderUseCase for Venmo-specific order creation
- Implement PayWithVenmoView and PayWithVenmoViewModel for Venmo checkout UI
- Add VenmoClient with funding eligibility check and app switching logic
- Implement venmo success view and complete order flow
- Add padding to Venmo screen for better UX
- Add VenmoEligibilityResult sealed class to VenmoClient
- Add isEligible() suspend function to check Venmo eligibility
- Update demo app to show eligibility check as Step 1
- Display Venmo button only when eligible
- Remove LSAT authentication from GetFundingEligibility (use public endpoint)
NoResult means the intent is unrelated to Venmo flow (e.g., initial app
launch). Only show Step 3 when user actually completes Venmo checkout
and returns with Success or Canceled result.
- Only show Step 2 if Venmo is eligible
- Display Ineligible and Error results as failure states in Step 1
- Prevents user from proceeding with order creation if not eligible
Adds required X-App-Guid header with a random UUID to all GraphQL
requests to match PayPal API requirements (visible in curl commands
for GetFundingEligibility and similar GraphQL operations).
- Remove constructor parameters from Environment enum
- Use property getters with when expressions for url, graphQLEndpoint, venmoEnvironment
- Add @get:RestrictTo on venmoEnvironment for library-internal use
- Add customVenmoEnvironment to demo app settings (optional, for Venmo testing)
- Add validation for venmo environment values (sandbox/live/qa)
- Change GetFundingEligibility.invoke() to require buyerCountry parameter
- Remove unused currency parameter
- Update VenmoClient.isEligible() to accept and validate buyerCountry
- Replace hardcoded 'US' with dynamic buyerCountry value
- Fix demo app to pass buyerCountry to isEligible()
@kgangineni
kgangineni changed the base branch from main to feature/venmo July 10, 2026 20:29
@kgangineni kgangineni changed the title [MINOR] Venmo Eligibility & checkout functionality [MINOR] Add eligibility checks and simplify checkout API Jul 10, 2026
- Tests for isEligible() method: success, ineligible, API failure, validation
- Tests for start() method: successful launch, failure cases, parameter validation
- Tests for finishStart() method: deep link parsing, cancellation, approval handling
- Add test dependencies: mockk, robolectric, kotlinx-coroutinesTest
Remove the customVenmoEnvironment setting from demo app and SDK debug
config. Environment should be determined by the Venmo checkout URL
prefix instead.
…bCheckoutClient

- Use APIClientError.unknownError() helper for consistency
- Provide more descriptive error messages when required parameters are missing
- Use DATA_PARSING_ERROR for malformed results
- Remove unused error message constants
- Update tests to verify error codes and messages
…umentation

* Add VenmoEligibilityCallback and VenmoStartCallback interfaces
* Implement callback-based methods alongside suspend functions for Java compatibility
* Update CHANGELOG with CorePayments breaking change (merchantId required)
@kgangineni kgangineni changed the title [MINOR] Add eligibility checks and simplify checkout API [MAJOR]: Add Venmo eligibility checks, Java-compatible callbacks, and CoreConfig merchantId Jul 15, 2026
@kgangineni kgangineni changed the title [MAJOR]: Add Venmo eligibility checks, Java-compatible callbacks, and CoreConfig merchantId [MAJOR] Add Venmo eligibility checks, Checkout functionality Jul 15, 2026
@kgangineni
kgangineni marked this pull request as ready for review July 15, 2026 21:49
Comment thread Venmo/src/main/java/com/paypal/android/venmo/VenmoClient.kt
Comment thread Demo/src/main/res/xml/network_security_config.xml Outdated
Comment thread Venmo/src/main/java/com/paypal/android/venmo/VenmoClient.kt Outdated
Log.d("venmo", "CCO Update Success")
return try {
val cctOptions = ChromeCustomTabOptions(launchUri = appSwitchUri)
when (chromeCustomTabsClient.launch(activity, cctOptions)) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

future improvement: abstract java exceptions logic to within ChromeCustomTabsClient and communicate using sealed classes for different results

* remove unnecessary entries in network_security_config.xml
@kgangineni
kgangineni force-pushed the venmoFunctionality branch from f0c7e70 to d041b35 Compare July 20, 2026 15:21
…allback-based API

- Add VENMO to FundingSource enum in CorePayments
- Update Demo app to use callback-based isEligible() and start() methods
@kgangineni
kgangineni force-pushed the venmoFunctionality branch from d041b35 to fc49988 Compare July 20, 2026 15:22
@kgangineni
kgangineni merged commit b6ed39d into feature/venmo Jul 20, 2026
6 checks passed
@kgangineni
kgangineni deleted the venmoFunctionality branch July 20, 2026 15:27
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