Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
agedd committed Feb 19, 2025
1 parent 4b22a6d commit 752050a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Sources/BraintreePayPal/BTPayPalRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import BraintreeCore
@objc public enum BTPayPalPaymentType: Int {
/// Checkout
case checkout

/// Vault
case vault

Expand Down Expand Up @@ -163,7 +163,7 @@ import BraintreeCore
isPayPalAppInstalled: Bool = false
) -> [String: Any] {
var experienceProfile: [String: Any] = [:]

experienceProfile["no_shipping"] = !isShippingAddressRequired
experienceProfile["brand_name"] = displayName != nil ? displayName : configuration.json?["paypal"]["displayName"].asString()

Expand Down Expand Up @@ -203,7 +203,7 @@ import BraintreeCore
if let shopperSessionID {
parameters["shopper_session_id"] = shopperSessionID
}

parameters["return_url"] = BTCoreConstants.callbackURLScheme + "://\(BTPayPalRequest.callbackURLHostAndPath)success"
parameters["cancel_url"] = BTCoreConstants.callbackURLScheme + "://\(BTPayPalRequest.callbackURLHostAndPath)cancel"
parameters["experience_profile"] = experienceProfile
Expand Down
4 changes: 2 additions & 2 deletions UnitTests/BraintreePayPalTests/BTPayPalClient_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ class BTPayPalClient_Tests: XCTestCase {
XCTFail("Expected integer value for query param `switch_initiated_time`")
}
}

func testTokenizeVaultAccount_whenPayPalAppApprovalURLMissingBAToken_returnsError() {
let fakeApplication = FakeApplication()
payPalClient.application = fakeApplication
Expand All @@ -800,7 +800,7 @@ class BTPayPalClient_Tests: XCTestCase {
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.")
Expand Down

0 comments on commit 752050a

Please sign in to comment.