POST | /CreateAchSession |
---|
import Foundation
import ServiceStack
// @DataContract
public class CreateAchSessionRequest : Codable
{
// @DataMember
public var credentials:RequestorCredentials
// @DataMember
public var achSessionExpiryInMin:Double
// @DataMember
public var achSessionTTL:Double
// @DataMember
public var extendedData:ACHExtendedData
required public init(){}
}
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 ACHExtendedData : Codable
{
// @DataMember
public var cashbackAmount:Int
// @DataMember
public var connectPaySubScriberId:String
// @DataMember
public var organizationId:String
// @DataMember
public var deviceFingerPrint:String
// @DataMember
public var merchantSessionId:String
// @DataMember
public var currencyCode:String
// @DataMember
public var paymentType:String
// @DataMember
public var verifyCustomer:Bool
// @DataMember
public var customerExternalId:String
// @DataMember
public var Description:String
// @DataMember
public var customerName:String
// @DataMember
public var addressLine1:String
// @DataMember
public var addressLine2:String
// @DataMember
public var city:String
// @DataMember
public var state:String
// @DataMember
public var zip:String
// @DataMember
public var country:String
// @DataMember
public var email:String
// @DataMember
public var telephoneNumber:String
// @DataMember
public var returnUrl:String
// @DataMember
public var cancelUrl:String
// @DataMember
public var establishData:String
// @DataMember
public var redirectUrl:String
// @DataMember
public var retryAttemptCount:Int
// @DataMember
public var signatureHashVersion:String
// @DataMember
public var deadlineHashDate:Date?
required public init(){}
}
// @DataContract
public class CreateAchSession : PaysecureResponseInternal
{
// @DataMember
public var sessionId:String
// @DataMember
public var errorCode:String
// @DataMember
public var errorMessage:String
// @DataMember
public var extendedData:ACHExtendedData
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case sessionId
case errorCode
case errorMessage
case extendedData
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
sessionId = try container.decodeIfPresent(String.self, forKey: .sessionId)
errorCode = try container.decodeIfPresent(String.self, forKey: .errorCode)
errorMessage = try container.decodeIfPresent(String.self, forKey: .errorMessage)
extendedData = try container.decodeIfPresent(ACHExtendedData.self, forKey: .extendedData)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if sessionId != nil { try container.encode(sessionId, forKey: .sessionId) }
if errorCode != nil { try container.encode(errorCode, forKey: .errorCode) }
if errorMessage != nil { try container.encode(errorMessage, forKey: .errorMessage) }
if extendedData != nil { try container.encode(extendedData, forKey: .extendedData) }
}
}
// @DataContract
public class PaysecureResponseInternal : Codable
{
// @DataMember(EmitDefaultValue=false)
public var timestamps:RequestTimestamps
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 InOutTimes : Codable
{
required public init(){}
}
Swift CreateAchSessionRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /CreateAchSession HTTP/1.1
Host: api.paysecure.acculynk.net
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"Credentials":{"MerchantId":"String","UserName":"String","Password":"String","Version":"String"},"ACHSessionExpiryInMin":0,"ACHSessionTTL":0,"ExtendedData":{"CashbackAmount":0,"ConnectPaySubScriberId":"String","OrganizationId":"String","DeviceFingerPrint":"String","MerchantSessionId":"String","CurrencyCode":"String","PaymentType":"String","VerifyCustomer":false,"CustomerExternalId":"String","Description":"String","CustomerName":"String","AddressLine1":"String","AddressLine2":"String","City":"String","State":"String","Zip":"String","Country":"String","Email":"String","TelephoneNumber":"String","ReturnUrl":"String","CancelUrl":"String","EstablishData":"String","RedirectUrl":"String","RetryAttemptCount":0,"SignatureHashVersion":"String","DeadlineHashDate":"\/Date(-62135596800000-0000)\/"}}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"SessionId":"String","ErrorCode":"String","ErrorMessage":"String","ExtendedData":{"CashbackAmount":0,"ConnectPaySubScriberId":"String","OrganizationId":"String","DeviceFingerPrint":"String","MerchantSessionId":"String","CurrencyCode":"String","PaymentType":"String","VerifyCustomer":false,"CustomerExternalId":"String","Description":"String","CustomerName":"String","AddressLine1":"String","AddressLine2":"String","City":"String","State":"String","Zip":"String","Country":"String","Email":"String","TelephoneNumber":"String","ReturnUrl":"String","CancelUrl":"String","EstablishData":"String","RedirectUrl":"String","RetryAttemptCount":0,"SignatureHashVersion":"String","DeadlineHashDate":"\/Date(-62135596800000-0000)\/"},"Timestamps":{"AppLayer":{"InTime":"\/Date(-62135596800000-0000)\/","OutTime":"\/Date(-62135596800000-0000)\/"},"ParentLookup":{"InTime":"\/Date(-62135596800000-0000)\/","OutTime":"\/Date(-62135596800000-0000)\/"},"RetryLookup":{"InTime":"\/Date(-62135596800000-0000)\/","OutTime":"\/Date(-62135596800000-0000)\/"},"GetCardData":{"InTime":"\/Date(-62135596800000-0000)\/","OutTime":"\/Date(-62135596800000-0000)\/"},"CardTokenize":{"InTime":"\/Date(-62135596800000-0000)\/","OutTime":"\/Date(-62135596800000-0000)\/"},"CardEncrypt":{"InTime":"\/Date(-62135596800000-0000)\/","OutTime":"\/Date(-62135596800000-0000)\/"},"DBInsert":{"InTime":"\/Date(-62135596800000-0000)\/","OutTime":"\/Date(-62135596800000-0000)\/"},"BackendProcess":{"InTime":"\/Date(-62135596800000-0000)\/","OutTime":"\/Date(-62135596800000-0000)\/"},"DBUpdate":{"InTime":"\/Date(-62135596800000-0000)\/","OutTime":"\/Date(-62135596800000-0000)\/"},"ParentUpdate":{"InTime":"\/Date(-62135596800000-0000)\/","OutTime":"\/Date(-62135596800000-0000)\/"},"Network":{"InTime":"\/Date(-62135596800000-0000)\/","OutTime":"\/Date(-62135596800000-0000)\/"}}}