NAV Navbar
shell python php java

Introduction

Wirecapital is a simple, fast and reliable payment engine with open architecture. Founded back in 2018 now it is supported and constantly developing by the community of software engineers with bold background in payment and e-wallet systems.

Wirecapital Business API - a solution specifically designed for internet businesses in need of multicurrency payment processing. We support all major currencies.

Environments

There are two environments available for integration:

Sandbox Environment

Sandbox provides full functionality but it only emulates processing, no actual bank transactions are made. You can use the following PAN for tests:

You can use any cardholder name and CVV2/CVC2 with these PAN.

You can use even amount in refund request for emulate success refund and odd amount for emulate false refund.

Production Environment

Once you've completed integration with Sandbox environment you will be provided with Production credentials. Those will be a completely different credentials, not related with the ones on Sandbox. Production enviroment always process real bank transactions, cards from Sandbox are not supported on this environment.

Authentication

curl https://business.sandbox.wirecapital.com/v1/charges \
   -H "Authorization: Bearer merchant_private_key"
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer merchant_private_key",
  ),
));
import http.client

conn = http.client.HTTPSConnection("...")

headers = {
    "authorization": "Bearer merchant_private_key",
    }
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://business.sandbox.wirecapital.com/api/v1/payouts")
...
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Bearer merchant_private_key")
  .build();

Response response = client.newCall(request).execute();

Authenticate your account when using the API, by including your secret API key which has been sent via email during registration. Management of your API keys can be done within the backoffice.

Your API keys carry importance and privileges, be sure to store them securely. Please do not share your secret API keys in publicly accessible areas such GitHub and client-side code areas.

Authentication to the API is performed via bearer auth keys (for cross-origin requests), use -H “Authorization: Bearer merchant_private_key”.

All API requests must be made through HTTPS. Calls made through plain HTTP will fail. API requests without authentication will also fail.

Payments

Payment processing REST API.

Create

curl "https://business.sandbox.wirecapital.com/api/v1/payments" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "product" : "Your Product",
        "amount" : 1000,
        "currency" : "CNY",
        "redirectSuccessUrl" : "https://your-site.com/success",
        "redirectFailUrl" : "https://your-site.com/fail",
        "returnUrl" : "https://your-site.com/pending",
        "extraReturnParam" : "your order id or other info",
    "orderNumber" : "your order number",
    "locale": "en"

    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/payments",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{ \"product\" : \"Your Product\", \"amount\" : 10000, \"currency\" : \"CNY\", \"redirectSuccessUrl\" : \"https://your-site.com/success\", \"redirectFailUrl\" : \"https://your-site.com/fail\", \"returnUrl\" : \"https://your-site.com/pending\", \"extraReturnParam\" : \"your order id or other info\", \"orderNumber\" : \"your order number\", \"locale\" : \"zh\"\n}",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer merchant_private_key",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

  MERCHANT_PRIVATE_KEY = 'merchant_private_key'
  LIVE_URL = 'https://business.wirecapital.com';
  SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

  payload = {
    "product" : request.POST['product_name'],
    "amount" : request.POST['order_amount'],
    "currency" : "CNY",
    "redirectSuccessUrl": request.POST['notify_url'],
    "redirectFailUrl" : request.POST['return_url'],
    "returnUrl" : request.POST['return_url'],
    "extraReturnParam" : request.POST['order_no'],
    "orderNumber" : request.POST['order_number'],
    "locale" : request.POST['locale']
  }

  headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY)
  }

  resp = requests.post('%s/api/v1/payments' % (SANDBOX_URL), json=payload, headers=headers)

  if resp.status_code == 200:
    resp_payload = json.loads(resp.text)
    return HttpResponseRedirect(resp_payload['processingUrl'])
  else:
    return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))
MediaType JSON = MediaType.parse("application/json; charset=utf-8");

HashMap<String, Object> params = new HashMap<String, Object>();

params.put("product", "Example Payment");
params.put("amount", 1000);
params.put("currency", "EUR");
params.put("redirectSuccessUrl", "[sucess redirect url]");
params.put("redirectFailUrl", "[fail redirect url]");
params.put("returnUrl", "[pending redirect url]");
params.put("orderNumber", "[merchat system order number]");
params.put("extraReturnParam", "[some additional params]");
params.put("locale", "[user locale]");
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
       .url("https://business.sandbox.wirecapital.com/api/v1/payments")
       .post(RequestBody.create(JSON, new Gson().toJson(params)))
       .addHeader("content-type", "application/json")
       .addHeader("authorization", "Bearer merchant_private_key")
       .build();

Call call = client.newCall(request);

call.enqueue(new Callback() {

   @Override
   public void onFailure(Call call, IOException e) {
       Log.e("response ", "onFailure(): " + e.getMessage() );
   }

   @Override
   public void onResponse(Call call, Response response) throws IOException {
       String resp = response.body().string();
       Log.e("response ", "onResponse(): " + resp );
   }
});

Return status 200 and JSON:

{
  "success": true | false,
  "errors": [],
  "token": "[payment token]",
  "processingUrl": "https://business.sandbox.wirecapital.com/p/[payment token]",
  "payment": {
    "amount": "10020",
    "currency": "CNY",
    "status": "init"
  },
  "redirectRequest": {
    "url": "[redirect url, for example ACS URL for 3ds]",
    "params": {
      "PaReq": "[PaReq for current payment]",
      "TermUrl": "https://business.sandbox.wirecapital.com/checkout_results/[payment token]/callback_3ds"
    },
    "type": "post"
  }
}

Initialize payments - to begin receiving payments, you must first call using the following script. This will enable you to obtain a payment token, which will be required later to complete API integration.

HTTP Request via SSL

POST '/api/v1/payments'

Query Parameters

Parameter Mandatory Description
product no Product name (Service description) (example: 'iPhone'). String(1-256)
amount yes Payment amount in cents (10020), except JPY. Integer(1-32)
currency yes Currency code by ISO 4217. String(3)
callbackUrl no The server URL a merchant will be notified about a payment finalisation. URI-String
redirectSuccessUrl no The URL a customer will be redirected to in the case of successfull payment. URI-String
redirectFailUrl no The URL a customer will be redirected to in the case of payment error or failure. URI-String
returnUrl no The URL to which the client will be redirected in case of waiting for the payment to be completed (not in the final status) or if the redirectSuccessUrl and redirectFailUrl parameters are not passed. URI-String
extraReturnParam no Bank/Payment method list, description, etc. String(1-256)
orderNumber yes The current order number from a company system. String(1-32)
locale no The locale is used on a payment page by default. Currently supported locales: en from ISO 639-1. String(2)
time_to_live no Payment link expired date. Format: dd-mm-yyyy hh:mm String(1-256)
card no Card object for Host2Host payments.
customer no Customer object.
browser_info no BrowserInfo object.

Card Object Parameters

Parameter Mandatory Description
pan yes Customer’s card number (PAN). Any valid card number, may contain spaces. String(13-19)
expires yes Customer’s card expiration date. Format: mm/yyyy. String(7)
holder yes Customer’s cardholder name. Any valid cardholder name. String(1-256)
cvv yes Customer’s CVV2 / CVC2 / CAV2. String(3)

Customer Object Parameters (optional)

Parameter Mandatory Description
email yes Customer’s email, is mandatory if Customer object posted on a request. String(1-256)
address no Customer's billing address. String(1-256)
ip no Customer IP address. String(IP format)
zip no Customer ZIP/Postal code. Only letters, numbers, spaces and dashes. String(1-20)
country no Customer country code. String(2) (ISO 3166)
city no Customer city. String(1-256)
phone no Customer phone number. Only digits. String(1-32)
birth_date no Customer birth date. Format: dd-mm-yyyy String(1-256)
first_name no Customer first name. String(1-256)
last_name no Customer last name. String(1-10)
address1 no Customer address line 1. String(1-256)
address2 no Customer address line 2. String(1-256)
state no Customer state. String(1-256)

BrowserInfo Object Parameters (optional)

Parameter Mandatory Description
AcceptHeader no property of the HTTP protocol that allows a server to provide specific content types from the same URL. String(1-256)
ScreenWidth no The total width of the user's screen in pixels. String(1-256)
ScreenHeight no The height property returns the height in pixels. String(IP format)
ScreenColorDepth no The number of bits used to hold a screen pixel. String(1-256)
WindowWidth no Gets or sets the width of the host Window or NavigationWindow of a Page. String(1-256)
WindowHeight no Gets or sets the height of the host Window or NavigationWindow of a Page. String(1-256)
Language no Browser Language. String(1-32)
JavaEnabled no indicates whether the current browser is Java Run Time Environment-enabled or not. String(1-256)
UserAgent no computer program representing a person, for example, a browser in a Web context. String(1-256)
TimeZone no Browser Time Zone. String(1-256)

List

curl "https://business.sandbox.wirecapital.com/api/v1/payments?date_from=2016-05-11&page=1&per_page=1" \
    -H "Authorization: Bearer merchant_private_key"
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/payments?date_from=2016-05-11&page=1&per_page=1",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",f
  CURLOPT_HTTPHEADER => array(
      "authorization: Bearer merchant_private_key"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://business.sandbox.wirecapital.com/api/v1/payments")
  .get()
  .addHeader("authorization", "Bearer merchant_private_key")
  .build();

Response response = client.newCall(request).execute();

Return status 200 and JSON:

{
  "success": true | false,
  "errors": [],
  "status": 200,
  "totalCount": 10,
  "curentPage": 1,
  "perPage": 1,
  "totalPage": 10,
  "payments": [
    {
      "id": 1,
      "status": "sent",
      "token": "[payment token]",
      "currency": "CNY",
      "product": "Your Product",
      "redirect_success_url": "https://your-site.com/success",
      "redirect_fail_url": "https://your-site.com/fail",
      "amount": 10000,
      "created_at": "2016-06-27T14:13:00.273Z",
      "updated_at": "2016-06-27T14:15:44.715Z",
      "extra_return_param": "your order id or other info",
      "operation_type": "pay",
      "order_number": 1
    }
  ]
}

Payments List - this is the method used to display the list of returned payments.

HTTP Request via SSL

GET '/api/v1/payments'

Query Parameters

Parameter Required Description
date_from No Date from (example: '2015-01-01'). String(YYYY-MM-DD)
date_to No Date to (example: '2015-01-02'). String(YYYY-MM-DD)
page No Page number (default: 1). Integer(1-6)
per_page No Payment per page (max: 500, default: 20). Integer(1-3)
operation_type No Operation type. String(pays, payouts, all)
order_number No Merchant's order number. String(1-32)

Get

curl "https://business.sandbox.wirecapital.com/api/v1/payments/[payment_token]" \
    -H "Authorization: Bearer merchant_private_key"

Return status 200 and JSON:

{
    "success": true | false,
    "errors": [],
    "status": 200,
    "payment": {
      "id": 2599,
      "status": "pending | approved | declined | expired | refunded",
      "token": "[payment token]",
      "currency": "[payment currency]",
      "product": "[product description]",
      "callback_url": "[callback/notification url]",
      "redirect_success_url": "success redirection url",
      "redirect_fail_url": "fail redirection url",
      "amount": 0,
      "created_at": "[creation date]",
      "updated_at": "[last status update date]",
      "extra_return_param": "[extra params, can be use to payment identification in merchat system]",
      "operation_type": "pay | payout",
      "order_number": "[merchant's order number]"
    }
}

Payment Get - this is the method used to retrieve information about single payment.

HTTP Request via SSL

GET '/api/v1/payments/[payment_token]'

Callback parametrs

Params:

{
  "token": "913a072e2fc9ca6e7d8d9637cd577cc3",
  "type": "pay",
  "status": "approved",
  "extraReturnParam": "Demo+shop",
  "orderNumber": "6C50IVG2LE",
  "amount": "2900",
  "currency": "USD",
  "gatewayAmount": "2900",
  "gatewayCurrency": "USD",
  "threeDSStatus": "Y",
  "sanitizedMask": "400000******0002",
  "countryISOByIp": "AZE",
  "bankCountryISO": "AZE",
  "bankCountryName": "AZERBAIJAN",
  "bankName": "EXPRESSBANK+OSC",
  "approvalCode": "186983",
  "transactionTime": "2019-08-08+12%3A13%3A10+UTC",
  "signature": "86e25d1696d35da5e2b03f98b67ccfbd"
}

After payment processing system redirect payer to merchant's redirectSuccessUrl or redirectFailUrl or returnUrl from payment init params.

Query Parameters

Parameter Description
token Payment token
type Payment type (pay, refund)
status Payment status (approved, partial_approved, pending, hold, declined, voided)
extraReturnParam Extra return param from Payment init request
orderNumber Order number from Payment init request
amount Amount from Payment init request
currency Currency from Payment init request
gatewayAmount Gateway amount in cents
gatewayCurrency Gateway currency in ISO
threeDSStatus Status of 3DSec
sanitizedMask Mask of payer's bank card
countryISOByIp Payer's country name in ISO
bankCountryISO Payer's bank country name in ISO
bankCountryName Payer's bank country name
bankName Payer's bank name
approvalCode Transaction approval code
signature Signature

Callback 3DS

curl "https://business.sandbox.wirecapital.com/checkout_results/[payment_token]/callback_3ds" </span>
    -X POST </span>
    -H "Content-Type: application/x-www-form-urlencoded" </span>
    --data PaRes=success </span>
    --data MD=841ad2163c9ca600a037ad2f3c26fc97
import http.client

conn = http.client.HTTPConnection("host")

payload = "PaRes=success&MD=841ad2163c9ca600a037ad2f3c26fc97"

headers = { 'cookie': "locale=en", 'Content-Type': "application/x-www-form-urlencoded" }

conn.request("POST", "/checkout_results/841ad2163c9ca600a037ad2f3c26fc97/callback_3ds", payload, headers)

res = conn.getresponse() data = res.read()

print(data.decode("utf-8"))

<?php

$curl = curl_init();

curl_setopt_array($curl, [ CURLOPT_URL => "host/checkout_results/841ad2163c9ca600a037ad2f3c26fc97/callback_3ds", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "PaRes=success&MD=841ad2163c9ca600a037ad2f3c26fc97", CURLOPT_COOKIE => "locale=en", CURLOPT_HTTPHEADER => [ "Content-Type: application/x-www-form-urlencoded" ], ]);

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

HttpResponse<String> response = Unirest.post("host/checkout_results/841ad2163c9ca600a037ad2f3c26fc97/callback_3ds")
  .header("cookie", "locale=en")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .body("PaRes=success&MD=841ad2163c9ca600a037ad2f3c26fc97")
  .asString();

Return status 200 and JSON:

{
  "success": true,
  "result": 0,
  "status": 200,
  "token": "841ad2163c9ca600a037ad2f3c26fc97",
  "processingUrl": "",
  "payment": {
    "amount": 440,
    "gateway_amount": 440,
    "currency": "EUR",
    "3DS": "UNK",
    "status": "approved"
  }
}

Callback 3DS - this is the method used to verify 3d secure authentication.

HTTP Request via SSL

POST '/checkout_results/[payment_token]/callback_3ds'

Query Parameters

Parameter Mandatory Description
PaRes yes Parameter returned from ACS. Text Base64
MD yes Parameter returned from ACS. String(1-256)

Crypto

curl "https://business.sandbox.wirecapital.com/api/v1/crypto" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "product" : "Your Product",
        "amount" : 1000,
        "currency" : "EUR",
        "redirectSuccessUrl" : "https://your-site.com/success",
        "redirectFailUrl" : "https://your-site.com/fail",
        "extraReturnParam" : "your order id or other info",
        "orderNumber" : "your order number",
        "locale": "en"
    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/crypto", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{ \"product\" : \"Your Product\", \"amount\" : 10000, \"currency\" : \"EUR\", \"redirectSuccessUrl\" : \"https://your-site.com/success\", \"redirectFailUrl\" : \"https://your-site.com/fail\", \"extraReturnParam\" : \"your order id or other info\", \"orderNumber\" : \"your order number\", \"locale\" : \"zh\"\n}", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

payload = { "product" : request.POST['product_name'], "amount" : request.POST['order_amount'], "currency" : "EUR", "redirectSuccessUrl": request.POST['notify_url'], "redirectFailUrl" : request.POST['return_url'], "extraReturnParam" : request.POST['order_no'], "orderNumber" : request.POST['order_number'], "locale" : request.POST['locale'] }

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/crypto' % (SANDBOX_URL), json=payload, headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

MediaType JSON = MediaType.parse("application/json; charset=utf-8");

HashMap<String, Object> params = new HashMap<String, Object>();

params.put("product", "Example Payment"); params.put("amount", 1000); params.put("currency", "EUR"); params.put("redirectSuccessUrl", "[sucess redirect url]"); params.put("redirectFailUrl", "[fail redirect url]"); params.put("orderNumber", "[merchat system order number]"); params.put("extraReturnParam", "[some additional params]"); params.put("locale", "[user locale]"); OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder() .url("https://business.sandbox.wirecapital.com/api/v1/crypto") .post(RequestBody.create(JSON, new Gson().toJson(params))) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer merchant_private_key") .build();

Call call = client.newCall(request);

call.enqueue(new Callback() {

@Override public void onFailure(Call call, IOException e) { Log.e("response ", "onFailure(): " + e.getMessage() ); }

@Override public void onResponse(Call call, Response response) throws IOException { String resp = response.body().string(); Log.e("response ", "onResponse(): " + resp ); } });

Return status 200 and JSON:

{
  "success": true | false,
  "result": 0,
  "status": 200,
  "token": "[payment token]",
  "processingUrl": "https://business.sandbox.wirecapital.com/p/[payment token]",
  "payment": {
    "amount": "10020",
    "currency": "EUR",
    "status": "init"
  },
  "errors": []
}

Initialize crypto payments - to begin receiving crypto payments, you must first call using the following script. This will enable you to obtain a payment token, which will be required later to complete API integration.

HTTP Request via SSL

POST '/api/v1/crypto'

Query Parameters

Parameter Mandatory Description
product no Product name (Service description) (example: 'iPhone'). String(1-256)
amount yes Payment amount in cents (10020), except JPY. Integer(1-32)
currency yes Currency code by ISO 4217. String(3)
callbackUrl no The server URL a merchant will be notified about a payment finalisation. URI-String
redirectSuccessUrl no The URL a customer will be redirected to in the case of successfull payment. URI-String
redirectFailUrl no The URL a customer will be redirected to in the case of payment error or failure. URI-String
extraReturnParam no Bank/Payment method list, description, etc. String(1-256)
orderNumber yes The current order number from a company system. String(1-32)
locale no The locale is used on a payment page by default. Currently supported locales: en from ISO 639-1. String(2)
customer no customer’s information

Customer Object Parameters (optional)

Parameter Mandatory Description
email no Customer’s email, is mandatory if Customer object posted on a request. String(1-256)
address no Customer's billing address. String(1-256)
ip no Customer IP address. String(IP format)
zip no Customer ZIP/Postal code. Only letters, numbers, spaces and dashes. String(1-20)
country no Customer country code. String(2) (ISO 3166)
state no Customer state. String(1-256)
city no Customer city. String(1-256)
phone no Customer phone number. Only digits. String(1-32)
birth_date no Customer birth date. Format: dd-mm-yyyy String(1-256)
first_name no Customer first name. String(1-256)
last_name no Customer last name. String(1-10)
address1 no Customer address line 1. String(1-256)
address2 no Customer address line 2. String(1-256)

ApplePay

curl "https://business.sandbox.wirecapital.com/api/v1/applepay" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "product" : "Your Product",
        "amount" : 1000,
        "currency" : "EUR",
        "cryptogramApplepay":"ApplePay decoded cryptogram base64",
        "extraReturnParam" : "your order id or other info",
        "orderNumber" : "your order number",
        "locale": "en",
        "card": {
            "hpan": "4392963203551251",
            "expires": "260630",
            "holder": "HOLDER",
            "cvv": "123"
        },
        "customer": {
            "email": "test@email.com",
            "phone": "79111234567"
        }
    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, [ CURLOPT_PORT => "4000", CURLOPT_URL => "http://localhost:4000/api/v1/applepay", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\n\t\"product\": \"Test applepay\",\n\t\"amount\": 10000,\n\t\"currency\": \"EUR\",\n\t\"callbackUrl\": \"https://webhook.site/246f9d97-60a0-4f1a-9044-a8ea9cccef17\",\n\t\"orderNumber\": \"1655474564\",\n\t\"locale\": \"en\",\n\t\"extraReturnParam\": \"your order id or other info\",\n\t\"cryptogramApplepay\": \"ApplePay decoded cryptogram base64\",\n\t\"customer\": {\n\t\t\"email\": \"your@mail.com\",\n\t\t\"phone\": \"12232332323\"\n\t},\n\t\"card\": {\n\t\t\"hpan\": \"5324563539422134\",\n\t\t\"expires\": \"03/2025\",\n\t\t\"holder\": \"NO O NAMEZ\",\n\t\t\"cvv\": \"271\"\n\t}\n}", CURLOPT_COOKIE => "locale=en", CURLOPT_HTTPHEADER => [ "Authorization: Bearer 846033ed8492b96ca457", "Content-Type: application/json" ], ]);

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

mport http.client

conn = http.client.HTTPConnection("localhost:4000")

payload = "{\n\t\"product\": \"Test applepay\",\n\t\"amount\": 10000,\n\t\"currency\": \"EUR\",\n\t\"callbackUrl\": \"https://webhook.site/246f9d97-60a0-4f1a-9044-a8ea9cccef17\",\n\t\"orderNumber\": \"1655474604\",\n\t\"locale\": \"en\",\n\t\"extraReturnParam\": \"your order id or other info\",\n\t\"cryptogramApplepay\": \"ApplePay decoded cryptogram base64\",\n\t\"customer\": {\n\t\t\"email\": \"your@mail.com\",\n\t\t\"phone\": \"12232332323\"\n\t},\n\t\"card\": {\n\t\t\"hpan\": \"5324563539422134\",\n\t\t\"expires\": \"03/2025\",\n\t\t\"holder\": \"NO O NAMEZ\",\n\t\t\"cvv\": \"271\"\n\t}\n}"

headers = { 'cookie': "locale=en", 'Content-Type': "application/json", 'Authorization': "Bearer 846033ed8492b96ca457" }

conn.request("POST", "/api/v1/applepay", payload, headers)

res = conn.getresponse() data = res.read()

print(data.decode("utf-8"))

HttpResponse<String> response = Unirest.post("http://localhost:4000/api/v1/applepay")
  .header("cookie", "locale=en")
  .header("Content-Type", "application/json")
  .header("Authorization", "Bearer 846033ed8492b96ca457")
  .body("{\n\t\"product\": \"Test applepay\",\n\t\"amount\": 10000,\n\t\"currency\": \"EUR\",\n\t\"callbackUrl\": \"https://webhook.site/246f9d97-60a0-4f1a-9044-a8ea9cccef17\",\n\t\"orderNumber\": \"1655474632\",\n\t\"locale\": \"en\",\n\t\"extraReturnParam\": \"your order id or other info\",\n\t\"cryptogramApplepay\": \"ApplePay decoded cryptogram base64\",\n\t\"customer\": {\n\t\t\"email\": \"your@mail.com\",\n\t\t\"phone\": \"12232332323\"\n\t},\n\t\"card\": {\n\t\t\"hpan\": \"5324563539422134\",\n\t\t\"expires\": \"03/2025\",\n\t\t\"holder\": \"NO O NAMEZ\",\n\t\t\"cvv\": \"271\"\n\t}\n}")
  .asString();

Return status 200 and JSON:

{
  "success": true | false,
  "result": 0,
  "status": 200,
  "token": "[payment token]",
  "processingUrl": "https://business.sandbox.wirecapital.com/p/[payment token]",
  "payment": {
    "amount": "10020",
    "currency": "EUR",
    "status": "init"
  },
  "errors": []
}

Initialize applepay payments - to begin receiving applepay payments, you must first call using the following script. This will enable you to obtain a payment token, which will be required later to complete API integration.

HTTP Request via SSL

POST '/api/v1/applepay'

Query Parameters

Parameter Mandatory Description
product no Product name (Service description) (example: 'iPhone'). String(1-256)
amount yes Payment amount in cents (10020), except JPY. Integer(1-32)
currency yes Currency code by ISO 4217. String(3)
callbackUrl no The server URL a merchant will be notified about a payment finalisation. URI-String
extraReturnParam no Bank/Payment method list, description, etc. String(1-256)
redirectSuccessUrl no The URL a customer will be redirected to in the case of successfull payment. URI-String
redirectFailUrl no The URL a customer will be redirected to in the case of payment error or failure. URI-String
orderNumber yes The current order number from a company system. String(1-32)
locale no The locale is used on a payment page by default. Currently supported locales: en from ISO 639-1. String(2)
cryptogramApplepay yes ApplePay decoded cryptogram base64
customer no customer’s information
card yes card’s information

Customer Object Parameters (optional)

Parameter Mandatory Description
email no Customer’s email, is mandatory if Customer object posted on a request. String(1-256)
phone no Customer phone number. Only digits. String(1-32)

Card Object Parameters

Parameter Mandatory Description
hpan yes ApplePay PAN. String(13-19)
expires no Customer’s card expiration date.
holder no Customer’s cardholder name. Any valid cardholder name. String(1-256)
cvv no Customer’s CVV2 / CVC2 / CAV2. String(3)

SBP

curl "https://business.sandbox.wirecapital.com/api/v1/sbp" </span>
-X POST </span>
-H "Authorization: Bearer merchant_private_key" </span>
-H "Content-Type: application/json" -d '{
    "product" : "Your Product",
    "amount" : 1000,
    "currency" : "RUB",
    "redirectSuccessUrl" : "https://your-site.com/success",
    "redirectFailUrl" : "https://your-site.com/fail",
    "extraReturnParam" : "your order id or other info",
    "orderNumber" : "your order number",
    "locale": "en"

}'

<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/sbp", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{ \"product\" : \"Your Product\", \"amount\" : 10000, \"currency\" : \"RUB\", \"redirectSuccessUrl\" : \"https://your-site.com/success\", \"redirectFailUrl\" : \"https://your-site.com/fail\", \"extraReturnParam\" : \"your order id or other info\", \"orderNumber\" : \"your order number\", \"locale\" : \"zh\"\n}", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

  from django.http import HttpResponseRedirect, HttpResponse
  import requests
  import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

payload = { "product" : request.POST['product_name'], "amount" : request.POST['order_amount'], "currency" : "RUB", "redirectSuccessUrl": request.POST['notify_url'], "redirectFailUrl" : request.POST['return_url'], "extraReturnParam" : request.POST['order_no'], "orderNumber" : request.POST['order_number'], "locale" : request.POST['locale'] }

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/sbp' % (SANDBOX_URL), json=payload, headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

MediaType JSON = MediaType.parse("application/json; charset=utf-8");

HashMap<String, Object> params = new HashMap<String, Object>();

params.put("product", "Example Payment"); params.put("amount", 1000); params.put("currency", "EUR"); params.put("redirectSuccessUrl", "[sucess redirect url]"); params.put("redirectFailUrl", "[fail redirect url]"); params.put("orderNumber", "[merchat system order number]"); params.put("extraReturnParam", "[some additional params]"); params.put("locale", "[user locale]"); OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder() .url("https://business.sandbox.wirecapital.com/api/v1/sbp") .post(RequestBody.create(JSON, new Gson().toJson(params))) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer merchant_private_key") .build();

Call call = client.newCall(request);

call.enqueue(new Callback() {

@Override public void onFailure(Call call, IOException e) { Log.e("response ", "onFailure(): " + e.getMessage() ); }

@Override public void onResponse(Call call, Response response) throws IOException { String resp = response.body().string(); Log.e("response ", "onResponse(): " + resp ); } });

Return status 200 and JSON:

 {
  "success": true | false,
  "errors": [],
  "token": "[payment token]",
  "result": 0,
  "status": 200,
  "processingUrl": "https://business.sandbox.wirecapital.com/p/[payment token]",
  "payment": {
    "amount": "10020",
    "currency": "RUB",
    "status": "init"
}
}

Initialize SBP (СБП) payments - to begin receiving payments, you must first call using the following script. This will enable you to obtain a payment token, which will be required later to complete API integration.

HTTP Request via SSL

POST '/api/v1/sbp'

Query Parameters

Parameter Mandatory Description
product no Product name (Service description) (example: 'iPhone'). String(1-256)
amount yes Payment amount in cents (10020), except JPY. Integer(1-32)
currency yes Currency code by ISO 4217. String(3)
callbackUrl no The server URL a merchant will be notified about a payment finalisation. URI-String
redirectSuccessUrl no The URL a customer will be redirected to in the case of successfull payment. URI-String
redirectFailUrl no The URL a customer will be redirected to in the case of payment error or failure. URI-String
extraReturnParam no Bank/Payment method list, description, etc. String(1-256)
orderNumber yes The current order number from a company system. String(1-32)
locale no The locale is used on a payment page by default. Currently supported locales: en from ISO 639-1. String(2)
time_to_live no Date when crated QR become expired. Use Moscow Time. The validity period of the QR code. Format: dd-mm-yyyy hh:mm The maximum validity period of a dynamic QR code is 72 hours. If this field is missing when generating dynamic code, then the validity period will be 72 hours
customer no Customer object.

Customer Object Parameters (optional)

Parameter Mandatory Description
email yes Customer’s email, is mandatory if Customer object posted on a request. String(1-256)
address no Customer's billing address. String(1-256)
ip no Customer IP address. String(IP format)
zip no Customer ZIP/Postal code. Only letters, numbers, spaces and dashes. String(1-20)
country no Customer country code. String(2) (ISO 3166)
city no Customer city. String(1-256)
phone no Customer phone number. Only digits. String(1-32)
birth_date no Customer birth date. Format: dd-mm-yyyy String(1-256)
first_name no Customer first name. String(1-256)
last_name no Customer last name. String(1-10)
address1 no Customer address line 1. String(1-256)
address2 no Customer address line 2. String(1-256)
state no Customer state. String(1-256)

P2P_PAY

curl "https://business.sandbox.wirecapital.com/api/v1/p2p_pay" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "product" : "Your Product",
        "amount" : 1000,
        "currency" : "RUB",
        "redirectSuccessUrl" : "https://your-site.com/success",
        "redirectFailUrl" : "https://your-site.com/fail",
        "extraReturnParam" : "your order id or other info",
        "orderNumber" : "your order number",
        "locale": "en"

}'

<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/p2p_pay", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{ \"product\" : \"Your Product\", \"amount\" : 10000, \"currency\" : \"RUB\", \"redirectSuccessUrl\" : \"https://your-site.com/success\", \"redirectFailUrl\" : \"https://your-site.com/fail\", \"extraReturnParam\" : \"your order id or other info\", \"orderNumber\" : \"your order number\", \"locale\" : \"ru\"\n}", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

payload = { "product" : request.POST['product_name'], "amount" : request.POST['order_amount'], "currency" : "RUB", "redirectSuccessUrl": request.POST['notify_url'], "redirectFailUrl" : request.POST['return_url'], "extraReturnParam" : request.POST['order_no'], "orderNumber" : request.POST['order_number'], "locale" : request.POST['locale'] }

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/p2p_pay' % (SANDBOX_URL), json=payload, headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

MediaType JSON = MediaType.parse("application/json; charset=utf-8");

HashMap<String, Object> params = new HashMap<String, Object>();

params.put("product", "Example Payment"); params.put("amount", 1000); params.put("currency", "EUR"); params.put("redirectSuccessUrl", "[sucess redirect url]"); params.put("redirectFailUrl", "[fail redirect url]"); params.put("orderNumber", "[merchat system order number]"); params.put("extraReturnParam", "[some additional params]"); params.put("locale", "[user locale]"); OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder() .url("https://business.sandbox.wirecapital.com/api/v1/p2p_pay") .post(RequestBody.create(JSON, new Gson().toJson(params))) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer merchant_private_key") .build();

Call call = client.newCall(request);

call.enqueue(new Callback() {

@Override public void onFailure(Call call, IOException e) { Log.e("response ", "onFailure(): " + e.getMessage() ); }

@Override public void onResponse(Call call, Response response) throws IOException { String resp = response.body().string(); Log.e("response ", "onResponse(): " + resp ); } });

Return status 200 and JSON:

{
  "success": true | false,
  "errors": [],
  "token": "[payment token]",
  "result": 0,
  "status": 200,
  "processingUrl": "https://business.sandbox.wirecapital.com/p/[payment token]",
  "payment": {
    "amount": "10020",
    "currency": "RUB",
    "status": "init"
  }
}

Initialize P2P_PAY payments - to start receiving payments, you must first make a call using the following script. This will allow you to receive a payment token, which you will need later to complete integration with the API and a link to the payment page.

HTTP Request via SSL

POST '/api/v1/p2p_pay'

Query Parameters

Parameter Mandatory Description
product no Product name (Service description) (example: 'iPhone'). String(1-256)
amount yes Payment amount in cents (10020), except JPY. Integer(1-32)
currency yes Currency code by ISO 4217. String(3)
callbackUrl no The server URL a merchant will be notified about a payment finalisation. URI-String
redirectSuccessUrl no The URL a customer will be redirected to in the case of successfull payment. URI-String
redirectFailUrl no The URL a customer will be redirected to in the case of payment error or failure. URI-String
returnUrl no The URL to which the client will be redirected in case of waiting for the payment to be completed (not in the final status) or if the redirectSuccessUrl and redirectFailUrl parameters are not passed. URI-String
extraReturnParam no Bank/Payment method list, description, etc. String(1-256)
orderNumber no The current order number from a company system. String(1-32)
locale no The locale is used on a payment page by default. Currently supported locales: en from ISO 639-1. String(2)
customer no Customer object.

Customer Object Parameters (optional)

Parameter Mandatory Description
email no Customer’s email, is mandatory if Customer object posted on a request. String(1-256)
phone no Customer phone number. Only digits. String(1-32)

(H2H) P2P_PAY Init

curl "https://business.sandbox.wirecapital.com/api/v1/p2p_pay/h2h_init" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "product" : "Your Product",
        "amount" : 1000,
        "currency" : "RUB",
        "redirectSuccessUrl" : "https://your-site.com/success",
        "redirectFailUrl" : "https://your-site.com/fail",
        "extraReturnParam" : "your order id or other info",
        "orderNumber" : "your order number",
        "locale": "en"

}'

<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/p2p_pay/h2h_init", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{ \"product\" : \"Your Product\", \"amount\" : 10000, \"currency\" : \"RUB\", \"redirectSuccessUrl\" : \"https://your-site.com/success\", \"redirectFailUrl\" : \"https://your-site.com/fail\", \"extraReturnParam\" : \"your order id or other info\", \"orderNumber\" : \"your order number\", \"locale\" : \"ru\"\n}", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

payload = { "product" : request.POST['product_name'], "amount" : request.POST['order_amount'], "currency" : "RUB", "redirectSuccessUrl": request.POST['notify_url'], "redirectFailUrl" : request.POST['return_url'], "extraReturnParam" : request.POST['order_no'], "orderNumber" : request.POST['order_number'], "locale" : request.POST['locale'] }

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/p2p_pay/h2h_init' % (SANDBOX_URL), json=payload, headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

MediaType JSON = MediaType.parse("application/json; charset=utf-8");

HashMap<String, Object> params = new HashMap<String, Object>();

params.put("product", "Example Payment"); params.put("amount", 1000); params.put("currency", "EUR"); params.put("redirectSuccessUrl", "[sucess redirect url]"); params.put("redirectFailUrl", "[fail redirect url]"); params.put("orderNumber", "[merchat system order number]"); params.put("extraReturnParam", "[some additional params]"); params.put("locale", "[user locale]"); OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder() .url("https://business.sandbox.wirecapital.com/api/v1/p2p_pay/h2h_init") .post(RequestBody.create(JSON, new Gson().toJson(params))) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer merchant_private_key") .build();

Call call = client.newCall(request);

call.enqueue(new Callback() {

@Override public void onFailure(Call call, IOException e) { Log.e("response ", "onFailure(): " + e.getMessage() ); }

@Override public void onResponse(Call call, Response response) throws IOException { String resp = response.body().string(); Log.e("response ", "onResponse(): " + resp ); } });

Return status 200 and JSON:

{
  "success": true | false,
  "errors": [],
  "token": "[payment token]",
  "result": 0,
  "status": 200,
  "payment": {
    "amount": "10020",
    "currency": "RUB",
    "status": "init"
  },
  "banks": [
    {
      "bank_name": "Sber",
      "bank_id": "SBP_Sber"
    },
    {
      "bank_name": "Tinkoff",
      "bank_id": "SBP"
    },
    {
      "bank_name": "Openning",
      "bank_id": "card"
    }
  ]
}

Initialize P2P_PAY payments - to start receiving payments, you must first implement the integration using the following documentation. Request number 1 for payment initialization.

HTTP Request via SSL

POST '/api/v1/p2p_pay/h2h_init'

Query Parameters

Parameter Mandatory Description
product no Product name (Service description) (example: 'iPhone'). String(1-256)
amount yes Payment amount in cents (10020), except JPY. Integer(1-32)
currency yes Currency code by ISO 4217. String(3)
callbackUrl no The server URL a merchant will be notified about a payment finalisation. URI-String
redirectSuccessUrl no The URL a customer will be redirected to in the case of successfull payment. URI-String
redirectFailUrl no The URL a customer will be redirected to in the case of payment error or failure. URI-String
returnUrl no The URL to which the client will be redirected in case of waiting for the payment to be completed (not in the final status) or if the redirectSuccessUrl and redirectFailUrl parameters are not passed. URI-String
extraReturnParam no Bank/Payment method list, description, etc. String(1-256)
orderNumber no The current order number from a company system. String(1-32)
locale no The locale is used on a payment page by default. Currently supported locales: en from ISO 639-1. String(2)
customer no Customer object.

Customer Object Parameters (optional)

Parameter Mandatory Description
email no Customer’s email, is mandatory if Customer object posted on a request. String(1-256)
phone no Customer phone number. Only digits. String(1-32)

(H2H) P2P_PAY Create

curl "https://business.sandbox.wirecapital.com/api/v1/p2p_pay/[payment_token]/h2h_create" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "bank_id": "card"
    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/p2p_pay/[payment_token]/h2h_create", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\"bank_id</span>": \"card\"}", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

payload = { "bank_id" : request.POST['card'] }

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/p2p_pay/[payment_token]/h2h_create' % (SANDBOX_URL), json=payload, headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

MediaType JSON = MediaType.parse("application/json; charset=utf-8");

HashMap<String, Object> params = new HashMap<String, Object>();

params.put("bank_id", "card");

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder() .url("https://business.sandbox.wirecapital.com/api/v1/p2p_pay/[payment_token]/h2h_create") .post(RequestBody.create(JSON, new Gson().toJson(params))) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer merchant_private_key") .build();

Call call = client.newCall(request);

call.enqueue(new Callback() {

@Override public void onFailure(Call call, IOException e) { Log.e("response ", "onFailure(): " + e.getMessage() ); }

@Override public void onResponse(Call call, Response response) throws IOException { String resp = response.body().string(); Log.e("response ", "onResponse(): " + resp ); } });

Return status 200 and JSON:

{
  "success": true | false,
  "errors": [],
  "token": "[payment token]",
  "result": 0,
  "status": 200,
  "payment": {
    "amount": "10020",
    "currency": "RUB",
    "status": "init"
  },
  "confirm_url": "[host]/api/v1/p2p_pay/dbd99c64170563351d93f8c2d652c9ec/h2h_confirm",
  "cancel_url": "[host]/api/v1/p2p_pay/dbd99c64170563351d93f8c2d652c9ec/h2h_cancel",
  "target": {
    "number": "2200 XXXX XXXX 6173",
    "holder": null
  }
}

Create P2P_PAY payments. Request 2.

HTTP Request via SSL

POST '/api/v1/p2p_pay/[payment_token]/h2h_create'

Query Parameters

Parameter Mandatory Description
bank_id yes Bank Id. Returned in response from POST '/api/v1/p2p_pay/h2h_init (example: 'card'). String(1-256)

(H2H) P2P_PAY Confirm

curl "https://business.sandbox.wirecapital.com/api/v1/p2p_pay/[payment_token]/h2h_confirm" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "file_base64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/4QDKRXhpZgAATU0AKgAAAAgABgESAAMAAAABAAEAAAEaAAUAAAABAAAAVgEbAAUAAAABAAAAXgEoAAMAAAABAAIAAAITAAMAAAABAAEAAIdpAAQAAAABAAAAZgAAAAAAAABIAAAAAQAAAEgAAAABAAeQAAAHAAAABDAyMjGRAQAHAAAABAECAwCgAAAHAAAABDAxMDCgAQADAAAAAQABAACgAgAEAAAAAQAAABSgAwAEAAAAAQAAABSkBgADAAAAAQAAAAAAAAAAAAD/wAARCAAUABQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9sAQwABAQEBAQECAQECAwICAgMEAwMDAwQFBAQEBAQFBgUFBQUFBQYGBgYGBgYGBwcHBwcHCAgICAgJCQkJCQkJCQkJ/9sAQwEBAQECAgIEAgIECQYFBgkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJ/90ABAAC/9oADAMBAAIRAxEAPwD+r7wh8MfgDda3dXXi/wCFejeKdR8T+M/Ekd1qc2k2dzKhi1KSJXnlliZ2xGFUbm4RAAeAK8M/bG/Zn+GmkeNtD+MP7HPi7wX8JfiR8NLDWLqOC1sIjJfrJFFI1ne2djeWBuLWRbcrJBOJACyzR+XPFHIv5ZeOf2s/24v+G7PiP+zP8C/iBH4b0uPxH4nNvHe2sUtrBBGtrPLjZGJzK0t27pIZR5ZyecAV+RXjXwHp+raD4hiufHOjeatpAbnUZdKupih1aBninkmkvFZm2t5sjSOpYZILc4/H8b4hYXA5picBmGKc37kowjTmpU4O0PelDmcueopNNqO/JZpa/bYXhmrXwtLEUYcu6cm01J/FopWtaLV9X30P9FDw3qUmu6BZazKoja6t4pio6KZEVyPwzitvy/8AP+TX51/8EytS+Jl38Ctc0D4q6vJrd9oPiW+023mknnuilpHFA8MQnuszuFEh5kZiCSoJULX6LbF9BX6Rw/nVHM8BQzLDP3KsIzjftJKS2utn0bXZs+UzDBTw2Inh6vxRbT9U7M//0PkX/goF+018VPhp/wAFPPjtYeArmPS7jR/Geq28F5CH89obyx0954pMuY3R8gEFOijuMn4/+If7ff7WGl/CrXPsPip0jsLCa6t4TbWzwxzW8B8lxC0RjzHtXblTgADoMV33/BTv/lKj+0X/ANjxd/8Apv02vz7+Kf8AySjxP/2CLz/0Q1efguCMlx8pYnH4OnUnzfFKEZPRtrVpvRttdm3Y78XnmNw/LTw9aUY2Wik0tUr6J9ep/re/s6/BjwP8CfhxH4X8CLdNFqE76peT311NeXNxeXaq0ssk07O5JwFVQQqIqoiqqgD3bzG/z/8AqrA8M/8AIu2H/XtD/wCi1rcrroYGhhYRw2GgoU4LljGKSjGK0SSWiSWiS0SOOdadSTqVHeT1berbe7bP/9k="
    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/p2p_pay/[payment_token]/h2h_confirm", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\"file_base64</span>": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/4QD...\"}", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

payload = { "file_base64" : request.POST['data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/4QD...'] }

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/p2p_pay/[payment_token]/h2h_confirm' % (SANDBOX_URL), json=payload, headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

MediaType JSON = MediaType.parse("application/json; charset=utf-8");

HashMap<String, Object> params = new HashMap<String, Object>();

params.put("file_base64", "data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/4QD...");

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder() .url("https://business.sandbox.wirecapital.com/api/v1/p2p_pay/[payment_token]/h2h_confirm") .post(RequestBody.create(JSON, new Gson().toJson(params))) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer merchant_private_key") .build();

Call call = client.newCall(request);

call.enqueue(new Callback() {

@Override public void onFailure(Call call, IOException e) { Log.e("response ", "onFailure(): " + e.getMessage() ); }

@Override public void onResponse(Call call, Response response) throws IOException { String resp = response.body().string(); Log.e("response ", "onResponse(): " + resp ); } });

Return status 200 and JSON:

{
  "success": true | false,
  "errors": [],
  "token": "[payment token]",
  "result": 0,
  "status": 200,
  "payment": {
    "amount": "10020",
    "currency": "RUB",
    "status": "init"
  }
}

Payment confirmation P2P_PAY. Request 3.

HTTP Request via SSL

POST '/api/v1/p2p_pay/[payment_token]/h2h_confirm'

Query Parameters

Parameter Mandatory Description
file_base64 no Base64 image - (jpeg, png, jpg, gif, pdf)

(H2H) P2P_PAY Cancel

curl "https://business.sandbox.wirecapital.com/api/v1/p2p_pay/[payment_token]/h2h_cancel" </span>
    -X GET </span>
    -H "Authorization: Bearer merchant_private_key"
<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/p2p_pay/[payment_token]/h2h_cancel", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/p2p_pay/[payment_token]/h2h_cancel' % (SANDBOX_URL), headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

MediaType JSON = MediaType.parse("application/json; charset=utf-8");

HashMap<String, Object> params = new HashMap<String, Object>();

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder() .url("https://business.sandbox.wirecapital.com/api/v1/p2p_pay/[payment_token]/h2h_cancel") .get(RequestBody.create(JSON)) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer merchant_private_key") .build();

Call call = client.newCall(request);

call.enqueue(new Callback() {

@Override public void onFailure(Call call, IOException e) { Log.e("response ", "onFailure(): " + e.getMessage() ); }

@Override public void onResponse(Call call, Response response) throws IOException { String resp = response.body().string(); Log.e("response ", "onResponse(): " + resp ); } });

Return status 200 and JSON:

{
  "success": true,
  "errors": [],
  "token": "[payment token]",
  "result": 0,
  "status": 200,
  "payment": {
    "amount": "10020",
    "currency": "RUB",
    "status": "declined"
  }
}

Cancellation of the P2P_PAY payment. Request 4.

HTTP Request via SSL

GET '/api/v1/p2p_pay/[payment_token]/h2h_cancel'

P2P

curl "https://business.sandbox.wirecapital.com/api/v1/p2p" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "product" : "Your Product",
        "amount" : 1000,
        "currency" : "KZT",
        "extraReturnParam" : "your order id or other info",
        "orderNumber" : "your order number",
        "callbackUrl" : "your callback url",
        "locale": "en",
        "card": {
            "pan": "4405639704015096",
            "expires": "01/2025",
            "holder": "HOLDER",
            "cvv": "815"
        },
        "customer": {
            "email": "test@email.com"
        },
        "receiver": {
          "cardCred": "5522042705066736",
          "firstName": "John",
          "lastName": "Dowson"
        }
    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, [ CURLOPT_PORT => "4000", CURLOPT_URL => "http://localhost:4000/api/v1/p2p", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\n\t\"product\": \"Test p2p\",\n\t\"amount\": 10000,\n\t\"currency\": \"EUR\",\n\t\"callbackUrl\": \"https://webhook.site/246f9d97-60a0-4f1a-9044-a8ea9cccef17\",\n\t\"orderNumber\": \"1655474564\",\n\t\"locale\": \"en\",\n\t\"extraReturnParam\": \"your order id or other info\",\n\t\"customer\": {\n\t\t\"email\": \"your@mail.com\"},\n\t\"card\": {\n\t\t\"pan\": \"5324563539422134\",\n\t\t\"expires\": \"01/2025\",\n\t\t\"holder\": \"NO O NAMEZ\",\n\t\t\"cvv\": \"815\"\n\t}\n}, \n\t\"receiver\": {\n\t\t\"cardCred\": \"5324563539422134\",\n\t\t\"firstName\": \"John\",\n\t\t\"lastName\": \"Dowson\"\n\t}\n}", CURLOPT_COOKIE => "locale=en", CURLOPT_HTTPHEADER => [ "Authorization: Bearer 846033ed8492b96ca457", "Content-Type: application/json" ], ]);

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

mport http.client

conn = http.client.HTTPConnection("localhost:4000")

payload = "{\n\t\"product\": \"Test p2p\",\n\t\"amount\": 10000,\n\t\"currency\": \"EUR\",\n\t\"callbackUrl\": \"https://webhook.site/246f9d97-60a0-4f1a-9044-a8ea9cccef17\",\n\t\"orderNumber\": \"1655474564\",\n\t\"locale\": \"en\",\n\t\"extraReturnParam\": \"your order id or other info\",\n\t\"customer\": {\n\t\t\"email\": \"your@mail.com\"},\n\t\"card\": {\n\t\t\"pan\": \"5324563539422134\",\n\t\t\"expires\": \"01/2025\",\n\t\t\"holder\": \"NO O NAMEZ\",\n\t\t\"cvv\": \"815\"\n\t}\n}, \n\t\"receiver\": {\n\t\t\"cardCred\": \"5324563539422134\",\n\t\t\"firstName\": \"John\",\n\t\t\"lastName\": \"Dowson\"\n\t}\n}"

headers = { 'cookie': "locale=en", 'Content-Type': "application/json", 'Authorization': "Bearer 846033ed8492b96ca457" }

conn.request("POST", "/api/v1/p2p", payload, headers)

res = conn.getresponse() data = res.read()

print(data.decode("utf-8"))

HttpResponse<String> response = Unirest.post("http://localhost:4000/api/v1/p2p")
  .header("cookie", "locale=en")
  .header("Content-Type", "application/json")
  .header("Authorization", "Bearer 846033ed8492b96ca457")
  .body("{\n\t\"product\": \"Test p2p\",\n\t\"amount\": 10000,\n\t\"currency\": \"EUR\",\n\t\"callbackUrl\": \"https://webhook.site/246f9d97-60a0-4f1a-9044-a8ea9cccef17\",\n\t\"orderNumber\": \"1655474564\",\n\t\"locale\": \"en\",\n\t\"extraReturnParam\": \"your order id or other info\",\n\t\"customer\": {\n\t\t\"email\": \"your@mail.com\"},\n\t\"card\": {\n\t\t\"pan\": \"5324563539422134\",\n\t\t\"expires\": \"01/2025\",\n\t\t\"holder\": \"NO O NAMEZ\",\n\t\t\"cvv\": \"815\"\n\t}\n}, \n\t\"receiver\": {\n\t\t\"cardCred\": \"5324563539422134\",\n\t\t\"firstName\": \"John\",\n\t\t\"lastName\": \"Dowson\"\n\t}\n}")
  .asString();

Return status 200 and JSON:

{
  "success": true | false,
  "result": 0,
  "status": 200,
  "token": "[payment token]",
  "processingUrl": "https://business.sandbox.wirecapital.com/p/[payment token]",
  "payment": {
    "amount": "1000",
    "gateway_amount": "1000",
    "currency": "KZT",
    "status": "approved"
  },
  "errors": []
}

Initialize p2p payments - to begin receiving p2p payments, you must first call using the following script. This will enable you to obtain a payment token, which will be required later to complete API integration.

HTTP Request via SSL

POST '/api/v1/p2p'

Query Parameters

Parameter Mandatory Description
product no Product name (Service description) (example: 'iPhone'). String(1-256)
amount yes Payment amount in cents (10020), except JPY. Integer(1-32)
currency yes Currency code by ISO 4217. String(3)
callbackUrl no The server URL a merchant will be notified about a payment finalisation. URI-String
extraReturnParam no Bank/Payment method list, description, etc. String(1-256)
redirectSuccessUrl no The URL a customer will be redirected to in the case of successfull payment. URI-String
redirectFailUrl no The URL a customer will be redirected to in the case of payment error or failure. URI-String
returnUrl no The URL to which the client will be redirected in case of waiting for the payment to be completed (not in the final status) or if the redirectSuccessUrl and redirectFailUrl parameters are not passed. URI-String
orderNumber yes The current order number from a company system. String(1-32)
locale no The locale is used on a payment page by default. Currently supported locales: en from ISO 639-1. String(2)
customer no customer’s information
card yes card’s information
receiver yes receiver's information

Customer Object Parameters (optional)

Parameter Mandatory Description
email no Customer’s email, is mandatory if Customer object posted on a request. String(1-256)
address no Customer's billing address. String(1-256)

Card Object Parameters

Parameter Mandatory Description
pan yes Card PAN. String(13-19)
expires yes Customer’s card expiration date. Format: mm/yyyy. String(7)
holder yes Customer’s cardholder name. Any valid cardholder name. String(1-256)
cvv yes Customer’s CVV2 / CVC2 / CAV2. String(3)

Receiver Object Parameters

Parameter Mandatory Description
cardCred yes Card PAN. String(13-19)
firstName no Receiver first name. String(1-256)
lastName no Receiver last name. String(1-256)

Token payments

Token payments processing REST API.

Save card

curl "https://business.sandbox.wirecapital.com/api/v1/payments" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "product" : "Your Product",
        "amount" : 1000,
        "currency" : "USD",
        "extraReturnParam" : "your order id or other info",
        "orderNumber" : "your order number",
        "locale": "en",
        "callbackUrl" : "https://your-site.com/callback_url",
        "save_card": true,
        "card": {
          "pan": "4392963203551251",
          "expires": "12/2022",
          "holder": "Card Holder",
          "cvv": "134"
          },
        "customer" : { "email": "customer_email" }
      }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/payments", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{ \"product\" : \"Your Product\", \"amount\" : 10000,\"hold\" : \"true\", \"currency\" : \"CNY\", \"extraReturnParam\" : \"your order id or other info\", \"orderNumber\" : \"your order number\", \"locale\" : \"en\", \"callbackUrl\" : \"https://your-site.com/callback_url\", \"save_card\": true, \"card\": {\"pan</span>": \"4392963203551251\",\"expires\": \"12/2022\",\"holder\": \"Card Holder\",\"cvv\": \"134\"}, \"customer\" : { \" email\": \"customer_email\"} }", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

payload = { "product" : request.POST['product_name'], "amount" : request.POST['order_amount'], "currency" : "CNY", "extraReturnParam": request.POST['order_no'], "orderNumber" : request.POST['order_number'], "locale" : request.POST['locale'], "callbackUrl" : request.POST['callbackUrl'], "save_card": true, "card" : { "pan": "4392963203551251", "expires": "12/2022", "holder": "Card Holder", "cvv": "134"} }

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/payments' % (SANDBOX_URL), json=payload, headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

Return status 200 and JSON:

{ "success": true | false, "errors": [], "result": 0, "status": 200, "token": "[token]", "processingUrl": "https://business.sandbox.wirecapital.com/checkout/[token]?locale=en", "payment": { "amount": 100, "gateway_amount": 100, "currency": "RUB", "status": "approved" }, "card_token": "M2QxYTUxOTM0..." }

Token Payments is a payment solution that secures a customer's payment details as a "card_token". This allows you to recharge the customer's card for a specified amount, as required (e.g. subscription payments, membership fees, additional purchases in your online store on their profile). Token Payments are great for customer convenience because their details are saved as a "card_token" and they won't need to re-enter their details for subsequent purchases on your website.

When you originally submit the card data we store it securely and assign a "card_token" to that card number. We return this card_token to you, so it can be stored in your website shopping cart/billing platform. Whenever you wish to process a subsequent payment for a returning(or recurring) customer, you submit a token payment request, providing the total amount of the payment required and the card_token previously assigned to the customer, processing use the stored customer details to complete the transaction.

Example - You submit a token creation request with card number 4444333322221111 for Mr John Smith. We store John's card details and return a Token Id 123456789 for John, which you can then store on your shopping cart/billing platform. Next time you want to charge John, you send through the token ID 123456789 and the total you want to charge, and we will use the card number 444433332221111 to complete the transaction.

HTTP Request via SSL

POST '/api/v1/payments'

Query Parameters

Parameter Mandatory Description
product no Product name (Service description) (example: 'iPhone'). String(1-256)
amount yes Payment amount in cents (10020), except JPY. Integer(1-32)
currency yes Currency code by ISO 4217. String(3)
callbackUrl no The server URL a merchant will be notified about a payment finalisation. URI-String
redirectSuccessUrl no The URL a customer will be redirected to in the case of successfull payment. URI-String
redirectFailUrl no The URL a customer will be redirected to in the case of payment error or failure. URI-String
returnUrl no The URL to which the client will be redirected in case of waiting for the payment to be completed (not in the final status) or if the redirectSuccessUrl and redirectFailUrl parameters are not passed. URI-String
extraReturnParam no Bank/Payment method list, description, etc. String(1-256)
orderNumber yes The current order number from a company system. String(1-32)
locale no The locale is used on a payment page by default. Currently supported locales: en from ISO 639-1. String(2)
time_to_live no Payment link expired date. Format: dd-mm-yyyy hh:mm String(1-256)
save_card yes Save card attribute. Boolean (true)
card yes Card object for Host2Host payments.
customer no Customer object.

Card Object Parameters

Parameter Mandatory Description
pan yes Customer’s card number (PAN). Any valid card number, may contain spaces. String(13-19)
expires yes Customer’s card expiration date. Format: mm/yyyy. String(7)
holder yes Customer’s cardholder name. Any valid cardholder name. String(1-256)
cvv yes Customer’s CVV2 / CVC2 / CAV2. String(3)

Customer Object Parameters (optional)

Parameter Mandatory Description
email yes Customer’s email, is mandatory if Customer object posted on a request. String(1-256)
address no Customer's billing address. String(1-256)
ip no Customer IP address. String(IP format)
zip no Customer ZIP/Postal code. Only letters, numbers, spaces and dashes. String(1-20)
country no Customer country code. String(2) (ISO 3166)
city no Customer city. String(1-256)
phone no Customer phone number. Only digits. String(1-32)
birth_date no Customer birth date. Format: dd-mm-yyyy String(1-256)
first_name no Customer first name. String(1-256)
last_name no Customer last name. String(1-10)
address1 no Customer address line 1. String(1-256)
address2 no Customer address line 2. String(1-256)

Pay by card_token

curl "https://business.sandbox.wirecapital.com/api/v1/payments" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "product" : "Your Product",
        "amount" : 1000,
        "currency" : "USD",
        "extraReturnParam" : "your order id or other info",
        "orderNumber" : "your order number",
        "locale": "en",
        "callback_url" : "https://your-site.com/callback_url",
        "card": {
          "card_token": "M2QxYTUxOTM0..."
        },
        "customer" : { "email": "customer_email" }
      }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/payments", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{ \"product\" : \"Your Product\", \"amount\" : 10000,\"hold\" : \"true\", \"currency\" : \"CNY\", \"extraReturnParam\" : \"your order id or other info\", \"orderNumber\" : \"your order number\", \"locale\" : \"en\", \"callback_url\" : \"https://your-site.com/callback_url\", \"card\": {\"card_token</span>": "M2QxYTUxOTM0..."}, \"customer\" : { \" email\": \"customer_email\"} }", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

payload = { "product" : request.POST['product_name'], "amount" : request.POST['order_amount'], "currency" : "CNY", "extraReturnParam": request.POST['order_no'], "orderNumber" : request.POST['order_number'], "locale" : request.POST['locale'], "callback_url" : request.POST['callback_url'], "card" : { "card_token": "M2QxYTUxOTM0..."} }

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/payments' % (SANDBOX_URL), json=payload, headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

Return status 200 and JSON:

{ "success": true | false, "errors": [], "result": 0, "status": 200, "token": "[token]", "processingUrl": "https://business.sandbox.wirecapital.com/checkout/[token]?locale=en", "payment": { "amount": 100, "gateway_amount": 100, "currency": "RUB", "status": "approved" } }

HTTP Request via SSL

POST '/api/v1/payments'

Query Parameters

Parameter Mandatory Description
product no Product name (Service description) (example: 'iPhone'). String(1-256)
amount yes Payment amount in cents (10020), except JPY. Integer(1-32)
currency yes Currency code by ISO 4217. String(3)
callbackUrl no The server URL a merchant will be notified about a payment finalisation. URI-String
redirectSuccessUrl no The URL a customer will be redirected to in the case of successfull payment. URI-String
redirectFailUrl no The URL a customer will be redirected to in the case of payment error or failure. URI-String
returnUrl no The URL to which the client will be redirected in case of waiting for the payment to be completed (not in the final status) or if the redirectSuccessUrl and redirectFailUrl parameters are not passed. URI-String
extraReturnParam no Bank/Payment method list, description, etc. String(1-256)
orderNumber yes The current order number from a company system. String(1-32)
locale no The locale is used on a payment page by default. Currently supported locales: en from ISO 639-1. String(2)
time_to_live no Payment link expired date. Format: dd-mm-yyyy hh:mm String(1-256)
card yes Card object for Host2Host payments.
customer no Customer object.

Card Object Parameters

Parameter Mandatory Description
card_token yes card_token String Base64 encoded

Customer Object Parameters (optional)

Parameter Mandatory Description
email yes Customer’s email, is mandatory if Customer object posted on a request. String(1-256)
address no Customer's billing address. String(1-256)
ip no Customer IP address. String(IP format)
zip no Customer ZIP/Postal code. Only letters, numbers, spaces and dashes. String(1-20)
country no Customer country code. String(2) (ISO 3166)
city no Customer city. String(1-256)
phone no Customer phone number. Only digits. String(1-32)
birth_date no Customer birth date. Format: dd-mm-yyyy String(1-256)
first_name no Customer first name. String(1-256)
last_name no Customer last name. String(1-10)
address1 no Customer address line 1. String(1-256)
address2 no Customer address line 2. String(1-256)

Authorisations

Authorisation processing REST API.

Hold

curl "https://business.sandbox.wirecapital.com/api/v1/payments" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "product" : "Your Product",
        "amount" : 1000,
        "currency" : "CNY",
        "hold": "true",
        "extraReturnParam" : "your order id or other info",
        "orderNumber" : "your order number",
        "locale": "en"
        "callback_url" : "https://your-site.com/callback_url",
        "customer" : { "email": "customer_email" }
      }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/payments", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{ \"product\" : \"Your Product\", \"amount\" : 10000,\"hold\" : \"true\", \"currency\" : \"CNY\", \"extraReturnParam\" : \"your order id or other info\", \"orderNumber\" : \"your order number\", \"locale\" : \"en\", \"callback_url\" : \"https://your-site.com/callback_url\", \"customer\" : { \" email\": \"customer_email\"\n} \n}", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

payload = { "product" : request.POST['product_name'], "amount" : request.POST['order_amount'], "currency" : "CNY", "hold": "true", "extraReturnParam": request.POST['order_no'], "orderNumber" : request.POST['order_number'], "locale" : request.POST['locale'], "callback_url" : request.POST['callback_url'] }

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/payments' % (SANDBOX_URL), json=payload, headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

MediaType JSON = MediaType.parse("application/json; charset=utf-8");

HashMap<String, Object> params = new HashMap<String, Object>();

params.put("product", "Example Payment"); params.put("amount", 1000); params.put("hold", "true"); params.put("currency", "EUR"); params.put("extraReturnParam", "[extraReturnParam]"); params.put("orderNumber", "[merchat system order number]"); params.put("locale", "[user locale]"); params.put("redirectFailUrl", "[fail redirect url]"); params.put("callback_url", "[some callback_url]");

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder() .url("https://business.sandbox.wirecapital.com/api/v1/payments") .post(RequestBody.create(JSON, new Gson().toJson(params))) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer merchant_private_key") .build();

Call call = client.newCall(request);

call.enqueue(new Callback() {

@Override public void onFailure(Call call, IOException e) { Log.e("response ", "onFailure(): " + e.getMessage() ); }

@Override public void onResponse(Call call, Response response) throws IOException { String resp = response.body().string(); Log.e("response ", "onResponse(): " + resp ); } });

Return status 200 and JSON:

{ "success": true | false, "errors": [], "result": 0, "status": 200, "token": "[token]", "processingUrl": "https://business.sandbox.wirecapital.com/checkout/[token]?locale=en", "payment": { "amount": 100, "gateway_amount": 100, "currency": "RUB", "status": "hold" } }

Initialize authorise payments - to begin receiving payments, you must first call using the following script. This will enable you to obtain a payment token, which will be required later to complete API integration. This is the first half of the two-step payment flow. Frst you should created a payment with the hold option set to true.

HTTP Request via SSL

POST '/api/v1/payments'

Query Parameters

Parameter Mandatory Description
product no Product name (Service description) (example: 'iPhone'). String(1-256)
amount yes Payment amount in cents (10020), except JPY. Integer(1-32)
hold yes Authorisation attribute. (String) "true"
currency yes Currency code by ISO 4217. String(3)
callbackUrl no The server URL a merchant will be notified about a payment finalisation. URI-String
redirectSuccessUrl no The URL a customer will be redirected to in the case of successfull payment. URI-String
redirectFailUrl no The URL a customer will be redirected to in the case of payment error or failure. URI-String
returnUrl no The URL to which the client will be redirected in case of waiting for the payment to be completed (not in the final status) or if the redirectSuccessUrl and redirectFailUrl parameters are not passed. URI-String
extraReturnParam no Bank/Payment method list, description, etc. String(1-256)
orderNumber yes The current order number from a company system. String(1-32)
locale no The locale is used on a payment page by default. Currently supported locales: en from ISO 639-1. String(2)
time_to_live no Payment link expired date. Format: dd-mm-yyyy hh:mm String(1-256)
card no Card object for Host2Host payments.
customer no Customer object.

Card Object Parameters

Parameter Mandatory Description
pan yes Customer’s card number (PAN). Any valid card number, may contain spaces. String(13-19)
expires yes Customer’s card expiration date. Format: mm/yyyy. String(7)
holder yes Customer’s cardholder name. Any valid cardholder name. String(1-256)
cvv yes Customer’s CVV2 / CVC2 / CAV2. String(3)

Customer Object Parameters (optional)

Parameter Mandatory Description
email yes Customer’s email, is mandatory if Customer object posted on a request. String(1-256)
address no Customer's billing address. String(1-256)
ip no Customer IP address. String(IP format)
zip no Customer ZIP/Postal code. Only letters, numbers, spaces and dashes. String(1-20)
country no Customer country code. String(2) (ISO 3166)
city no Customer city. String(1-256)
phone no Customer phone number. Only digits. String(1-32)
birth_date no Customer birth date. Format: dd-mm-yyyy String(1-256)
first_name no Customer first name. String(1-256)
last_name no Customer last name. String(1-10)
address1 no Customer address line 1. String(1-256)
address2 no Customer address line 2. String(1-256)

Capture

curl "https://business.sandbox.wirecapital.com/api/v1/payments" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "token" : "Payment token",
        "amount" : 1000
      }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/payments", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{ \"token\" : \"Payment token\", \"amount\" : 1000 \n}", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

payload = { "token" : request.POST['paymnt_token'], "amount" : request.POST['order_amount'] }

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/payments' % (SANDBOX_URL), json=payload, headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

MediaType JSON = MediaType.parse("application/json; charset=utf-8");

HashMap<String, Object> params = new HashMap<String, Object>();

params.put("token", "Payment token"); params.put("amount", 1000);

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder() .url("https://business.sandbox.wirecapital.com/api/v1/payments") .post(RequestBody.create(JSON, new Gson().toJson(params))) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer merchant_private_key") .build();

Call call = client.newCall(request);

call.enqueue(new Callback() {

@Override public void onFailure(Call call, IOException e) { Log.e("response ", "onFailure(): " + e.getMessage() ); }

@Override public void onResponse(Call call, Response response) throws IOException { String resp = response.body().string(); Log.e("response ", "onResponse(): " + resp ); } });

Return status 200 and JSON:

{ "success": true | false, "errors": [], "result": 0, "status": 200, "token": "[token]", "processingUrl": "", "payment": { "amount": 1000, "gateway_amount": 1000, "currency": "CNT", "status": "approved" } }

Capture payments - capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a payment with the hold option set to true. Uncaptured payments will be (canceled/captured) exactly three days after they are created.

HTTP Request via SSL

POST '/api/v1/payments/capture'

Query Parameters

Parameter Mandatory Description
token yes Payment token.
amount yes Payment amount in cents (10020), except JPY. Integer(1-32) Full or partial.

Cancel

curl "https://business.sandbox.wirecapital.com/api/v1/payments" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "token" : "Payment token"
      }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/payments", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{ \"token\" : \"Payment token\" \n}", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

payload = { "token" : request.POST['paymnt_token'] }

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/payments' % (SANDBOX_URL), json=payload, headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

MediaType JSON = MediaType.parse("application/json; charset=utf-8");

HashMap<String, Object> params = new HashMap<String, Object>();

params.put("token", "Payment token");

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder() .url("https://business.sandbox.wirecapital.com/api/v1/payments") .post(RequestBody.create(JSON, new Gson().toJson(params))) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer merchant_private_key") .build();

Call call = client.newCall(request);

call.enqueue(new Callback() {

@Override public void onFailure(Call call, IOException e) { Log.e("response ", "onFailure(): " + e.getMessage() ); }

@Override public void onResponse(Call call, Response response) throws IOException { String resp = response.body().string(); Log.e("response ", "onResponse(): " + resp ); } });

Return status 200 and JSON:

{ "success": true | false, "errors": [], "result": 0, "status": 200, "token": "[token]", "processingUrl": "", "payment": { "amount": 1000, "gateway_amount": 1000, "currency": "CNT", "status": "voided" } }

Cancel payment - cancel the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a payment with the hold option set to true. Uncaptured payments will be canceled by payment_token param.

HTTP Request via SSL

POST '/api/v1/payments/cancel'

Query Parameters

Parameter Mandatory Description
token yes Payment token.

Refunds

Refunds processing REST API.

Create

curl "https://business.sandbox.wirecapital.com/api/v1/refunds" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "token" : "Your Product",
        "amount": "100"
    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/payments", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{ \"token\" : \"payment token\""\n}", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

MERCHANT_PRIVATE_KEY = 'merchant_private_key' LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = 'https://business.sandbox.wirecapital.com'

payload = { "token" : request.POST['token payment'], "amount": "100" }

headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY) }

resp = requests.post('%s/api/v1/refunds' % (SANDBOX_URL), json=payload, headers=headers)

if resp.status_code == 200: resp_payload = json.loads(resp.text) return HttpResponseRedirect(resp_payload['processingUrl']) else: return HttpResponse('<html><body><span>Something gone wrong: %s</span></body></html>' % (resp.status_code))

MediaType JSON = MediaType.parse("application/json; charset=utf-8");

HashMap<String, Object> params = new HashMap<String, Object>();

params.put("token", "payment token"); params.put("amount", "100"); OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder() .url("https://business.sandbox.wirecapital.com/api/v1/refunds") .post(RequestBody.create(JSON, new Gson().toJson(params))) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer merchant_private_key") .build();

Call call = client.newCall(request);

call.enqueue(new Callback() {

@Override public void onFailure(Call call, IOException e) { Log.e("response ", "onFailure(): " + e.getMessage() ); }

@Override public void onResponse(Call call, Response response) throws IOException { String resp = response.body().string(); Log.e("response ", "onResponse(): " + resp ); } });

Return status 200 and JSON:

{
  "success": true | false,
  "errors": [],
  "token": "[payment token]",
  "processingUrl": "https://business.sandbox.wirecapital.com/p/[payment token]",
  "refund": {
    "token": "3a1a4fc8f975eb022a1c0ddb3abcded9",
    "amount": "10020",
    "currency": "USD",
    "status": "approved | declined"
  }
}

Create refunds by providing a payment token.

HTTP Request via SSL

POST '/api/v1/refunds'

Query Parameters

Parameter Mandatory Description
token yes Payment token. String(1,32)
amount no Refund amount in cents. Integer(1,32)

Payouts

Transferring money from a business account to a client account.

Payout

curl "https://business.sandbox.wirecapital.com/api/v1/payouts" </span>
-X POST </span>
-H "Authorization: Bearer merchant_private_key" </span>
-H "Content-Type: application/json" -d '{
    "amount" : 1000,
    "currency" : "USD",
    "orderNumber": "10001",
    "product": "Payout",
    "callbackUrl": "https://callback.url/payout",
    "bankAccount": {
        "pan": "4392963203551251",
        "expires": "09/2021",
        "firstName": "card",
        "lastName": "holder",
        "phone": "79111234567",
        "email": "test@email.com"
    },
    "beneficiary": {
        "firstName": "Ivan",
        "lastName": "Petrov",
        "middleName":"MiddleName",
        "phone": "79111234567",
        "documentIssuer": "GUVD St. Petersburg",
        "documentSeries": "AN",
        "documentNumber": "4003456789",
        "documentIssuedAt": "11-11-2017",
        "country": "RU"
    },
    "billing": {
        "state": "PA",
        "country": "RU",
        "city": "Tula",
        "zip": "123456",
        "street": "Lenins st. 134-2-55",
        "phone": "79111234567"
    },
    "sender": {
        "first_name": "Galina",
        "last_name": "Lomova",
        "birthday": "11-03-1987",
        "country": "RU",
        "phone": "79213456789",
        "street": "Lenins st. 134-2-55",
        "zip": "123456",
        "state": "PA",
        "city": "Tula",
        "pass_number": "4003456789",
        "pass_date": "13-06-2005",
        "pass_whom": "GUVD Moscow",
        "pass_expires": "11-03-2035",
        "account_number": "1234567890"
    }
}'

Return status 200 and JSON:

{
  "success": true | false,
  "errors": [],
  "result": 0 | 1,
  "status": 200,
  "token": "9da74698a1a870cd98ee153e1c5df05f",
  "payout": {
      "amount": "1000",
      "currency": "USD",
      "status": "approved"
  }
}

Create a payout operation.

HTTP Request via SSL

POST '/api/v1/payouts'

Query Parameters

Parameter Mandatory Description
product no Product name (Service description) (example: 'iPhone'). String(1-256)
amount yes Payment amount in cents (10020), except JPY. Integer(1-32)
currency yes Currency code by ISO 4217. String(3)
callbackUrl no The server URL a merchant will be notified about a payment finalisation. URI-String
orderNumber yes The current order number from a company system. String(1-32)
bankAccount yes customer’s bank account information
beneficiary no beneficiary information
billing no customer’s billing information
sender no sender’s information

BankAccount Object Parameters

Parameter Mandatory Description
pan yes (no for Payout by card_token) Customer’s card number (PAN). Any valid card number, may contain spaces. String(13-19)
card_token no (yes for Payout by card_token) card_token String Base64 encoded
expires no Customer’s card expiration date. Format: mm/yyyy. String(7)
firstName yes Cardholder first name. Any valid cardholder name. String(1,256)
lastName yes Cardholder last name. Any valid cardholder name. String(1,256)
phone no Cardholder phone number. Only digits. String(1,32)
email no Cardholder email. String(1,256)

Beneficiary Object Parameters

Parameter Mandatory Description
firstName no Cardholder first name. Any valid cardholder name. String(1,256)
lastName no Cardholder last name. Any valid cardholder name. String(1,256)
middleName no Beneficiary middle name. Any valid cardholder name. String(1,256)
phone no Cardholder phone number. Only digits. String(1,32)
country no Beneficiary country. String(2) (ISO 3166)
documentIssuer no Beneficiary document issuer. String(1,256)
documentSeries no Beneficiary document series. String(1,256)
documentNumber no Beneficiary document number. String(1,256)
documentIssued_at no Beneficiary document issued at. String(1,256)

Billing Object Parameters

Parameter Mandatory Description
zip no Cardholder ZIP code. Only digits. String(1,10)
country no Cardholder country code. String(2) (ISO 3166)
city no Cardholder city. String(1,256)
phone no Cardholder phone number. Only digits. String(1,32)
email no Cardholder email. String(1,256)
state no Cardholder state. String(1,256)
birthday no Cardholder birthday. Format: DD-MM-YYYY. String

Sender Object Parameters

Parameter Mandatory Description
first_name no Sender first name. Any valid name. String(1,256)
last_name no Sender last name. Any valid name. String(1,256)
birthday no Sender birthday. Format: DD-MM-YYYY. String
country no Sender country code. String(2) (ISO 3166)
phone no Sender phone number. Only digits. String(1,32)
street no Sender street address. String(1,256)
zip no Sender ZIP code. Only digits. String(1,10)
state no Sender state. String(1,256)
city no Sender city. String(1,256)
pass_number no Sender passport number. String(1,256)
pass_date no Sender passport start date. Format: DD-MM-YYYY. String
pass_expires no Sender passport expiration date. Format: DD-MM-YYYY. String
pass_whom no Sender passport issuing organization. String(1,256)
account_number no Sender account number. String(1,256)
address no Sender address. String(1,256)

OCT Payouts

Transferring money from a business account to a client account.

OCT Payout

curl "https://business.sandbox.wirecapital.com/api/v1/oct_payouts" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "product": "OCT Payout",
        "token": "e16d41259c1d46bf5abfe975104692f8",
        "amount": 1000,
        "orderNumber": "10001",
        "callbackUrl": "https://callback.url/payout"
    }'

Return status 200 and JSON:

{
  "success": true | false,
  "errors": [],
  "result": 0 | 1,
  "status": 200,
  "token": "9da74698a1a870cd98ee153e1c5df05f",
  "payout": {
      "amount": "1000",
      "currency": "USD",
      "status": "approved"
  }
}

Create an oct payout operation.

HTTP Request via SSL

POST '/api/v1/oct_payouts'

Query Parameters

Parameter Mandatory Description
product no Product name (Service description) (example: 'iPhone'). String(1-256)
amount yes Payment amount in cents (10020), except JPY. Integer(1-32)
callbackUrl no The server URL a merchant will be notified about a payment finalisation. URI-String
orderNumber yes The current order number from a company system. String(1-32)
token yes Payment token of original transaction. String(1,32)

Wire Transfer Payments

Wire transfer payment processing REST API.

Wire transfer payment

curl "https://business.sandbox.wirecapital.com/api/v1/wire_transfers/payments" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "order_number": "your order number",
        "description": "your description",
        "callback_url": "https://your-site.com/callback",
        "amount": 320,
        "currency": "USD",
        "sender": {
            "email": "semail@site.com"
        }
    }'

Return status 200 and JSON:

{
  "success": true | false,
  "errors": [],
  "result": 0 | 1,
  "status": 200,
  "token": "[wire_transfer token]",
  "processingUrl": "https://business.sandbox.wirecapital.com/checkout/[wire_transfer token]",
    "wire_transfer_payment": {
        "status": "pending",
        "amount": 570,
        "currency": "EUR"
    },
    "redirectRequest": {
        "url": "[redirect url, for example ACS URL for 3ds]",
        "params": {
            "qrCode": null,
            "threeDsData": null
        },
        "type": "get"
    }
}

Create a wire transfer payment operation.

HTTP Request via SSL

POST '/api/v1/wire_transfers/payments'

Query Parameters

Parameter Mandatory Description
order_number yes 'The current order number from a company system. Must be unique. String(1-32)'
callback_url no 'The server URL a merchant will be notified about a wire transfer payout finalisation. URI-String'
redirect_success_url no After the payment completed, customer will be redirected into this Url. URI-String
redirect_fail_url no The URL a customer will be redirected to in the case of payment error or failure. URI-String
return_url no The URL to which the client will be redirected in case of waiting for the payment to be completed (not in the final status) or if the redirect_success_url and redirect_fail_url parameters are not passed. URI-String
ip no Customer IP address. String(IP format)
sending_reason no 'The wire transfer sending reason from a company system. String(1-256)'
note no 'The wire transfer note from a company system. String(1-256)'
description no 'The order number description from a company system. String(1-256)'
amount yes 'Wire transfer payout amount in cents (10020), except JPY. Integer(1-32)'
currency yes 'Currency code by ISO 4217. String(3)'
receiver no 'customer’s information'
sender no 'sender’s information'

Receiver Client Object Parameters

Parameter Mandatory Description
full_name no 'Receiver full name. Any valid name. String(1,256)'
country no 'Receiver country code. String(2) (ISO 3166)'
state no 'Receiver state. String(1,256)'
city no 'Receiver city. String(1,256)'
address no 'Receiver address. String(1,256)'
phone no 'Receiver phone number. Only digits. String(1,32)'
email no 'Receiver email. String(1,256)'
zip no 'Receiver ZIP/Postal code. Only letters, numbers, spaces and dashes. String(1-20)'
apartment no 'Receiver apartment. String(1,256)'
dob no 'Receiver dob. Format: DD-MM-YYYY. String'
beneficiary_type no 'Receiver beneficiary type. String(1,256)'

Receiver Bank Object Parameters

Parameter Mandatory Description
name no 'The bank name. String(1-256)'
iban no 'The bank iban. String(1-256)'
swift no 'The bank swift. String(1-256)'
country no 'Bank country code. String(2) (ISO 3166)'
city no 'Bank city. String(1,256)'
address no 'Bank address. String(1,256)'

Sender Object Parameters

Parameter Mandatory Description
full_name no 'Sender full name. Any valid name. String(1,256)'
country no 'Sender country code. String(2) (ISO 3166)'
city no 'Sender city. String(1,256)'
address no 'Sender address. String(1,256)'
phone no 'Sender phone number. Only digits. String(1,32)'
email no 'Sender email. String(1,256)'
zip no 'Sender ZIP/Postal code. Only letters, numbers, spaces and dashes. String(1-20)'
account_number no 'Sender account number from a company system. String(1-256)'
birthday no 'Sender birthday date. Format: DD-MM-YYYY. String'

Get Transfer

curl "https://business.sandbox.wirecapital.com/api/v1/wire_transfers/payments/[wire_transfer_token]" </span>
    -H "Authorization: Bearer merchant_private_key"

Return status 200 and JSON:

{
    "success": true | false,
    "errors": [],
    "status": 200,
    "wire_transfer": {
      "id": 2599,
      "status": "pending | approved | declined | expired",
      "token": "[wire_transfer token]",
      "currency": "[wire_transfer currency]",
      "callback_url": "[callback/notification url]",
      "redirect_success_url": "success redirection url",
      "redirect_fail_url": "fail redirection url",
      "amount": 0,
      "created_at": "[creation date]",
      "updated_at": "[last status update date]",
      "operation_type": "pay | payout",
      "order_number": "[merchant's order number]"
    }
}

WireTransfer Get - this is the method used to retrieve information about single wire transfer.

HTTP Request via SSL

GET '/api/v1/wire_transfers/payments/[wire_transfer_token]'

Wire transfer payouts

Transferring money from a business account to a client account.

Wire transfer payout

curl "https://business.sandbox.wirecapital.com/api/v1/wire_transfers/payouts" </span>
    -X POST </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json" -d '{
        "order_number": "your order number",
        "callback_url": "https://your-site.com/callback",
        "amount": 320,
        "currency": "USD",
        "sender": {
            "email": "semail@site.com"
        },
        "receiver": {
            "client": {
                "address": "9 Bright Street radcliffe",
                "city": "Manchester",
                "dob": "28-11-1994",
                "phone": "Receiver phone number",
                "email": "remail@site.com",
                "full_name": "Receiver full name",
                "country": "GB",
                "apartment": "Receiver apartment",
                "state": "Yorkshire",
                "zip": "Receiver zip",
                "beneficiary_type": "Receiver beneficiary type"
            },
            "bank": {
                "iban": "GB49HLFX11064300284303",
                "swift": "HLFXGB21R92",
                "address": "P O Box 722",
                "city": "Leeds",
                "country": "GB",
                "name": "STARLING BANK LIMITED"
            }
        }
    }'

Return status 200 and JSON:

{
  "success": true | false,
  "errors": [],
  "result": 0 | 1,
  "status": 200,
  "token": "[wire_transfer token]",
  "wire_transfer_payout": {
      "status": "init",
      "amount": 800,
      "currency": "USD"
  }
}

Create a wire transfer payout operation.

HTTP Request via SSL

POST '/api/v1/wire_transfers/payouts'

Query Parameters

Parameter Mandatory Description
order_number yes 'The current order number from a company system. Must be unique. String(1-32)'
callback_url no 'The server URL a merchant will be notified about a wire transfer payout finalisation. URI-String'
sending_reason no 'The wire transfer sending reason from a company system. String(1-256)'
note no 'The wire transfer note from a company system. String(1-256)'
description no 'The order number description from a company system. String(1-256)'
amount yes 'Wire transfer payout amount in cents (10020), except JPY. Integer(1-32)'
currency yes 'Currency code by ISO 4217. String(3)'
receiver no 'customer’s information'
sender no 'sender’s information'

Receiver Client Object Parameters

Parameter Mandatory Description
full_name no 'Receiver full name. Any valid name. String(1,256)'
country no 'Receiver country code. String(2) (ISO 3166)'
state no 'Receiver state. String(1,256)'
city no 'Receiver city. String(1,256)'
address no 'Receiver address. String(1,256)'
phone no 'Receiver phone number. Only digits. String(1,32)'
email no 'Receiver email. String(1,256)'
zip no 'Receiver ZIP/Postal code. Only letters, numbers, spaces and dashes. String(1-20)'
apartment no 'Receiver apartment. String(1,256)'
dob no 'Receiver dob. Format: DD-MM-YYYY. String'
beneficiary_type no 'Receiver beneficiary type. String(1,256)'

Receiver Bank Object Parameters

Parameter Mandatory Description
name no 'The bank name. String(1-256)'
iban yes 'The bank iban. String(1-256)'
swift yes 'The bank swift. String(1-256)'
country no 'Bank country code. String(2) (ISO 3166)'
city no 'Bank city. String(1,256)'
address no 'Bank address. String(1,256)'

Sender Object Parameters

Parameter Mandatory Description
full_name no 'Sender full name. Any valid name. String(1,256)'
country no 'Sender country code. String(2) (ISO 3166)'
city no 'Sender city. String(1,256)'
address no 'Sender address. String(1,256)'
phone no 'Sender phone number. Only digits. String(1,32)'
email no 'Sender email. String(1,256)'
zip no 'Sender ZIP/Postal code. Only letters, numbers, spaces and dashes. String(1-20)'
account_number no 'Sender account number from a company system. String(1-256)'
birthday no 'Sender birthday date. Format: DD-MM-YYYY. String'

Balance

Request a current balance.

Receive Balance

curl "https://business.sandbox.wirecapital.com/api/v1/balance?currency=CNY" </span>
    -X GET </span>
    -H "Authorization: Bearer merchant_private_key" </span>
    -H "Content-Type: application/json"
<?php

$curl = curl_init();

curl_setopt_array($curl, array( CURLOPT_URL => "https://business.sandbox.wirecapital.com/api/v1/balance?currency=CNY", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "authorization: Bearer merchant_private_key", "content-type: application/json" ), ));

$response = curl_exec($curl); $err = curl_error($curl);

curl_close($curl);

if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseNotFound
from django.views.decorators.csrf import csrf_exempt
import requests
import json

def balance(request) :

MERCHANT_PRIVATE_KEY = "merchant_private_key" LIVE_URL = 'https://business.wirecapital.com'; SANDBOX_URL = "https://business.sandbox.wirecapital.com"

headers = { "Content-Type": "application/json", "Authorization": "Bearer %s" % (MERCHANT_PRIVATE_KEY) } resp = requests.get("%s/api/v1/balance" % (SANDBOX_URL), params = {"currency":"CNY"}, headers=headers)

if resp.success: resp_o = json.loads(resp.text) return HttpResponse("<html><body><span>Your balance %s</body></html>" % (resp_o["wallet"]["available"])) else: return HttpResponse("<html><body><span>Something gone wrong: %s</span> : %s</body></html>" % (resp.status_code, resp.text))

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder() .url("https://business.sandbox.wirecapital.com/api/v1/balance?currency=CNY") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer merchant_private_key") .build();

Response response = client.newCall(request).execute();

Return status 200 and JSON:

{
  "success": true | false,
  "errors": [],
  "payout_balance": 12345
  }
}

Receiving the balance for a business account. Balance is returned as an object displaying available and pending amounts. Balances shown may be not be released and/or processed.

HTTP Request via SSL

GET '/api/v1/balance'

Payment notifications

Notifications with the payment or payout status is sent to your callback URL using POST methods. In case of payment status changed (pending/approved/declined) - notifications will be sent accordingly.

from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseNotFound

@csrf_exempt def notifyme(request) : req_o = json.loads(request.read()); return HttpResponse('Status is:%s' % (req_o['status']))

Params:

{
  "token": "913a072e2fc9ca6e7d8d9637cd577cc3",
  "type": "payment",
  "status": "approved",
  "extraReturnParam": "Demo+shop",
  "orderNumber": "6C50IVG2LE",
  "amount": "2900",
  "currency": "USD",
  "gatewayAmount": "2900",
  "gatewayCurrency": "USD",
  "threeDSStatus": "Y",
  "sanitizedMask": "400000***0002",
  "countryISOByIp": "AZE",
  "bankCountryISO": "AZE",
  "bankCountryName": "AZERBAIJAN",
  "bankName": "EXPRESSBANK+OSC",
  "approvalCode": "186983",
  "transactionTime": "2019-08-08+12%3A13%3A10+UTC",
  "availableForRefundAmount": "2900",
  "availableForRefindCurrency": "USD",
  "card_token": "NTExNTY2*****",
  "signature": "86e25d1696d35da5e2b03f98b67ccfbd"
}

Query Parameters for payment notifications

Parameter Description
token Payment token
type Payment type (pay)
status Payment status (approved, declined, expired,pending, refunded)
extraReturnParam Extra return param from Payment init request
orderNumber Order number from Payment init request
amount Amount from Payment init request
currency Currency from Payment init request
gatewayAmount Gateway amount in cents
gatewayCurrency Gateway currency in ISO
threeDSStatus Status of 3DSec
sanitizedMask Mask of payer's bank card
countryISOByIp Payer's country name in ISO
bankCountryISO Payer's bank country name in ISO
bankCountryName Payer's bank country name
bankName Payer's bank name
approvalCode Transaction approval code
availableForRefundAmount Amount available for refund
availableForRefindCurrency Currency of available for refund amount
card_token card_token String Base64 encoded (Only for card token payments)
signature Signature

Refund notifications

Notifications with refund status will be sent to your callback URL using POST methods.

from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseNotFound

@csrf_exempt def notifyme(request) : req_o = json.loads(request.read()); return HttpResponse('Status is:%s' % (req_o['status']))

Params:

{
  "token": "913a072e2fc9ca6e7d8d9637cd577cc3",
  "type": "refund",
  "status": "approved",
  "extraReturnParam": "Demo+shop",
  "orderNumber": "6C50IVG2LE",
  "amount": "2900",
  "currency": "USD",
  "gatewayAmount": "2900",
  "gatewayCurrency": "USD",
  "threeDSStatus": null,
  "sanitizedMask": "400000******0002",
  "countryISOByIp": null,
  "bankCountryISO": null,
  "bankCountryName": null,
  "bankName": null,
  "approvalCode": null,
  "transactionTime": "2019-08-08+12%3A13%3A10+UTC",
  "payment_token": "913a072e2fc9ca6e7d8d9637cd577cc3",
  "signature": "86e25d1696d35da5e2b03f98b67ccfbd"
}

Query Parameters for refund notifications

Parameter Description
token Refund token
type Payment type (refund)
status Payment status (approved, declined)
extraReturnParam Extra return param from Payment init request
orderNumber Order number from Payment init request
amount Refund amount
currency Currency of refund amount
gatewayAmount Gateway amount in cents
gatewayCurrency Gateway currency in ISO
threeDSStatus null
sanitizedMask Mask of payer's bank card
countryISOByIp null
bankCountryISO null
bankCountryName null
bankName null
approvalCode null
payment_token Payment token from original payment transaction
signature Signature

Wire transfer notifications

Notifications with the wire transfer status is sent to your callback URL using POST methods. In case of wire transfer status changed (canceled/approved/declined) - notifications will be sent accordingly.

from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseNotFound

@csrf_exempt def notifyme(request) : req_o = json.loads(request.read()); return HttpResponse('Status is:%s' % (req_o['status']))

Params:

{
  "token": "30e8ed956d920895dbe05259bb2b2779",
  "type": "wire_transfer_payment",
  "status": "approved",
  "order_number": "6C50IVG2LE",
  "amount": 800,
  "currency": "USD",
  "bank_name": "STARLING BANK LIMITED",
  "iban": "GB49HLFX11064300284303",
  "swift": "HLFXGB21R92",
  "receiver_full_name": "R FIRSTNAME LASTNAME",
  "transaction_time": "2022-06-27 04:51:37 UTC",
  "signature": "bea790a9ed4a988f045466ce4e213f7f"
}

Query Parameters for wire transfer notifications

Parameter Description
token Wire transfer notification token
type Wire transfer type (wire_transfer_payment, wire_transfer_payout)
status Wire transfer status (pending, approved/declined)
order_number Order number from wire transfer init request
amount Amount from wire transfer init request
currency Currency from wire transfer init request
bank_name Receiver's bank name
iban Bank iban
swift Bank swift
receiver_full_name Receiver's full name
transaction_time Wire transfer transaction time
signature Signature

Signature calculation

1) For signature calculation you need to take values from params in this order: token, type, status, extraReturnParam, orderNumber, amount, currency, gatewayAmount, gatewayCurrency, threeDSStatus, sanitizedMask, countryISOByIp, bankCountryISO

{ "token": "913a072e2fc9ca6e7d8d9637cd577cc3", "type": "payment", "status": "approved", "extraReturnParam": "Demo+shop", "orderNumber": "6C50IVG2LE", "amount": "2900", "currency": "USD", "gatewayAmount": "2900", "gatewayCurrency": "USD", "threeDSStatus": "Y", "sanitizedMask": "400000******0002", "countryISOByIp": "AZE", "bankCountryISO": "AZE" }

2) Then you need to calculate the size of each value and put it before the value. For example: if token: '913a072e2fc9ca6e7d8d9637cd577cc3', after this step you will have token : '32913a072e2fc9ca6e7d8d9637cd577cc3' and etc.

{ "token": "32913a072e2fc9ca6e7d8d9637cd577cc3", "type": "7payment", "status": "8approved", "extraReturnParam": "9Demo+shop", "orderNumber": "106C50IVG2LE", "amount": "42900", "currency": "3USD", "gatewayAmount": "42900", "gatewayCurrency": "3USD", "threeDSStatus": "1Y", "sanitizedMask": "16400000******0002", "countryISOByIp": "3AZE", "bankCountryISO": "3AZE" }

3) You have to join all these parameters to string except blank values:

32913a072e2fc9ca6e7d8d9637cd577cc37payment8approved9Demo+shop106C50IVG2LE429003USD429003USD1Y16400000******00023AZE3AZE

4) Next join to the end of string merchant private key:

32913a072e2fc9ca6e7d8d9637cd577cc37payment8approved9Demo+shop106C50IVG2LE429003USD429003USD1Y16400000******00023AZE3AZEmerchant_privat_key

5) Finally you need to calculate message digests using the MD5 Message-Digest Algorithm by RSA Data Security, Inc., described in RFC1321:

9e8088d38e96adcc1a185c202938ec24

Wire transfer signature calculation

1) For wire transfer signature calculation you need to take values from params in this order: token, status, order_number, amount, currency, gateway_amount, gateway_currency

{ "token": "e39a35fa618890bcdee0209a7f48a6f0", "type": "wire_transfer_payment", "status": "approved", "order_number": "61334321311098", "amount": 4000, "currency": "USD", "bank_name": "STARLING BANK LIMITED", "iban": "GB49HLFX11064300284303", "swift": "HLFXGB21R92", "receiver_full_name": "R FIRSTNAME LASTNAME", "transaction_time": "2022-07-19 12:46:25 UTC" }

2) Then you need to calculate the size of each value and put it before the value. For example: if token: '913a072e2fc9ca6e7d8d9637cd577cc3', after this step you will have token : '32913a072e2fc9ca6e7d8d9637cd577cc3' and etc.

{ "token": "32e39a35fa618890bcdee0209a7f48a6f0", "type": "21wire_transfer_payment", "status": "8approved", "order_number": "1461334321311098", "amount": "44000", "currency": "3USD", "bank_name": "21STARLING BANK LIMITED", "iban": "22GB49HLFX11064300284303", "swift": "11HLFXGB21R92", "receiver_full_name": "20R FIRSTNAME LASTNAME", "transaction_time": "232022-07-19 12:46:25 UTC" }

3) You have to join all these parameters to string except blank values:

32e39a35fa618890bcdee0209a7f48a6f08canceled1461334321311098440003USD21STARLING BANK LIMITED22GB49HLFX1106430028430311HLFXGB21R9220R FIRSTNAME LASTNAME232022-07-19 12:46:25 UTC498e4ac444e74008f746

4) Next join to the end of string merchant private key:

32e39a35fa618890bcdee0209a7f48a6f08canceled1461334321311098440003USD21STARLING BANK LIMITED22GB49HLFX1106430028430311HLFXGB21R9220R FIRSTNAME LASTNAME232022-07-19 12:46:25 UTC498e4ac444e74008f746merchant_privat_key

5) Finally you need to calculate message digests using the MD5 Message-Digest Algorithm by RSA Data Security, Inc., described in RFC1321:

989cef13f9f3493af406fa4d004fa463

Dictionaries

Payment states

State Final Description
init no Request to API will initiate payments.
starting no Check payment params.
pending no User redirected to the Checkout facility during payment processing period.
hold no Successfully made authorisation payment.
partial_approved yes Successfully completed authorisation payment. Partial amount.
approved yes Successfully completed payment.
declined yes Unsuccessful payment.
voided yes Successfully canceled authorisation payment.
expired yes Payment declined due timeout (default 20 minutes)

Error types

Type Description
api_error Indicate rare occasions such as an API server technicality.
authentication_error Authentication request failure.
invalid_request_error Invalid parameters which produce invalid requests.
processing_error Processing the payment generated an error.

Error codes

Code Description
incorrect_private_key Private key is incorrect.
incorrect_address_info Absent or incorrect address information.
incorrect_bank_card_info Absent or incorrect bank card information.
order_number_already_exists Order number is not unique.
amount_less_than_balance Payout cannot be completed due to insufficient funds.
incorrect_amount Absent or incorrect amount value.
incorrect_currency Absent or incorrect currency value.
incorrect_order_number Absent or incorrect order number.
amount_less_than_minimum Payout amount is below the limit.