From c746eab1b0f5d255a3604451d926a7b99154adbe Mon Sep 17 00:00:00 2001 From: Mark Mroz Date: Wed, 29 May 2024 16:42:02 -0400 Subject: [PATCH] removed more unused code --- Sources/Afterpay/Checkout/CheckoutV3.swift | 9 +++------ Sources/Afterpay/Model/CheckoutV3Card.swift | 16 ---------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/Sources/Afterpay/Checkout/CheckoutV3.swift b/Sources/Afterpay/Checkout/CheckoutV3.swift index 5ae31cc7..14e41cee 100644 --- a/Sources/Afterpay/Checkout/CheckoutV3.swift +++ b/Sources/Afterpay/Checkout/CheckoutV3.swift @@ -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 @@ -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 diff --git a/Sources/Afterpay/Model/CheckoutV3Card.swift b/Sources/Afterpay/Model/CheckoutV3Card.swift index 97090dc7..6dd8521c 100644 --- a/Sources/Afterpay/Model/CheckoutV3Card.swift +++ b/Sources/Afterpay/Model/CheckoutV3Card.swift @@ -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