-
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.
- Loading branch information
Showing
6 changed files
with
49 additions
and
51 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
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 |
---|---|---|
|
@@ -785,29 +785,29 @@ class BTPayPalClient_Tests: XCTestCase { | |
func testTokenizeVaultAccount_whenPayPalAppApprovalURLMissingBAToken_returnsError() { | ||
let fakeApplication = FakeApplication() | ||
payPalClient.application = fakeApplication | ||
|
||
mockAPIClient.cannedResponseBody = BTJSON(value: [ | ||
"agreementSetup": [ | ||
"paypalAppApprovalUrl": "https://www.some-url.com/some-path?token=value1" | ||
] | ||
]) | ||
|
||
let vaultRequest = BTPayPalVaultRequest( | ||
userAuthenticationEmail: "[email protected]", | ||
enablePayPalAppSwitch: true | ||
) | ||
|
||
let expectation = expectation(description: "completion block called") | ||
payPalClient.tokenize(vaultRequest) { nonce, error in | ||
XCTAssertNil(nonce) | ||
|
||
guard let error = error as NSError? else { XCTFail(); return } | ||
XCTAssertEqual(error.code, 12) | ||
XCTAssertEqual(error.localizedDescription, "Missing BA Token for PayPal App Switch.") | ||
XCTAssertEqual(error.domain, "com.braintreepayments.BTPayPalErrorDomain") | ||
expectation.fulfill() | ||
} | ||
|
||
waitForExpectations(timeout: 1) | ||
} | ||
|
||
|