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 .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 /BankAccount HTTP/1.1
Host: wp-cddws-test.worldpay.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Sortcode":"String","AccountNumber":"String","Csr":"String"}
HTTP/1.1 200 OK Content-Type: application/json 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"}}}