diff --git a/.swiftlint.yml b/.swiftlint.yml index 998ab2c849..378bd666eb 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -5,6 +5,7 @@ # Paths to include in lint included: - Sources/BraintreeCore + - Sources/BraintreeAmericanExpress excluded: - Sources/BraintreeCore/BTAPIPinnedCertificates.swift diff --git a/Sources/BraintreeAmericanExpress/BTAmericanExpressClient.swift b/Sources/BraintreeAmericanExpress/BTAmericanExpressClient.swift index 72eff32f8d..97f87f1f81 100644 --- a/Sources/BraintreeAmericanExpress/BTAmericanExpressClient.swift +++ b/Sources/BraintreeAmericanExpress/BTAmericanExpressClient.swift @@ -25,11 +25,15 @@ import BraintreeCore /// if it fails, `rewardsBalance` will be `nil` and `error` will describe the failure. /// - Note: If the nonce is associated with an ineligible card or a card with insufficient points, the rewardsBalance will contain this information as `errorMessage` and `errorCode`. @objc(getRewardsBalanceForNonce:currencyIsoCode:completion:) - public func getRewardsBalance(forNonce nonce: String, currencyISOCode: String, completion: @escaping (BTAmericanExpressRewardsBalance?, Error?) -> Void) { + public func getRewardsBalance( + forNonce nonce: String, + currencyISOCode: String, + completion: @escaping (BTAmericanExpressRewardsBalance?, Error?) -> Void + ) { let parameters = BTAmexRewardsBalanceRequest(currencyIsoCode: currencyISOCode, paymentMethodNonce: nonce) apiClient.sendAnalyticsEvent(BTAmericanExpressAnalytics.started) - apiClient.get("v1/payment_methods/amex_rewards_balance", parameters: parameters) { [weak self] body, response, error in + apiClient.get("v1/payment_methods/amex_rewards_balance", parameters: parameters) { [weak self] body, _, error in guard let self else { completion(nil, BTAmericanExpressError.deallocated) return