/* Options: Date: 2024-11-21 05:40:58 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: InitiateRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/Initiate", "POST") // @DataContract public class InitiateRequest : IReturn, Codable { public typealias Return = Initiate // @DataMember public var credentials:RequestorCredentials // @DataMember public var cardNumberInfo:Card // @DataMember public var expirationDate:String // @DataMember public var amount:Int // @DataMember public var currencyCode:String // @DataMember public var transType:EBTIntiateTransStatus required public init(){} } // @DataContract public class Initiate : PaysecureResponseInternal { // @DataMember public var tranId:String // @DataMember public var errorMessage:String // @DataMember public var errorCode:String // @DataMember public var accuId:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case tranId case errorMessage case errorCode case accuId } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) tranId = try container.decodeIfPresent(String.self, forKey: .tranId) errorMessage = try container.decodeIfPresent(String.self, forKey: .errorMessage) errorCode = try container.decodeIfPresent(String.self, forKey: .errorCode) accuId = try container.decodeIfPresent(String.self, forKey: .accuId) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if tranId != nil { try container.encode(tranId, forKey: .tranId) } if errorMessage != nil { try container.encode(errorMessage, forKey: .errorMessage) } if errorCode != nil { try container.encode(errorCode, forKey: .errorCode) } if accuId != nil { try container.encode(accuId, forKey: .accuId) } } } 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 Card : Codable { public var cardDataType:CardInfoType public var cardNumberData:String public var keyID:String required public init(){} } public enum EBTIntiateTransStatus : String, Codable { case eCommerce case EBT case MoneyTransfer case WIC } // @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 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 } // @DataContract public class InOutTimes : Codable { required public init(){} }