Skip to content

Commit

Permalink
address swiftlint warnings for BraintreeApplePay
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxdesmarais committed Jul 12, 2024
1 parent 03a0a9e commit 8e46b2e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Paths to include in lint
included:
- Sources/BraintreeCore
- Sources/BraintreeApplePay

excluded:
- Sources/BraintreeCore/BTAPIPinnedCertificates.swift
Expand Down
4 changes: 2 additions & 2 deletions Sources/BraintreeApplePay/BTApplePayClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions Sources/BraintreeApplePay/BTApplePayError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8e46b2e

Please sign in to comment.