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: Sandbox or Production . 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",
        "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\", \"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'],
        "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("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
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)
card no Card object for Host2Host payments.

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 code. Only digits. String(1-10)
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)

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 from payment init params.

Query Parameters

Parameter Description
token Payment token
type Payment type (pay, refund)
status Payment status (approved, declined, pending)
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

Refunds

Refunds processing REST API.

Create

curl "https://business.sandbox.wirecapital.com/api/v1/refunds" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -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.

Make a payout

curl "https://business.sandbox.wirecapital.com/api/v1/payouts" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "amount" : 1000,
        "currency" : "USD",
        "orderNumber": "10001",
        "product": "Payout",
        "callbackUrl": "https://callback.url/payout",
        "bankAccount": {
            "pan": "4221345678986754",
            "expires": "09/2021",
            "firstName": "card",
            "lastName": "holder",
            "phone": "79111234567",
            "email": "test@email.com"
        },
        "billing": {
            "state": "PA",
            "country": "RU",
            "city": "Tula",
            "zip": "123456",
            "street": "Lenins st. 134-2-55",
            "phone": "79111234567"
        }
    }'

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
billing no customer’s billing address information

BankAccount Object Parameters

Parameter Mandatory Description
pan yes Customer’s card number (PAN). Any valid card number, may contain spaces. String(13-19)
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 yes Cardholder phone number. Only digits. String(1,32)
email no Cardholder email. 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)

Balance

Request a current balance.

Receive Balance

curl "https://business.sandbox.wirecapital.com/api/v1/balance?currency=CNY" \
    -X GET \
    -H "Authorization: Bearer merchant_private_key" \
    -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.sandbox.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": [],
  "wallet": {
    "available": 0,
    "hold": 0,
    "currency": "CNY"
  }
}

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'

Query Parameters

Parameter Description
currency Currency code.

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",
  "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
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

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

Dictionaries

Payment states

State Final Description
init no Request to API will initiate payments.
pending no User redirected to the Checkout facility during payment processing period.
approved yes Successfully completed payment.
declined yes Unsuccessful 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.