/* Options: Date: 2024-11-21 10:52:16 SwiftVersion: 5.0 Version: 6.10 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://api.paysecure.acculynk.net //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: TokenizeCardRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/TokenizeCard", "POST") // @DataContract public class TokenizeCardRequest : IReturn, Codable { public typealias Return = TokenizeCard // @DataMember public var credentials:RequestorCredentials // @DataMember public var keyId:String // @DataMember public var encryptedCardNumber:String // @DataMember public var expiration:String // @DataMember public var encryptedCVN:String // @DataMember public var avs:Avs // @DataMember public var verifyCard:Bool required public init(){} } // @DataContract public class TokenizeCard : PaysecureResponseInternal { // @DataMember public var cardToken:String // @DataMember public var cardHash:String // @DataMember public var cardLast4:String // @DataMember public var cardBIN:String // @DataMember public var cardExpiration:String // @DataMember public var responseCode:String // @DataMember public var errorMessage:String // @DataMember public var errorCode:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case cardToken case cardHash case cardLast4 case cardBIN case cardExpiration case responseCode case errorMessage case errorCode } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) cardToken = try container.decodeIfPresent(String.self, forKey: .cardToken) cardHash = try container.decodeIfPresent(String.self, forKey: .cardHash) cardLast4 = try container.decodeIfPresent(String.self, forKey: .cardLast4) cardBIN = try container.decodeIfPresent(String.self, forKey: .cardBIN) cardExpiration = try container.decodeIfPresent(String.self, forKey: .cardExpiration) responseCode = try container.decodeIfPresent(String.self, forKey: .responseCode) errorMessage = try container.decodeIfPresent(String.self, forKey: .errorMessage) errorCode = try container.decodeIfPresent(String.self, forKey: .errorCode) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if cardToken != nil { try container.encode(cardToken, forKey: .cardToken) } if cardHash != nil { try container.encode(cardHash, forKey: .cardHash) } if cardLast4 != nil { try container.encode(cardLast4, forKey: .cardLast4) } if cardBIN != nil { try container.encode(cardBIN, forKey: .cardBIN) } if cardExpiration != nil { try container.encode(cardExpiration, forKey: .cardExpiration) } if responseCode != nil { try container.encode(responseCode, forKey: .responseCode) } if errorMessage != nil { try container.encode(errorMessage, forKey: .errorMessage) } if errorCode != nil { try container.encode(errorCode, forKey: .errorCode) } } } public class RequestorCredentials : Codable { // @Required() public var merchantId:String? // @Required() public var userName:String? // @Required() public var password:String? // @Required() public var version:String? required public init(){} } public class Avs : Codable { public var address:String public var city:String public var state:String public var zip:String public var country:String public var email:String public var ipAddress:String public var telephoneNumber:String public var telephoneType:TelephoneType public var deliveryMethod:Int public var firstName:String public var middleName:String public var lastName:String required public init(){} } // @DataContract public class RequestTimestamps : Codable { // @DataMember(EmitDefaultValue=false) public var appLayer:InOutTimes // @DataMember(EmitDefaultValue=false) public var parentLookup:InOutTimes // @DataMember(EmitDefaultValue=false) public var retryLookup:InOutTimes // @DataMember(EmitDefaultValue=false) public var getCardData:InOutTimes // @DataMember(EmitDefaultValue=false) public var cardTokenize:InOutTimes // @DataMember(EmitDefaultValue=false) public var cardEncrypt:InOutTimes // @DataMember(EmitDefaultValue=false) public var dbInsert:InOutTimes // @DataMember(EmitDefaultValue=false) public var backendProcess:InOutTimes // @DataMember(EmitDefaultValue=false) public var dbUpdate:InOutTimes // @DataMember(EmitDefaultValue=false) public var parentUpdate:InOutTimes // @DataMember(EmitDefaultValue=false) public var network:InOutTimes required public init(){} } // @DataContract public class PaysecureResponseInternal : Codable { // @DataMember(EmitDefaultValue=false) public var timestamps:RequestTimestamps required public init(){} } public enum TelephoneType : String, Codable { case D case H case N case W } // @DataContract public class InOutTimes : Codable { required public init(){} }