From 8e46b2efa54988cad898ccc7d0ea09a06ebd0e9a Mon Sep 17 00:00:00 2001 From: Jax DesMarais-Leder Date: Fri, 12 Jul 2024 13:25:24 -0500 Subject: [PATCH] address swiftlint warnings for BraintreeApplePay --- .swiftlint.yml | 1 + Sources/BraintreeApplePay/BTApplePayClient.swift | 4 ++-- Sources/BraintreeApplePay/BTApplePayError.swift | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 66042ee3d8..c216908728 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -5,6 +5,7 @@ # Paths to include in lint included: - Sources/BraintreeCore + - Sources/BraintreeApplePay excluded: - Sources/BraintreeCore/BTAPIPinnedCertificates.swift diff --git a/Sources/BraintreeApplePay/BTApplePayClient.swift b/Sources/BraintreeApplePay/BTApplePayClient.swift index ba944e1e0d..4f3bccdfea 100644 --- a/Sources/BraintreeApplePay/BTApplePayClient.swift +++ b/Sources/BraintreeApplePay/BTApplePayClient.swift @@ -59,7 +59,7 @@ import BraintreeCore /// - Throws: An `Error` describing the failure public func makePaymentRequest() async throws -> PKPaymentRequest { try await withCheckedThrowingContinuation { continuation in - makePaymentRequest() { paymentRequest, error in + makePaymentRequest { paymentRequest, error in if let error { continuation.resume(throwing: error) } else if let paymentRequest { @@ -102,7 +102,7 @@ import BraintreeCore return } - guard let applePayNonce: BTApplePayCardNonce = BTApplePayCardNonce(json: body["applePayCards"][0]) else { + guard let applePayNonce = BTApplePayCardNonce(json: body["applePayCards"][0]) else { self.notifyFailure(with: BTApplePayError.failedToCreateNonce, completion: completion) return } diff --git a/Sources/BraintreeApplePay/BTApplePayError.swift b/Sources/BraintreeApplePay/BTApplePayError.swift index 51eed9cb4b..4cd36550e0 100644 --- a/Sources/BraintreeApplePay/BTApplePayError.swift +++ b/Sources/BraintreeApplePay/BTApplePayError.swift @@ -28,7 +28,9 @@ public enum BTApplePayError: Int, Error, CustomNSError, LocalizedError, Equatabl case .unknown: return "" case .unsupported: + // swiftlint:disable line_length return "Apple Pay is not enabled for this merchant. Please ensure that Apple Pay is enabled in the control panel and then try saving an Apple Pay payment method again." + // swiftlint:enable line_length case .noApplePayCardsReturned: return "No Apple Pay Card data was returned. Please contact support." case .failedToCreateNonce: