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 .xml suffix or ?format=xml
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/xml
Content-Type: application/xml
Content-Length: length
<PSBINCheckRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<BIN>String</BIN>
<Credentials>
<MerchantId>String</MerchantId>
<Password>String</Password>
<UserName>String</UserName>
<Version>String</Version>
</Credentials>
</PSBINCheckRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <PSBINCheck xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types"> <Timestamps> <AppLayer> <InTime>0001-01-01T00:00:00</InTime> <OutTime>0001-01-01T00:00:00</OutTime> </AppLayer> <BackendProcess> <InTime>0001-01-01T00:00:00</InTime> <OutTime>0001-01-01T00:00:00</OutTime> </BackendProcess> <CardEncrypt> <InTime>0001-01-01T00:00:00</InTime> <OutTime>0001-01-01T00:00:00</OutTime> </CardEncrypt> <CardTokenize> <InTime>0001-01-01T00:00:00</InTime> <OutTime>0001-01-01T00:00:00</OutTime> </CardTokenize> <DBInsert> <InTime>0001-01-01T00:00:00</InTime> <OutTime>0001-01-01T00:00:00</OutTime> </DBInsert> <DBUpdate> <InTime>0001-01-01T00:00:00</InTime> <OutTime>0001-01-01T00:00:00</OutTime> </DBUpdate> <GetCardData> <InTime>0001-01-01T00:00:00</InTime> <OutTime>0001-01-01T00:00:00</OutTime> </GetCardData> <Network> <InTime>0001-01-01T00:00:00</InTime> <OutTime>0001-01-01T00:00:00</OutTime> </Network> <ParentLookup> <InTime>0001-01-01T00:00:00</InTime> <OutTime>0001-01-01T00:00:00</OutTime> </ParentLookup> <ParentUpdate> <InTime>0001-01-01T00:00:00</InTime> <OutTime>0001-01-01T00:00:00</OutTime> </ParentUpdate> <RetryLookup> <InTime>0001-01-01T00:00:00</InTime> <OutTime>0001-01-01T00:00:00</OutTime> </RetryLookup> </Timestamps> <ExtendedData> <CHEmailAddrResult>String</CHEmailAddrResult> <CardAccountUpdater> <CardDataType>CardNumber</CardDataType> <CardNumberInfo>String</CardNumberInfo> <CardToken>String</CardToken> <ErrorCode>String</ErrorCode> <ExpiryDate>String</ExpiryDate> <Status>String</Status> </CardAccountUpdater> <NetworkResponseCode>String</NetworkResponseCode> <NetworkTransactionId>String</NetworkTransactionId> <ProductId>String</ProductId> </ExtendedData> <LocalDateTime>String</LocalDateTime> <Token>String</Token> <BIN>String</BIN> <CardDesignation>String</CardDesignation> <CardVerify>false</CardVerify> <DualMessage>false</DualMessage> <EcomEBTCash>false</EcomEBTCash> <EcomEBTSNAP>false</EcomEBTSNAP> <ErrorCode>String</ErrorCode> <ErrorMessage>String</ErrorMessage> <FastFunds>String</FastFunds> <IncrementalAuth>false</IncrementalAuth> <InternetPinDebit>false</InternetPinDebit> <OTP>false</OTP> <OnDemandPaymentCredit>false</OnDemandPaymentCredit> <OnDemandPaymentDebit>false</OnDemandPaymentDebit> <POSFlag>false</POSFlag> <POSPinlessDualMessageFlag>false</POSPinlessDualMessageFlag> <PinlessA2ACredit>false</PinlessA2ACredit> <PinlessA2ADebit>false</PinlessA2ADebit> <PinlessBillPay>false</PinlessBillPay> <PinlessEcommerce>false</PinlessEcommerce> <PinlessPrePaidLoad>false</PinlessPrePaidLoad> <Recurring>false</Recurring> <WIC>false</WIC> </PSBINCheck>