GET, POST | /BankAccount |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using CDD_Engine_WS.dto.Requests;
using CDD_Engine_WS.dto.Responses;
namespace CDD_Engine_WS.dto.Requests
{
public partial class BankAccountRequest
{
///<summary>
///The bank sort code.
///</summary>
[Required]
public virtual string Sortcode { get; set; }
///<summary>
///The bank account number.
///</summary>
[Required]
public virtual string AccountNumber { get; set; }
///<summary>
///The Csr of the application (if available).
///</summary>
public virtual string Csr { get; set; }
}
}
namespace CDD_Engine_WS.dto.Responses
{
public partial class BankAccountResponse
{
///<summary>
///Contains the bank account lookup result when successful.
///</summary>
public virtual BankAccountResult Result { get; set; }
///<summary>
///Contains response status, details and errors.
///</summary>
public virtual ResponseStatus ResponseStatus { get; set; }
}
public partial class BankAccountResult
{
public virtual string AccountName { get; set; }
public virtual string BankName { get; set; }
public virtual string SortCode { get; set; }
public virtual bool IsValid { get; set; }
public virtual bool? IsDirectDebitCapable { get; set; }
public virtual string AccountNumber { get; set; }
}
}
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: wpcdd-featuretest-ws.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 } } }