Skip to content

Conversation

@kgangineni
Copy link
Collaborator

@kgangineni kgangineni commented Nov 6, 2025

Summary of changes

  • Restores deprecated start, vault functions
  • adds startAsync, vaultAsync suspend functions
  • addedappLinkUrl in PayPalWebVaultRequest and PayPalWebCheckoutRequest to support universal links
  • deprecated urlScheme in PayPalWebCheckoutClient
  • when appLinkUrl is not null then used for navigation, if not used urlScheme, if both are null then result will be failure, this logic is handled in Browser Switch
  • updated changelog

Checklist

  • Added a changelog entry

Authors

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

* introduce appLinkUrl in PayPalWebVaultRequest and PayPalWebCheckoutRequest
* deprecate vault function without app switch feature
* deprecate vault function without app switch feature
* introduces startAsync, vaultAsync functions to provide suspend support
@kgangineni kgangineni changed the base branch from develop to feature/app_switch November 6, 2025 21:58
* fix unit tests
* update unit tests
@kgangineni kgangineni marked this pull request as ready for review November 6, 2025 22:08
private val payPalDataCollector = PayPalDataCollector(coreConfig)
private val paypalClient =
PayPalWebCheckoutClient(applicationContext, coreConfig, "com.paypal.android.demo")
PayPalWebCheckoutClient(applicationContext, coreConfig)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we still need the fallback? Some users may have app links disabled. I'm thinking now this is why BT has both.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh wait I see now. I forgot we discussed adding this as a parameter to the request.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should test with app links disabled though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

when app links disabled, app settings -> open default -> uncheck urls
then it goes to web page, applink url can be http url or it can be $customScheme://$host/$path format it works, browser switch accepts it too. $path is optional

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to update the demo app so that we can still use the fallback URL when app links are disabled?

*
* @param request [PayPalWebCheckoutRequest] for requesting an order approval
*/
suspend fun startAsync(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
suspend fun startAsync(
fun startAsync(

We should wait for v3 to introduce coroutine APIs. Or even if we have them in v2, we should create coroutine APIs for all of our modules.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we still support deprecated fun start, so added this as new functionality, we can make this private and just keep fun start(activity, orderRequest, callback) as the only way to get app switch functionality and add suspend fun start in v3.
Also what other places we can add coroutines support

Copy link
Collaborator

Choose a reason for hiding this comment

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

Theoretically CardClient and FraudDetection might be two modules where we can add coroutine support. It's better if we have a plan for coroutine support first.

) {
applicationScope.launch {
val result = start(activity, request)
val result = startAsync(activity, request)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be wrapped in an async{} block as well? I'd prefer using either applicationScope.launch{} or async{} throughout.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

async{} is used to run updateCCO and patchCCOAppSwitch in parallel
applicationScope.launch{} is used to ensure this keeps running with supervisor job
still thread is going on, added comment to clarify it

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