Skip to content

Commit

Permalink
Re-add a check to potentially exclude billingAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
warmkesselj committed Feb 10, 2025
1 parent 1e5ff83 commit 71c634d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/BraintreeCard/CreditCardGraphQLBody.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ struct CreditCardGraphQLBody: Encodable {
var cardholderName: String?

init(card: BTCard) {
self.billingAddress = BillingAddress(card: card)
if let firstName = card.firstName, !firstName.isEmpty {
self.billingAddress = BillingAddress(card: card)
}

self.number = card.number
self.expirationMonth = card.expirationMonth
self.cvv = card.cvv
Expand Down

0 comments on commit 71c634d

Please sign in to comment.