Skip to content

Commit

Permalink
Refactor for linting
Browse files Browse the repository at this point in the history
  • Loading branch information
warmkesselj committed Dec 17, 2024
1 parent f0f72e7 commit 69c963a
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions Sources/BraintreeCard/BTCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,26 @@ import Foundation
// MARK: - Internal Methods

func parameters() -> BTCreditCardBody.CreditCard {
let cardBody = BTCreditCardBody.CreditCard(
let cardBody = creditCardParams()

cardBody.billingAddress = billingAddress()
cardBody.options = BTCreditCardBody.CreditCard.Options(validate: shouldValidate)

return cardBody
}

private func creditCardParams() -> BTCreditCardBody.CreditCard {
BTCreditCardBody.CreditCard(
number: number,
expirationMonth: expirationMonth,
cvv: cvv,
expirationYear: expirationYear,
cardHolderName: cardholderName
)

cardBody.billingAddress = BTCreditCardBody.CreditCard.BillingAddress(
}

private func billingAddress() -> BTCreditCardBody.CreditCard.BillingAddress {
BTCreditCardBody.CreditCard.BillingAddress(
firstName: firstName,
lastName: lastName,
company: company,
Expand All @@ -103,12 +114,6 @@ import Foundation
countryCodeAlpha3: countryCodeAlpha3,
countryCodeNumeric: countryCodeNumeric
)

let options = BTCreditCardBody.CreditCard.Options(validate: shouldValidate)

cardBody.options = options

return cardBody
}

func graphQLParameters() -> BTCreditCardGraphQLBody {
Expand Down

0 comments on commit 69c963a

Please sign in to comment.