diff --git a/Package.swift b/Package.swift index e090db2..7927816 100644 --- a/Package.swift +++ b/Package.swift @@ -5,6 +5,9 @@ import PackageDescription let package = Package( name: "recurly-client-ios", + platforms: [ + .iOS(.v14) + ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( diff --git a/RecurlySDK-iOS/Models/RECardData.swift b/RecurlySDK-iOS/Models/RECardData.swift index effac83..1465b72 100644 --- a/RecurlySDK-iOS/Models/RECardData.swift +++ b/RecurlySDK-iOS/Models/RECardData.swift @@ -10,11 +10,29 @@ import Foundation /// Recurly Card Data Model public struct RECardData: Codable { /// Credit Card number - var number: String = "" + var number: String /// Expiration Month - var month: String = "" + var month: String /// Expiration Year - var year: String = "" + var year: String /// Security Code - var cvv: String = "" + var cvv: String + + enum CodingKeys: String, CodingKey { + case number + case month + case year + case cvv + } + + public init(number: String = "", + month: String = "", + year: String = "", + cvv: String = "") { + + self.number = number + self.month = month + self.year = year + self.cvv = cvv + } } diff --git a/RecurlySDK-iOS/Networking/RETokenizationManager.swift b/RecurlySDK-iOS/Networking/RETokenizationManager.swift index 94b07c5..b9a5d9f 100644 --- a/RecurlySDK-iOS/Networking/RETokenizationManager.swift +++ b/RecurlySDK-iOS/Networking/RETokenizationManager.swift @@ -39,6 +39,12 @@ public struct RETokenizationManager { public mutating func setApplePaymentMethod(applePaymentMethod: REApplePaymentMethod) { self.applePaymentMethod = applePaymentMethod } + + /// Set the Card Data that its going to be send for tokenization + /// - Parameter cardData: The CardData received from the User + public mutating func setCardData(cardData: RECardData) { + self.cardData = cardData + } /// Returns the tokenId as String from a BillingInfo or/with CardData tokenization request. ///