-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge PayPal App Switch feature branch #1335
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Add "Universal Link Flow" button to PayPal Web demo app - this button with open a page that will allow us to return to the app on tapping "open" * This PR is a proof of concept that our demo app can be set up for universal linking, follow up PRs to this feature branch will build on this work
# Conflicts: # CHANGELOG.md
…1218) * Conform BTPayPalClient to BTAppContextSwitchClient * Add BTPayPalAppSwitchReturnURL struct * Add Unit Tests
# Conflicts: # CHANGELOG.md
* Add BTPayPalVault.enablePayPalAppSwitch property * Add new BTPayPalVaultBaseRequest - this allows us to only use the new property in the PayPal Web flow and cannot be accessed in the PayPal Native Checkout module
# Conflicts: # CHANGELOG.md
…L Type (#1232) * Replace BTAppContextSwitcher.sharedInstance.universalLink with init: BTPayPalVaultRequest(userAuthenticationEmail:enablePayPalAppSwitch:universalLink:offerCredit:)
* Add implementation to BTPayPalAppSwitchReturnURL * Rename BTPayPalClient.handleBrowserSwitchReturn to handleReturn since it will be used for both app switch and ASWeb returns * Add implementation for handleReturnURL for App Switch flows * Add new BTPayPalError.unknownAppSwitchError and update typo on invalidURL error * Add BTPayPalAppSwitchReturnURL_Tests * Add new BTPayPalClient_Tests for new code
* Handle Success or Failure of application.open via invokedOpenURLSuccessfully * Add TODOs for future analytics PR * Add new BTPayPalError.appSwitchFailed
* Add appInstalled check if enablePayPalAppSwitch=true, fallback to existing tokenize() flow if not Co-authored-by: Jax DesMarais-Leder <[email protected]>
…l` Parsing (#1250) * Our demo app URL for universal linking of https://braintree-ios-demo.fly.dev/braintree-payments has been allowlisted so we can update PayPalWebCheckoutViewController with this * In BTPayPalApprovalURLParser we were parsing paypalAppApprovalUrl from paymentResource (Checkout) when it should be parsed from agreementSetup (Vault) - verified via breakpoints and our contracts that this nesting should be updated * Updated tests with this correction
* Updated tokenization key * Added `payPalClient` to `universalLinkFlow` method
* Send link_type and paypal_installed in event_params when available to FPTI for the PayPal flow
# Conflicts: # CHANGELOG.md # Sources/BraintreePayPal/BTPayPalAnalytics.swift # UnitTests/BraintreePayPalTests/BTPayPalAnalytics_Tests.swift
* add missing BA token to query parameters for app switch flow * update test
# Conflicts: # CHANGELOG.md
* Update Braintree-Demo-Info.plist with proper scheme name - currently our check for isPayPalAppInstalled was always returning false because we need the scheme added to the plist for the demo app * If we got a paypalAppApprovalUrl back we were always app switching, this would cause issues if the isPayPalAppInstalled check returned false and the app truly wasn't installed, I tested this by removing the app and ensuring we fell back to web with the new logic - it can also be tested by updating the BTPayPalClient.payPalInAppScheme to something like "badscheme"
* updates to move ReturnURL logic to one place * update fallback logic to handle properly * update plist for app installed check * add webBrowser based BTPayPalReturnURL tests * PR feedback: update docstrings and enum name
# Conflicts: # CHANGELOG.md
* print nonce to status bar and allow to be copied for E2E testing * clear nonce between sessions after copied
* Previous PR comment: https://github.com/braintree/braintree_ios/pull/1265/files#r1562730080 * For the PayPal App Switch flow we only ever want a BA token currently, separate out logic to check only for BA token in this flow * Check that BA Token is present before attempting to start the App Switch flow, if not throw an error * Add new BTPayPalError.missingBAToken * Add unit test for this updated logic
# Conflicts: # CHANGELOG.md
# Conflicts: # Braintree.xcodeproj/project.pbxproj # CHANGELOG.md # Demo/Demo.entitlements # Sources/BraintreeCore/Analytics/BTAnalyticsService.swift # Sources/BraintreeCore/Analytics/FPTIBatchData.swift # Sources/BraintreePayPal/BTPayPalClient.swift # UnitTests/BraintreeCoreTests/Analytics/FPTIBatchData_Tests.swift # UnitTests/BraintreeCoreTests/Analytics/FakeAnalyticsService.swift
* replace universal link URL with heroku URL * remove old URL from Demo.entitlements
* Add ability to test app switch in stage, production, and sandbox * Add "App Switch Staging Env" toggle for testing in the staging environment * Sandbox and Production are being rolled out today/tomorrow and we want the ability to continue to test stage as well as Sandbox/Production concurrently
* update logic for payPalInstalled to align with venmo; update tests * move app installed checks into a UIApplication extension
* remove stage logic from PayPalWebCheckoutViewController
# Conflicts: # Braintree.xcodeproj/project.pbxproj # CHANGELOG.md # Sources/BraintreePayPal/BTPayPalClient.swift # UnitTests/BraintreePayPalTests/BTPayPalClient_Tests.swift
# Conflicts: # CHANGELOG.md # Sources/BraintreePayPal/BTPayPalClient.swift
* move universalLink into BTPayPalClient init * update PayPalWebCheckoutViewController * update UnitTests * update CHANGELOG
Verified UI tests passed locally |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
Checklist
Authors
@scannillo @jaxdesmarais @stechiu