Skip to content

Commit

Permalink
removed more unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
mmroz committed May 29, 2024
1 parent ea62070 commit c746eab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
9 changes: 3 additions & 6 deletions Sources/Afterpay/Checkout/CheckoutV3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public enum CheckoutV3 {
redirectCancelUrl: URL(string: "https://www.afterpay.com")!
)

self.shipping = Contact(consumer.shippingInformation)
self.billing = Contact(consumer.billingInformation)
self.shipping = consumer.shippingInformation.map(Contact.init)
self.billing = consumer.billingInformation.map(Contact.init)
}

// MARK: - Inner types
Expand Down Expand Up @@ -124,10 +124,7 @@ public enum CheckoutV3 {
let countryCode: String
let phoneNumber: String?

init?(_ contact: CheckoutV3Contact?) {
guard let contact = contact else {
return nil
}
init(_ contact: CheckoutV3Contact) {
self.name = contact.name
self.line1 = contact.line1
self.line2 = contact.line2
Expand Down
16 changes: 0 additions & 16 deletions Sources/Afterpay/Model/CheckoutV3Card.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@

import Foundation

public enum VirtualCard {
case card(Card)
case tokenized(TokenizedCard)

init?(paymentDetails: ConfirmationV3.Response.PaymentDetails) {
if let card = paymentDetails.virtualCard {
self = .card(card)
return
} else if let tokenized = paymentDetails.virtualCardToken {
self = .tokenized(tokenized)
return
}
return nil
}
}

public struct Card: Decodable {
public let cardType: String
public let cardNumber: String
Expand Down

0 comments on commit c746eab

Please sign in to comment.