Skip to content
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

Removed Venmo fallbacktoWeb #1434

Merged
merged 30 commits into from
Nov 12, 2024
Merged

Removed Venmo fallbacktoWeb #1434

merged 30 commits into from
Nov 12, 2024

Conversation

stechiu
Copy link
Collaborator

@stechiu stechiu commented Oct 15, 2024

Removed Venmo fallbacktoWeb opt-in to default to universal link

Summary of changes

  • Removed fallbacktoWeb and replaced with universal link

Checklist

  • Added a changelog entry

Authors

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

@stechiu stechiu requested a review from a team as a code owner October 15, 2024 00:28
Copy link
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.

We will want to change the base branch to v7. I think we can also clean up the logic in BTVenmoAppSwitchRedirectURL to only use universal links.

Sources/BraintreeVenmo/BTVenmoClient.swift Outdated Show resolved Hide resolved
@scannillo
Copy link
Contributor

Like Jax mentioned, since this change removes something from the SDKs public interface, it will break a merchant app who might be integrating with this property. So this PR should target v7 branch

@stechiu stechiu changed the base branch from main to v7 October 16, 2024 17:10
@stechiu
Copy link
Collaborator Author

stechiu commented Oct 16, 2024

Like Jax mentioned, since this change removes something from the SDKs public interface, it will break a merchant app who might be integrating with this property. So this PR should target v7 branch

I totally forgot to change the target branch. Just fixed!

@stechiu
Copy link
Collaborator Author

stechiu commented Oct 16, 2024

TODO: Fix failing tests

Copy link
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.

Looks like when we changed the base branch, that branch wasn't up to date with the latest from main. We will need to merge the latest from main into v7 then merge the latest from v7 into your branch to remove that portion of the diff from this PR.

@stechiu
Copy link
Collaborator Author

stechiu commented Oct 17, 2024

Looks like when we changed the base branch, that branch wasn't up to date with the latest from main. We will need to merge the latest from main into v7 then merge the latest from v7 into your branch to remove that portion of the diff from this PR.

Updated. How often do we merge changes from main branch to feature branches?

@jaxdesmarais
Copy link
Contributor

Updated. How often do we merge changes from main branch to feature branches?

I normally try to update long lived feature branches once a week. If a large feature is merged in we may want to update it sooner, but that's generally what I've done previously.

@stechiu stechiu changed the base branch from v7 to main October 17, 2024 20:36
@stechiu stechiu changed the base branch from main to v7 October 17, 2024 20:43
@@ -100,7 +99,7 @@ import BraintreeCore
}

do {
_ = try self.verifyAppSwitch(with: configuration, fallbackToWeb: request.fallbackToWeb)
_ = try self.verifyAppSwitch(with: configuration)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does verifyAppSwitch need to bother with returning any value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I assumed it would still need to return true since verifyAppSwitch checks if Venmo is enabled and if Venmo app is installed. Let me know if you think it's ok to remove the Bool return otherwise

Copy link
Contributor

Choose a reason for hiding this comment

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

If verifyAppSwitch is only being used here I think it should be safe. I think the function will just throw an error if not enabled, and the returned value isn't being used.

Copy link
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 update BTVenmoAppSwitchRedirectURL to only have references to the universal link method?

@stechiu
Copy link
Collaborator Author

stechiu commented Oct 23, 2024

Can we update BTVenmoAppSwitchRedirectURL to only have references to the universal link method?

Good call, I've removed urlSchemeURL()

Copy link
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.

Are we able to verify things are working as expected with these changes? If you have the Venmo app installed it should switch to the app and back and if the app is removed we should fallback to the default browser.

CHANGELOG.md Outdated Show resolved Hide resolved
Sources/BraintreePayPal/BTPayPalClient.swift Outdated Show resolved Hide resolved
Sources/BraintreePayPal/BTPayPalReturnURL.swift Outdated Show resolved Hide resolved
Sources/BraintreeVenmo/BTVenmoClient.swift Outdated Show resolved Hide resolved
…v7-venmo-universal-link

# Conflicts:
#	CHANGELOG.md
#	Demo/Application/Features/VenmoViewController.swift
#	Sources/BraintreeVenmo/BTVenmoClient.swift
#	Sources/BraintreeVenmo/BTVenmoRequest.swift
#	V7_MIGRATION.md
@stechiu
Copy link
Collaborator Author

stechiu commented Oct 25, 2024

Are we able to verify things are working as expected with these changes? If you have the Venmo app installed it should switch to the app and back and if the app is removed we should fallback to the default browser.

Yep :) It looks great

Screen.Recording.2024-10-24.at.5.47.35.PM.mov

Braintree.podspec Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@stechiu
Copy link
Collaborator Author

stechiu commented Oct 28, 2024

retest this please

@stechiu stechiu added the v7 label Oct 29, 2024
Copy link
Contributor

@warmkesselj warmkesselj left a comment

Choose a reason for hiding this comment

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

Approving ahead of time. Just this final comment on my end: #1434 (comment)

Copy link
Contributor

@agedd agedd left a comment

Choose a reason for hiding this comment

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

lgtm!

} catch {
self.notifyFailure(with: error, completion: completion)
return
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we will want to add back this return, my guess is that this is why these tests are failing:

	BTVenmoClient_Tests.testTokenize_whenVenmoRequest_setsVaultAnalyticsTag()
	BTVenmoClient_Tests.testTokenizeVenmoAccount_whenVenmoConfigurationDisabled_callsBackWithError()
	BTVenmoClient_Tests.testTokenizeVenmoAccount_whenVenmoConfigurationDisabled_callsBackWithError()
	BTVenmoClient_Tests.testTokenizeVenmoAccount_whenVenmoConfigurationDisabled_callsBackWithError()
	BTVenmoClient_Tests.testTokenizeVenmoAccount_whenVenmoConfigurationMissing_callsBackWithError()
	BTVenmoClient_Tests.testTokenizeVenmoAccount_whenVenmoConfigurationMissing_callsBackWithError()
	BTVenmoClient_Tests.testTokenizeVenmoAccount_whenVenmoConfigurationMissing_callsBackWithError()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just added it back and tested locally. Seems like removing return was the cause of the failed tests

demoApp = XCUIApplication(bundleIdentifier: "com.braintreepayments.Demo")
demoApp.launchArguments.append("-EnvironmentSandbox")
demoApp.launchArguments.append("-ClientToken")
demoApp.launchArguments.append("-Integration:VenmoViewController")
demoApp.launch()
}

func testTokenizeVenmo_whenSignInSuccessfulWithPaymentContext_returnsNonce() {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add a TODO + JIRA ticket for investigating what we want to do about UI tests now that our MockVenmo app will no longer work. (Also likely removing the MockVenmo app entirely, unless we can rig it to mimic Venmo's universal link)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, done!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@stechiu stechiu merged commit 3867268 into v7 Nov 12, 2024
7 of 8 checks passed
@stechiu stechiu deleted the v7-venmo-universal-link branch November 12, 2024 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants