GET, POST | /BankAccount |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class BankAccountRequest
{
/**
* The bank sort code.
*/
@Required()
public String Sortcode = null;
/**
* The bank account number.
*/
@Required()
public String AccountNumber = null;
/**
* The Csr of the application (if available).
*/
public String Csr = null;
public String getSortcode() { return Sortcode; }
public BankAccountRequest setSortcode(String value) { this.Sortcode = value; return this; }
public String getAccountNumber() { return AccountNumber; }
public BankAccountRequest setAccountNumber(String value) { this.AccountNumber = value; return this; }
public String getCsr() { return Csr; }
public BankAccountRequest setCsr(String value) { this.Csr = value; return this; }
}
public static class BankAccountResponse
{
/**
* Contains the bank account lookup result when successful.
*/
public BankAccountResult Result = null;
/**
* Contains response status, details and errors.
*/
public ResponseStatus ResponseStatus = null;
public BankAccountResult getResult() { return Result; }
public BankAccountResponse setResult(BankAccountResult value) { this.Result = value; return this; }
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public BankAccountResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
}
public static class BankAccountResult
{
public String AccountName = null;
public String BankName = null;
public String SortCode = null;
public Boolean IsValid = null;
public Boolean IsDirectDebitCapable = null;
public String AccountNumber = null;
public String getAccountName() { return AccountName; }
public BankAccountResult setAccountName(String value) { this.AccountName = value; return this; }
public String getBankName() { return BankName; }
public BankAccountResult setBankName(String value) { this.BankName = value; return this; }
public String getSortCode() { return SortCode; }
public BankAccountResult setSortCode(String value) { this.SortCode = value; return this; }
public Boolean getIsValid() { return IsValid; }
public BankAccountResult setIsValid(Boolean value) { this.IsValid = value; return this; }
public Boolean getIsDirectDebitCapable() { return IsDirectDebitCapable; }
public BankAccountResult setIsDirectDebitCapable(Boolean value) { this.IsDirectDebitCapable = value; return this; }
public String getAccountNumber() { return AccountNumber; }
public BankAccountResult setAccountNumber(String value) { this.AccountNumber = value; return this; }
}
}
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 /BankAccount HTTP/1.1
Host: wpcdd-featuretest-ws.worldpay.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<BankAccountRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CDD_Engine_WS.dto.Requests">
<AccountNumber>String</AccountNumber>
<Csr>String</Csr>
<Sortcode>String</Sortcode>
</BankAccountRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <BankAccountResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CDD_Engine_WS.dto.Responses"> <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types"> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:Message>String</d2p1:Message> <d2p1:StackTrace>String</d2p1:StackTrace> <d2p1:Errors> <d2p1:ResponseError> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:FieldName>String</d2p1:FieldName> <d2p1:Message>String</d2p1:Message> <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:KeyValueOfstringstring> <d5p1:Key>String</d5p1:Key> <d5p1:Value>String</d5p1:Value> </d5p1:KeyValueOfstringstring> </d2p1:Meta> </d2p1:ResponseError> </d2p1:Errors> <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringstring> <d3p1:Key>String</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfstringstring> </d2p1:Meta> </ResponseStatus> <Result> <BankName>String</BankName> <IsDirectDebitCapable>false</IsDirectDebitCapable> <IsValid>false</IsValid> <SortCode>String</SortCode> </Result> </BankAccountResponse>