Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
warmkesselj committed Feb 19, 2025
1 parent d309dd8 commit b5c08be
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
3 changes: 1 addition & 2 deletions Sources/BraintreeCard/CreditCardGraphQLBody.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// swiftlint:disable nesting

import Foundation

// swiftlint:disable nesting
/// The POST body for graphQL API Credit Card Tokenize Post
struct CreditCardGraphQLBody: Encodable {

Expand Down
15 changes: 1 addition & 14 deletions UnitTests/BraintreeCardTests/BTCard_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -228,20 +228,7 @@ class BTCard_Tests: XCTestCase {

XCTAssertNotNil(params.variables.input.authenticationInsightInput)
}

func printEncodableObject<T: Encodable>(_ object: T) {
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted // Makes the JSON easier to read
do {
let jsonData = try encoder.encode(object)
if let jsonString = String(data: jsonData, encoding: .utf8) {
print("Encoded JSON:\n\(jsonString)")
}
} catch {
print("Failed to encode object: \(error)")
}
}


func testGraphQLParameters_whenMerchantAccountIDIsNil_andAuthInsightRequestedIsFalse_doesNotRequestAuthInsight() {
let card = BTCard(
number: "8111111111111111",
Expand Down
2 changes: 1 addition & 1 deletion UnitTests/BraintreeTestShared/MockAPIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class MockAPIClient: BTAPIClient {

public override func post(_ path: String, parameters: Encodable, headers: [String: String]? = nil, httpType: BTAPIClientHTTPService = .gateway, completion completionBlock: ((BTJSON?, HTTPURLResponse?, Error?) -> Void)? = nil) {
lastPOSTPath = path
lastPOSTParameters = try? parameters.toDictionary()
lastPOSTParameters = try? parameters.toDictionary()
lastPOSTAPIClientHTTPType = httpType
lastPOSTAdditionalHeaders = headers

Expand Down

0 comments on commit b5c08be

Please sign in to comment.