POST | /PSBINCheck |
---|
import Foundation
import ServiceStack
// @DataContract
public class PSBINCheckRequest : Codable
{
// @DataMember
public var credentials:RequestorCredentials
// @DataMember
public var bin:String
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 PSBINCheck : PaysecureVersion
{
// @DataMember
public var bin:String
// @DataMember
public var internetPinDebit:Bool
// @DataMember
public var ecomEBTSNAP:Bool
// @DataMember
public var ecomEBTCash:Bool
// @DataMember
public var posFlag:Bool
// @DataMember
public var pinlessEcommerce:Bool
// @DataMember
public var pinlessBillPay:Bool
// @DataMember
public var onDemandPaymentCredit:Bool
// @DataMember
public var onDemandPaymentDebit:Bool
// @DataMember
public var pinlessA2ACredit:Bool
// @DataMember
public var pinlessA2ADebit:Bool
// @DataMember
public var pinlessPrePaidLoad:Bool
// @DataMember
public var dualMessage:Bool
// @DataMember
public var recurring:Bool
// @DataMember
public var cardVerify:Bool
// @DataMember
public var posPinlessDualMessageFlag:Bool
// @DataMember
public var errorMessage:String
// @DataMember
public var errorCode:String
// @DataMember
public var otp:Bool
// @DataMember
public var fastFunds:String
// @DataMember
public var incrementalAuth:Bool
// @DataMember
public var wic:Bool
// @DataMember
public var cardDesignation:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case bin
case internetPinDebit
case ecomEBTSNAP
case ecomEBTCash
case posFlag
case pinlessEcommerce
case pinlessBillPay
case onDemandPaymentCredit
case onDemandPaymentDebit
case pinlessA2ACredit
case pinlessA2ADebit
case pinlessPrePaidLoad
case dualMessage
case recurring
case cardVerify
case posPinlessDualMessageFlag
case errorMessage
case errorCode
case otp
case fastFunds
case incrementalAuth
case wic
case cardDesignation
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
bin = try container.decodeIfPresent(String.self, forKey: .bin)
internetPinDebit = try container.decodeIfPresent(Bool.self, forKey: .internetPinDebit)
ecomEBTSNAP = try container.decodeIfPresent(Bool.self, forKey: .ecomEBTSNAP)
ecomEBTCash = try container.decodeIfPresent(Bool.self, forKey: .ecomEBTCash)
posFlag = try container.decodeIfPresent(Bool.self, forKey: .posFlag)
pinlessEcommerce = try container.decodeIfPresent(Bool.self, forKey: .pinlessEcommerce)
pinlessBillPay = try container.decodeIfPresent(Bool.self, forKey: .pinlessBillPay)
onDemandPaymentCredit = try container.decodeIfPresent(Bool.self, forKey: .onDemandPaymentCredit)
onDemandPaymentDebit = try container.decodeIfPresent(Bool.self, forKey: .onDemandPaymentDebit)
pinlessA2ACredit = try container.decodeIfPresent(Bool.self, forKey: .pinlessA2ACredit)
pinlessA2ADebit = try container.decodeIfPresent(Bool.self, forKey: .pinlessA2ADebit)
pinlessPrePaidLoad = try container.decodeIfPresent(Bool.self, forKey: .pinlessPrePaidLoad)
dualMessage = try container.decodeIfPresent(Bool.self, forKey: .dualMessage)
recurring = try container.decodeIfPresent(Bool.self, forKey: .recurring)
cardVerify = try container.decodeIfPresent(Bool.self, forKey: .cardVerify)
posPinlessDualMessageFlag = try container.decodeIfPresent(Bool.self, forKey: .posPinlessDualMessageFlag)
errorMessage = try container.decodeIfPresent(String.self, forKey: .errorMessage)
errorCode = try container.decodeIfPresent(String.self, forKey: .errorCode)
otp = try container.decodeIfPresent(Bool.self, forKey: .otp)
fastFunds = try container.decodeIfPresent(String.self, forKey: .fastFunds)
incrementalAuth = try container.decodeIfPresent(Bool.self, forKey: .incrementalAuth)
wic = try container.decodeIfPresent(Bool.self, forKey: .wic)
cardDesignation = try container.decodeIfPresent(String.self, forKey: .cardDesignation)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if bin != nil { try container.encode(bin, forKey: .bin) }
if internetPinDebit != nil { try container.encode(internetPinDebit, forKey: .internetPinDebit) }
if ecomEBTSNAP != nil { try container.encode(ecomEBTSNAP, forKey: .ecomEBTSNAP) }
if ecomEBTCash != nil { try container.encode(ecomEBTCash, forKey: .ecomEBTCash) }
if posFlag != nil { try container.encode(posFlag, forKey: .posFlag) }
if pinlessEcommerce != nil { try container.encode(pinlessEcommerce, forKey: .pinlessEcommerce) }
if pinlessBillPay != nil { try container.encode(pinlessBillPay, forKey: .pinlessBillPay) }
if onDemandPaymentCredit != nil { try container.encode(onDemandPaymentCredit, forKey: .onDemandPaymentCredit) }
if onDemandPaymentDebit != nil { try container.encode(onDemandPaymentDebit, forKey: .onDemandPaymentDebit) }
if pinlessA2ACredit != nil { try container.encode(pinlessA2ACredit, forKey: .pinlessA2ACredit) }
if pinlessA2ADebit != nil { try container.encode(pinlessA2ADebit, forKey: .pinlessA2ADebit) }
if pinlessPrePaidLoad != nil { try container.encode(pinlessPrePaidLoad, forKey: .pinlessPrePaidLoad) }
if dualMessage != nil { try container.encode(dualMessage, forKey: .dualMessage) }
if recurring != nil { try container.encode(recurring, forKey: .recurring) }
if cardVerify != nil { try container.encode(cardVerify, forKey: .cardVerify) }
if posPinlessDualMessageFlag != nil { try container.encode(posPinlessDualMessageFlag, forKey: .posPinlessDualMessageFlag) }
if errorMessage != nil { try container.encode(errorMessage, forKey: .errorMessage) }
if errorCode != nil { try container.encode(errorCode, forKey: .errorCode) }
if otp != nil { try container.encode(otp, forKey: .otp) }
if fastFunds != nil { try container.encode(fastFunds, forKey: .fastFunds) }
if incrementalAuth != nil { try container.encode(incrementalAuth, forKey: .incrementalAuth) }
if wic != nil { try container.encode(wic, forKey: .wic) }
if cardDesignation != nil { try container.encode(cardDesignation, forKey: .cardDesignation) }
}
}
// @DataContract
public class PaysecureVersion : PaysecureResponseInternal
{
// @DataMember(EmitDefaultValue=false)
public var localDateTime:String
// @DataMember(EmitDefaultValue=false)
public var token:String
// @DataMember(EmitDefaultValue=false)
public var extendedData:ExtendedResponse
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case localDateTime
case token
case extendedData
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
localDateTime = try container.decodeIfPresent(String.self, forKey: .localDateTime)
token = try container.decodeIfPresent(String.self, forKey: .token)
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 localDateTime != nil { try container.encode(localDateTime, forKey: .localDateTime) }
if token != nil { try container.encode(token, forKey: .token) }
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(){}
}
// @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(){}
}
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(){}
}
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
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /PSBINCheck HTTP/1.1
Host: api.paysecure.acculynk.net
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Credentials":{"MerchantId":"String","UserName":"String","Password":"String","Version":"String"},"BIN":"String"}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"BIN":"String","InternetPinDebit":false,"EcomEBTSNAP":false,"EcomEBTCash":false,"POSFlag":false,"PinlessEcommerce":false,"PinlessBillPay":false,"OnDemandPaymentCredit":false,"OnDemandPaymentDebit":false,"PinlessA2ACredit":false,"PinlessA2ADebit":false,"PinlessPrePaidLoad":false,"DualMessage":false,"Recurring":false,"CardVerify":false,"POSPinlessDualMessageFlag":false,"ErrorMessage":"String","ErrorCode":"String","OTP":false,"FastFunds":"String","IncrementalAuth":false,"WIC":false,"CardDesignation":"String","LocalDateTime":"String","Token":"String","ExtendedData":{"CardAccountUpdater":{"CardDataType":"CardNumber","CardNumberInfo":"String","ExpiryDate":"String","Status":"String","ErrorCode":"String","CardToken":"String"},"ProductId":"String","NetworkResponseCode":"String","NetworkTransactionId":"String","CHEmailAddrResult":"String"},"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)\/"}}}