Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OPEN DEV] Add Swiftlint to BraintreeApplePay #1366

Merged
merged 7 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

# Paths to include in lint
included:
- Sources/BraintreeCore
- Sources/BraintreeAmericanExpress
- Sources/BraintreeApplePay
- Sources/BraintreeCore

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
Loading