iOS-SDK icon indicating copy to clipboard operation
iOS-SDK copied to clipboard

Changes for toggling app switch for checkout

Open KunJeongPark opened this issue 4 months ago • 1 comments

Reason for changes

  • Implement app switch if opted in, eligible or no errors in app launch

Summary of changes

  • Create appSwitchIfEligible property in PayPalWebCheckoutRequest
  • Toggle existing paypal web checkout with app switch if eligible flow
  • If not app switch launched, fallback to web checkout flow

TODO: unit tests

Checklist

  • [ ] Added a changelog entry

Authors

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

  • @KunJeongPark

KunJeongPark avatar Sep 12 '25 16:09 KunJeongPark

I pushed this as a working draft of app switch for paypal web checkout. I have working version of app switch for both web checkout and vaulting locally that I did as a POC. I kept the singleton class for routing incoming universal links back to the merchant app (similar to Braintree's BTAppContextSwitcher) lightweight since we have pending testing for different flows.

I want to separate out the PRs for readability and so reviews are not overwhelming and so unit tests don't have to be duplicated, rewritten for vault vs web checkout functionalities.

I will keep this PR as a draft and open other PRs in this order:

  1. further demo app changes to support vault without purchase app switch => I just finished testing out payload for app switch for this flow.
  2. demo app changes to enable toggling for app switch with request objects that toggle app switch
  3. handleURLRequest function in PayPalWebCheckoutClient that handles incoming universal links from vault and checkout, unit tests
  4. PayPalWebCheckoutClient changes to implement logic of toggling ASWebSession flow and app switch flow for both start and vault functions.
  5. lightweight singleton class to route the incoming URLs from app switch (allow future extensions to support Venmo app switch).
  6. New analytic events and errors

I may change order of #4 and #5 depending on what is the best path for unit testing. There may be changes after further discussions with checkout team members. I've posted questions about some scenarios and technical details on backend implementations based on behavior I observed during testing on my POC.

KunJeongPark avatar Sep 16 '25 13:09 KunJeongPark