Skip to content

Commit

Permalink
[OPEN DEV] Add Swiftlint to BraintreeAmericanExpress (#1365)
Browse files Browse the repository at this point in the history
* Add BraintreeAmericanExpress module to .swiftlint.yml
* Address all swiftlint violations in BraintreeAmericanExpress
  • Loading branch information
jaxdesmarais authored Jul 16, 2024
1 parent f794bdc commit 96a910d
Show file tree
Hide file tree
Showing 2 changed files with 7 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/BraintreeAmericanExpress

excluded:
- Sources/BraintreeCore/BTAPIPinnedCertificates.swift
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 96a910d

Please sign in to comment.