Skip to content

Simplifying Return URL#1607

Merged
noguier merged 10 commits into
braintree:mainfrom
anibalb2500:simplified_return_url
May 29, 2026
Merged

Simplifying Return URL#1607
noguier merged 10 commits into
braintree:mainfrom
anibalb2500:simplified_return_url

Conversation

@anibalb2500
Copy link
Copy Markdown
Contributor

@anibalb2500 anibalb2500 commented May 27, 2026

Summary of changes

  • Simplified PayPal return URLs by removing the ://onetouch/v1/ path segment from success and cancel URLs
  • Changed URL format from {navigationLink}://onetouch/v1/success and {navigationLink}://onetouch/v1/cancel to {navigationLink}/success and {navigationLink}/cancel for AppLinks
  • Applied the simplified URL format consistently across both the browser switch and app switch paths in PayPalInternalClient

AI Usage

Which AI Agent Was Used?

  • Copilot
  • Claude
  • Other (Type Name Here)

How was AI used?

  • Writing PR Description
  • Added Unit Tests
  • Updating Changelog

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

List GitHub usernames for everyone who contributed to this pull request.


Inner Source Process

Internal to PayPal contributors should fill out this section. All others can delete.

PR should follow these steps before codeowners review will begin:

  1. PR should be opened in a draft state with the tech lead review required, and inner source label
  2. PR should be reviewed by and approved by your team's technical lead, we do not allow LGTM reviews, there should be comments and feedback provided on all PR reviews
  3. Once the above steps are completed, the PR can be moved to ready to review with the tech lead review required label removed
  4. PR comments must be addressed within 24 hours, if you are unable to address within this timeframe, move the PR back to a draft state so our team knows not to review

Inner Source Checklist

  • Added all labels to the PR
  • Provide steps to test the flows changed, if applicable in the summary
  • Demo video of the functionality, if applicable
  • All upstream dependencies are merged in and this PR can be released at any time; PRs should not be opened until this is true
  • Unit tests and builds have been run locally and pass/compile as expected

Test Steps

Test App: Braintree Demo App

Prerequisites

  • Install the Demo app on a device or emulator
  • Ensure the app is configured with a valid sandbox merchant account

1. PayPal Checkout (Single Payment)

  1. Launch the Demo app
  2. Tap PayPal
  3. Select Checkout flow
  4. Complete the PayPal login in the browser
  5. Approve the payment
  6. Verify the app receives a successful nonce result
  7. Verify no errors are shown

2. PayPal Vault (Billing Agreement)

  1. Launch the Demo app
  2. Tap PayPal
  3. Select Vault flow
  4. Complete the PayPal login in the browser
  5. Approve the billing agreement
  6. Verify the app receives a successful nonce result
  7. Verify no errors are shown

3. PayPal Cancellation

  1. Launch the Demo app
  2. Tap PayPal
  3. Select either Checkout or Vault flow
  4. When the PayPal browser page loads, tap the back button or close the browser
  5. Verify the app receives a cancellation result (not an error)

What to Look For

  • The browser switch should redirect back to the Demo app correctly after approval or cancellation
  • No crashes or unexpected errors during the return from PayPal
  • Nonce values are returned successfully on approval
  • Cancel is handled gracefully without errors

Evidence

ECS Applink Verification (Success and Cancel)

ECS.Flow.Applink.mov

VA Applink Verification (Success and Cancel)

VA.Flow.Applink.mov

Deeplink Fallback Verification (Success)

Deeplink.Fallback.Onetouch.mov

Deeplink Fallback Verification (Cancel)

Deeplink.Fallback.Cancel.mov

@anibalb2500 anibalb2500 marked this pull request as ready for review May 27, 2026 21:40
@anibalb2500 anibalb2500 requested a review from a team May 27, 2026 21:40
@anibalb2500 anibalb2500 requested a review from a team as a code owner May 27, 2026 21:40
@anibalb2500 anibalb2500 marked this pull request as draft May 27, 2026 21:40
@jaxdesmarais jaxdesmarais added inner source This PR is internal to PP but external to the mobile SDK team tech lead review required labels May 28, 2026

is GetReturnLinkUseCase.ReturnLinkResult.DeepLink ->
returnLinkResult.deepLinkFallbackUrlScheme
returnLinkResult.deepLinkFallbackUrlScheme + "://onetouch/v1"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why do we need to change the deeplink url ? Shouldn't our changes be limited to applink ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Will this handle both

://onetouch/v1/success

and

://onetouch/v1/cancel

Copy link
Copy Markdown

@shivamkejriwal shivamkejriwal May 28, 2026

Choose a reason for hiding this comment

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

Confirmed via joint testing. The following code can handle the cancel and success portion

val successUrl = "$navigationLink/success"
val cancelUrl = "$navigationLink/cancel"

while successUrl = "$returnLink/success" handles the the applink + deeplink case with the success postfix

Copy link
Copy Markdown
Contributor Author

@anibalb2500 anibalb2500 May 28, 2026

Choose a reason for hiding this comment

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

returnLinkResult.deepLinkFallbackUrlScheme only returns the deepLinkFallbackUrlScheme value the merchant passes to the PayPalClient constructor (i.e. "com.braintreepayments.demo.braintree" for the braintree_android demo app).

This will not included the "://onetouch/v1"

This change will make sure that both app link and deep link have '/success' in one line

@shivamkejriwal
Copy link
Copy Markdown

shivamkejriwal commented May 28, 2026

Tech Lead Signoff: Approving changes from xo-checkout side.

@anibalb2500 anibalb2500 marked this pull request as ready for review May 28, 2026 19:25
Copy link
Copy Markdown
Contributor

@jaxdesmarais jaxdesmarais left a comment

Choose a reason for hiding this comment

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

Can we revert the changes to Android tests that use deeplinks and not app links? Only the tests that start will https:// should need to change. Others should be able to remain the same using scheme://onetouch/v1

@noguier
Copy link
Copy Markdown
Contributor

noguier commented May 28, 2026

This looks good, I have also tested all the flows:
Applinks (sandbox/prod)
Deeplinks (sandbox/prod)
Appswitch (prod)
They are all working as expected, thank you. Also thank you for great PR description, it is really helpful

@saralvasquez
Copy link
Copy Markdown
Contributor

This looks good, I have also tested all the flows: Applinks (sandbox/prod) Deeplinks (sandbox/prod) Appswitch (prod) They are all working as expected, thank you. Also thank you for great PR description, it is really helpful

I second all of this! Thanks for the great description and video support!

Copy link
Copy Markdown
Contributor

@saralvasquez saralvasquez left a comment

Choose a reason for hiding this comment

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

🎉

@noguier noguier merged commit c8c5b33 into braintree:main May 29, 2026
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inner source This PR is internal to PP but external to the mobile SDK team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants