diff --git a/.swiftlint.yml b/.swiftlint.yml index 378bd666eb..24305a0604 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -4,8 +4,9 @@ # Paths to include in lint included: - - Sources/BraintreeCore - Sources/BraintreeAmericanExpress + - Sources/BraintreeApplePay + - Sources/BraintreeCore 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: