GET, POST | /BankAccount |
---|
import Foundation
import ServiceStack
public class BankAccountRequest : Codable
{
/**
* The bank sort code.
*/
// @Required()
public var sortcode:String?
/**
* The bank account number.
*/
// @Required()
public var accountNumber:String?
/**
* The Csr of the application (if available).
*/
public var csr:String?
required public init(){}
}
public class BankAccountResponse : Codable
{
/**
* Contains the bank account lookup result when successful.
*/
public var result:BankAccountResult?
/**
* Contains response status, details and errors.
*/
public var responseStatus:ResponseStatus?
required public init(){}
}
public class BankAccountResult : Codable
{
public var accountName:String?
public var bankName:String?
public var sortCode:String?
public var isValid:Bool?
public var isDirectDebitCapable:Bool?
public var accountNumber:String?
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /BankAccount HTTP/1.1
Host: wp-cddws-test.worldpay.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Sortcode: String,
AccountNumber: String,
Csr: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Result: { AccountName: String, BankName: String, SortCode: String, IsValid: False, IsDirectDebitCapable: False, AccountNumber: String }, ResponseStatus: { ErrorCode: String, Message: String, StackTrace: String, Errors: [ { ErrorCode: String, FieldName: String, Message: String, Meta: { String: String } } ], Meta: { String: String } } }