/* Options: Date: 2024-11-21 06:47:21 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: CreateCardTokenRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/CreateCardToken", "POST") // @DataContract public class CreateCardTokenRequest : IReturn, Codable { public typealias Return = CreateCardToken // @DataMember public var credentials:RequestorCredentials // @DataMember public var sessionId:String // @DataMember public var verifyCard:Bool required public init(){} } // @DataContract public class CreateCardToken : PaysecureResponseInternal { // @DataMember public var cardToken:String // @DataMember public var cardZip:String // @DataMember public var cardLast4:String // @DataMember public var cardExpiration:String // @DataMember public var cvn:String // @DataMember public var avs:String // @DataMember public var binResults:BINResults // @DataMember public var responseCode:String // @DataMember public var errorMessage:String // @DataMember public var errorCode:String // @DataMember(EmitDefaultValue=false) public var extendedData:ExtendedResponse required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case cardToken case cardZip case cardLast4 case cardExpiration case cvn case avs case binResults case responseCode case errorMessage case errorCode case extendedData } 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) cardZip = try container.decodeIfPresent(String.self, forKey: .cardZip) cardLast4 = try container.decodeIfPresent(String.self, forKey: .cardLast4) cardExpiration = try container.decodeIfPresent(String.self, forKey: .cardExpiration) cvn = try container.decodeIfPresent(String.self, forKey: .cvn) avs = try container.decodeIfPresent(String.self, forKey: .avs) binResults = try container.decodeIfPresent(BINResults.self, forKey: .binResults) responseCode = try container.decodeIfPresent(String.self, forKey: .responseCode) errorMessage = try container.decodeIfPresent(String.self, forKey: .errorMessage) errorCode = try container.decodeIfPresent(String.self, forKey: .errorCode) extendedData = try container.decodeIfPresent(ExtendedResponse.self, forKey: .extendedData) } 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 cardZip != nil { try container.encode(cardZip, forKey: .cardZip) } if cardLast4 != nil { try container.encode(cardLast4, forKey: .cardLast4) } if cardExpiration != nil { try container.encode(cardExpiration, forKey: .cardExpiration) } if cvn != nil { try container.encode(cvn, forKey: .cvn) } if avs != nil { try container.encode(avs, forKey: .avs) } if binResults != nil { try container.encode(binResults, forKey: .binResults) } 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) } if extendedData != nil { try container.encode(extendedData, forKey: .extendedData) } } } 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(){} } // @DataContract public class ExtendedResponse : Codable { // @DataMember(EmitDefaultValue=false) public var cardAccountUpdater:CardAccountUpdaterDescriptor // @DataMember(EmitDefaultValue=false) public var productId:String // @DataMember(EmitDefaultValue=false) public var networkResponseCode:String // @DataMember(EmitDefaultValue=false) public var networkTransactionId:String // @DataMember(EmitDefaultValue=false) public var chEmailAddrResult: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 class BINResults : Codable { public var bin:String public var network:String public var internetPinDebit:Bool public var ecomEBTCash:Bool public var ecomEBTSNAP:Bool public var posFlag:Bool public var pinlessEcommerce:Bool public var pinlessBillPay:Bool public var onDemandPaymentCredit:Bool public var onDemandPaymentDebit:Bool public var pinlessA2ACredit:Bool public var pinlessA2ADebit:Bool public var pinlessPrePaidLoad:Bool public var dualMessage:Bool public var recurring:Bool public var cardVerify:Bool public var regulatedFlag:Bool public var otp:Bool public var posPinlessDualMessage:Bool public var fastFunds:String public var regulatedWithFraud:Bool public var countryCode:String public var cardType:String public var cardProduct:String public var cardDesignation:String public var cardSubCategory:String public var incrementalAuth:Bool required public init(){} } public enum CardInfoType : String, Codable { case CardNumber case Token case Track case EMV case Encrypted case DPAN case ApplePay case GooglePay case SamsungPay case CPToken case EncryptedEnhanced case EncryptedJWE } public class CardAccountUpdaterDescriptor : Codable { public var cardDataType:CardInfoType public var cardNumberInfo:String public var expiryDate:String public var status:String public var errorCode:String public var cardToken:String required public init(){} } // @DataContract public class InOutTimes : Codable { required public init(){} }