-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update app install check * add LinkType enum; update linkType logic * cleanup unneeded logic * remove redundant enum type * move constant first in conditional * pass isPayPalAppInstalled into parameters; update tests; remove application from VaultRequest
- Loading branch information
1 parent
38297e4
commit cc7317f
Showing
16 changed files
with
45 additions
and
37 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// Used to describe the link type for analytics | ||
/// :nodoc: This class is exposed for internal Braintree use only. Do not use. It is not covered by Semantic Versioning and may change or be removed at any time. | ||
@_documentation(visibility: private) | ||
public enum LinkType: String { | ||
case universal | ||
case deeplink | ||
} |
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,7 +232,6 @@ class BTPayPalClient_Tests: XCTestCase { | |
func testTokenize_whenPayPalAppApprovalURLContainsPayPalContextID_sendsPayPalContextIDAndLinkTypeInAnalytics() { | ||
let fakeApplication = FakeApplication() | ||
payPalClient.application = fakeApplication | ||
payPalClient.payPalAppInstalled = true | ||
payPalClient.webAuthenticationSession = MockWebAuthenticationSession() | ||
|
||
let vaultRequest = BTPayPalVaultRequest( | ||
|
@@ -252,7 +251,7 @@ class BTPayPalClient_Tests: XCTestCase { | |
payPalClient.handleReturnURL(returnURL) | ||
|
||
XCTAssertEqual(mockAPIClient.postedPayPalContextID, "BA-Random-Value") | ||
XCTAssertEqual(mockAPIClient.postedLinkType, "universal") | ||
XCTAssertEqual(mockAPIClient.postedLinkType, .universal) | ||
XCTAssertNotNil(payPalClient.clientMetadataID) | ||
} | ||
|
||
|
@@ -282,7 +281,7 @@ class BTPayPalClient_Tests: XCTestCase { | |
payPalClient.tokenize(request) { _, _ in } | ||
|
||
XCTAssertEqual(mockAPIClient.postedPayPalContextID, "BA-Random-Value") | ||
XCTAssertEqual(mockAPIClient.postedLinkType, "deeplink") | ||
XCTAssertEqual(mockAPIClient.postedLinkType, .deeplink) | ||
XCTAssertTrue(mockAPIClient.postedAnalyticsEvents.contains("paypal:tokenize:handle-return:started")) | ||
} | ||
|
||
|
@@ -301,7 +300,7 @@ class BTPayPalClient_Tests: XCTestCase { | |
payPalClient.tokenize(request) { _, _ in } | ||
|
||
XCTAssertEqual(mockAPIClient.postedPayPalContextID, "A_FAKE_BA_TOKEN") | ||
XCTAssertEqual(mockAPIClient.postedLinkType, "deeplink") | ||
XCTAssertEqual(mockAPIClient.postedLinkType, .deeplink) | ||
XCTAssertTrue(mockAPIClient.postedAnalyticsEvents.contains("paypal:tokenize:handle-return:started")) | ||
} | ||
|
||
|
@@ -931,8 +930,8 @@ class BTPayPalClient_Tests: XCTestCase { | |
|
||
func testIsiOSAppSwitchAvailable_whenApplicationCanOpenPayPalInAppURL_returnsTrueAndSendsAnalytics() { | ||
let fakeApplication = FakeApplication() | ||
fakeApplication.cannedCanOpenURL = true | ||
payPalClient.application = fakeApplication | ||
payPalClient.payPalAppInstalled = true | ||
|
||
let vaultRequest = BTPayPalVaultRequest( | ||
userAuthenticationEmail: "[email protected]", | ||
|
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
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
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