NAV Navbar
cURL Python PHP Java
Need help?
Contact us

Introduction

ReactivePay 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.

ReactivePay 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, expiry date and CVV2/CVC2 with these PANs. 3-D Secure is also emulated with a page that doesn’t require any password but only shows you 2 buttons. One button is for successful authentication, another is for failed authentication. Note, that when you chose to fail authentication, order is always declined, no matter what PAN was used.

Production Environment

Once you complete integration with Sandbox environment you will be provided with Production credentials. These are completely different credentials, not related with the ones on Sandbox. Production always makes real bank transactions, cards from Sandbox are not supported on this environment.

Authentication

curl https://business.reactivepay.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.reactivepay.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

ReactivePay payment processing REST API.

Create

Code: Copy

curl "https://business.reactivepay.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",
        "pendingUrl" : "https://your-site.com/pending",`
        "expires_at": 5,
        "orderNumber" : "your order number",
        "locale": "zh"

    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.reactivepay.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.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.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", "ReactivePay 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.reactivepay.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: Copy

{
  "success": true | false,
  "errors": [],
  "token": "[payment token]",
  "processingUrl": "https://business.reactivepay.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.reactivepay.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 Validation
product yes Product name (Service description) (example: 'iPhone'). minLength: 5, maxLength: 255
amount yes Payment amount in cents (10020), except JPY minLength: 1, maxLength: 32
currency yes Currency code (CNY, EUR, USD, JPY). minLength: 3, maxLength: 3
callbackUrl yes The server URL a merchant will be notified about a payment finalisation Valid URI format
redirectSuccessUrl no The URL a customer will be redirected to in the case of successfull payment Valid URI format
redirectFailUrl no The URL a customer will be redirected to in the case of payment error or failure Valid URI format
pendingUrl no The URL a customer will be redirected to the specific page in the case of pending payment instead built-in checkout_resault_page Valid URI format
extraReturnParam no Bank/Payment method list, description, etc minLength: 1, maxLength: 1024
expires_at no Expired payment time for requests without a bank card minLength: 1
orderNumber no The current order number from a company system. minLength: 3, maxLength: 255 (string)
locale no The locale is used on a payment page by default. Currently supported locales: en, zh and jp from ISO 639-1. minLength: 2, maxLength: 5 (string)
walletToken no Set this parameter when making recurring payment from a customer’s wallet. A customer will receive notification and has to confirm the payment. returns by API for recurring payments only
recurring no Set this parameter to true when initializing recurring payment. boolean
recurringToken no Set this parameter when making recurring payment previously initialized with recurring param. returns by API for recurring payments only
needConfirmation no Set this parameter whe making payment in two steps (preAuth and confirm/decline)
card no Card object for Host2Host payments.
customer no Customer object for Host2Host payments.
recurring_data no Recurring data object for Host2Host payments.
merchantUrl no Param to control traffic from aggregators

Card Object Parameters

Parameter Mandatory Description Validation
pan yes Customer’s card number (PAN). Any valid card number, may contain spaces Valid card number (16-19 digits)
expires yes Customer’s card expiration date. Format: mm/yyyy mm/yyyy format
holder yes Customer’s cardholder name. Any valid cardholder name minLength: 5, maxLength: 50
cvv yes Customer’s CVV2 / CVC2 / CAV2 minLength: 3, maxLength: 3 Only digits (\d+)

Customer Object Parameters (optional)

Parameter Mandatory Description Validation
email yes Customer’s email, is mandatory if Customer object posted on a request Valid email format
address no Customer's billing address minLength: 5, maxLength: 55
country no Customer's billing country ISO country code format "GB"
city no Customer's billing city minLength: 4, maxLength: 55
region no Customer's billing region minLength: 5, maxLength: 55
postcode no Customer's billing ZipCode minLength: 4, maxLength: 55
phone no Customer's billing phone number minLength: 6, maxLength: 20
ip no Customer IP address Valid IP address format (XX.XX.XX.XX)
browser no Customer browser object for 3ds2 payments.

Customer browser object for 3ds2 payments (optional)

Parameter Mandatory Description Example
accept_header no Browser's content type text/html
color_depth no Browser's color depth value 32
ip no Browser's ip 177.255.255.35
language no Browser's language ru
screen_height no Browser's screen height 1080
screen_width no Browser's screen width 1920
tz no Browser's time zone 180
user_agent no Browser's user agent Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0
java_enabled no Is java enabled true
javascript_enabled no Is javascript enabled true
window_width no Browser's window width 1920
window_height no Browser's bilwindowling height 1080

Recurring data object for payments (optional)

Parameter Mandatory Description Validation
days no Customer days object for payments. Number of days between authorizations from 1
exp_date no Customer exd_date object for payments. Period of validity of periodic payments in format YYYYMMDD

Payments Providers

Code: Copy

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

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

params.put("product", "ReactivePay 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.reactivepay.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: Copy

{
  "success": true | false,
  "errors": [],
  "token": "[payment token]",
  "processingUrl": [
        {
            "webmoney": "http://business.reactivepay.com/p/165998589a413b56ae72fbfdc15b016b/webmoney?locale=en"
        },
        {
            "bank_card": "http://business.reactivepay.com/p/165998589a413b56ae72fbfdc15b016b/bank_card?locale=en"
        },
        {
            "qiwi_wallet": "http://business.reactivepay.com/p/165998589a413b56ae72fbfdc15b016b/qiwi_wallet?locale=en"
        },
        {
            "skrill_wallet": "http://business.reactivepay.com/p/165998589a413b56ae72fbfdc15b016b/skrill_wallet?locale=en"
        }
  ],
  "selectorURL": "https://business.reactivepay.com/select/[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.reactivepay.com/checkout_results/[payment token]/callback_3ds"
    },
    "type": "post"
  }
}

In case multiple payment providers enabled to a merchant account, Create payment reponse JSON will have processingUrl object represented as an array of available payment providers (please refer to JSON response). Use those URLs to redirect your customer to a payment provider (method).

List of payment providers

In case you want a customer to choose a payment provider (method) it might be convenient to use a specific page (widget) with payment provider list, which is availabe by "selectorURL" parameter in JSON response object

List

Code: Copy

curl "https://business.reactivepay.com/api/v1/payments?dateFrom=2016-05-11&page=1&perPage=1" \
    -H "Authorization: Bearer merchant_private_key"
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.reactivepay.com/api/v1/payments?dateFrom=2016-05-11&page=1&perPage=1",
  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"
  ),
));

$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.reactivepay.com/api/v1/payments")
  .get()
  .addHeader("authorization", "Bearer merchant_private_key")
  .build();

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

Return status 200 and JSON: Copy

{
  "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 Description Required
dateFrom Date from (example: '2015-01-01') No
dateTo Date to (example: '2015-01-02') No
page Page number (default: 1) No
perPage Payment per page (max: 500, default: 20) No
operationType Operation type (Available values: pays, payouts, all) No
orderNumber Merchant's order number No

Get

Code: Copy

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

Return status 200 and JSON: Copy

{
    "success": true | false,
    "errors": [],
    "status": 200,
    "payment": {
      "id": 2599,
      "status": "pending | approved | declined",
      "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]",
      "commission_data": {
                  "commission_value": 0.0,
                  "commission_fee": 0.0,
                  "commission_amount": 0.0
              }
    }
}

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

HTTP Request via SSL

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

Confirm Two-Step

Code: Copy

curl "https://business.reactivepay.com/api/v1/payments/confirm" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "token" : "Your Product"
    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.reactivepay.com/api/v1/payments/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 => "{ \"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.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.com'

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

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

    resp = requests.post('%s/api/v1/payments/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("token", "payment token");
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
       .url("https://business.reactivepay.com/api/v1/payments/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: Copy

{
  "success": true | false,
  "result": 0,
  "status": 200,
  "payment": {
    "amount": 100,
    "gateway_amount": 100,
    "currency": "USD",
    "status": "approved|declined",
    "two_stage_mode": true
  }
}

Confirm Two-Step payment by providing a payment token.

HTTP Request via SSL

POST '/api/v1/payments/confirm'

Query Parameters

Parameter Mandatory Description
token yes Payment token.

Decline Two-Step

Code: Copy

curl "https://business.reactivepay.com/api/v1/payments/decline" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "token" : "Your Product"
    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.reactivepay.com/api/v1/payments/decline",
  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.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.com'

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

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

    resp = requests.post('%s/api/v1/payments/decline' % (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.reactivepay.com/api/v1/payments/decline")
       .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: Copy

{
  "success": true | false,
  "result": 0,
  "status": 200,
  "payment": {
    "amount": 100,
    "gateway_amount": 100,
    "currency": "USD",
    "status": "approved|declined",
    "two_stage_mode": true
  }
}

Decline Two-Step payment by providing a payment token.

HTTP Request via SSL

POST '/api/v1/payments/decline'

Query Parameters

Parameter Mandatory Description
token yes Payment token.

Get/Order

Code: Copy

curl "https://business.reactivepay.com/api/v1/payments/order/[order_number]" \
    -H "Authorization: Bearer merchant_private_key"

Return status 200 and JSON: Copy

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

Payment Get/Order - this is the method used to retrieve information about payments by order_number.

HTTP Request via SSL

GET '/api/v1/payments/order/[order_number]'

Otp

Code: Copy

curl "https://business.reactivepay.com/api/v1/otp" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "token" : "YP741BPPRuDYSAPJG6ErFyoofWYReZWA",
        "otp" : "443443",
    }'

Return status 200 and JSON: Copy

{
    "success": true | false,
    "errors": [],
    "status": 200
}

Otp - this is the method used to confirm mobile payment.

HTTP Request via SSL

POST '/api/v1/otp'

Query Parameters

Parameter Mandatory Description Validation
token yes Payment token
otp yes Otp code

Otp resend

Code: Copy

curl "https://business.reactivepay.com/api/v1/otp-resend?token=YP741BPPRuDYSAPJG6ErFyoofWYReZWA" \
    -H "Authorization: Bearer merchant_private_key"

Return status 200 and JSON: Copy

{
    "success": true | false,
    "errors": [],
    "status": 200
}

Otp resend - this is the method used to resend the OTP code.

HTTP Request via SSL

GET '/api/v1/otp-resend'

Refunds

ReactivePay refunds processing REST API.

Create refund

Code: Copy

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

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.reactivepay.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.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.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.reactivepay.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: Copy

{
  "success": true | false,
  "errors": [],
  "token": "[payment token]",
  "processingUrl": "https://business.reactivepay.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.
amount no Refund amount in cents.

Payouts

Transferring money from a business account to a client account.

Make a payout

Code: Copy

curl "https://business.reactivepay.com/api/v1/payouts" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "amount" : 1000,
        "currency" : "CNY",
        "orderNumber": "10001",
        "extraReturnParam" : "test payout",

        "card": {
            "pan" : "4276111152393643",
            "expires" : "08/2022"
        },

        "customer": {
            "first_name" : "Mike",
            "last_name" : "Green",
            "email" : "test@reactivepay.com",
            "address" : "725 5th Ave, New York, NY 10022, United States",
            "ip" : "1.1.1.1"
        }
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.reactivepay.com/api/v1/payouts",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{ \"amount\" : 1000, \"currency\" : \"CNY\", \"orderNumber\" : \"10001\", \"extraReturnParam\" : \"test payout\", \"card\": { \"pan\" : \"4276111152393643\", \"expires\" : \"08/2022\" }, \"customer\": { \"email\" : \"test@reactivepay.com\", \"first_name\" : \"Mike\", \"last_name\" : \"Green\", \"address\" : \"test test\", \"ip\" : \"1.1.1.1\"}"\n}",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer edf526c5374796cdcec5dce731405cee",
    "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 payout(request) :

    MERCHANT_PRIVATE_KEY = 'your-merchant-private-key'
    LIVE_URL = 'https://business.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.com'

    payload = {
        "amount" : 10000,
        "currency" : "EUR",
        "orderNumber": "10001",
        "card": {
            "pan" : "4276111152393643",
            "expires" : "08/2022"
        },

        "customer": {
            "first_name" : "Mike",
            "last_name" : "Green",
            "email" : "test@reactivepay.com",
            "address" : "test test",
            "ip" : "1.1.1.1"
        }
    }

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

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

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

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

params.put("amount", 1000);
params.put("currency", "EUR");
params.put("orderNumber", "[merchat system order number]");

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
       .url("https://business.reactivepay.com/api/v1/payouts")
       .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: Copy

{
  "success": true | false,
  "errors": [],
  "payout": {
      "token": "[payment token]",
      "status": "[payment status]",
      "timestamp": "2016-06-09T03:46:45Z"
  }
}

Create a payout operation.

HTTP Request via SSL

POST '/api/v1/payouts'

Query Parameters

Parameter Mandatory Description
amount yes Payment amount in minimal values as of; USD and EUR / Cents, for JPY / Yen, for CNY / Fen.
currency yes Currency code (CNY, EUR, USD, JPY)
orderNumber yes ReactivePay's client inner order number
card yes Card object for Host2Host payouts.
customer yes Customer object for Host2Host payouts.

Card Payout Object Parameters

Parameter Mandatory Description
pan yes Customer’s card number (PAN). Any valid card number, may contain spaces
expires yes Customer’s card expiration date. Format: mm/yyyy

Customer Object Parameters (optional)

Parameter Mandatory Description
email yes Customer’s email, is mandatory if Customer object posted on a request
address no Customer's billing address in the full format like "725 5th Ave, New York, NY 10022, United States"
ip yes Customer IP address
first_name no Customer name
last_name no Customer surname

Providers

Code: Copy

curl "https://business.reactivepay.com/api/v1/payouts" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "amount" : 1000,
        "currency" : "CNY",
        "orderNumber": "10001",
        "extraReturnParam" : "test payout",

        "card": {
            "pan" : "4276111152393643",
            "expires" : "08/2022"
        },

        "customer": {
            "email" : "test@reactivepay.com",
            "address" : "test test",
            "ip" : "1.1.1.1",
            "first_name" : "Mike",
            "last_name" : "Green",
        }
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.reactivepay.com/api/v1/payouts",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{ \"amount\" : 1000, \"currency\" : \"CNY\", \"orderNumber\" : \"10001\", \"extraReturnParam\" : \"test payout\", \"card\": { \"pan\" : \"4276111152393643\", \"expires\" : \"08/2022\" }, \"customer\": { \"email\" : \"test@reactivepay.com\", \"address\" : \"test test\", \"first_name\" : \"Mike\", \"last_name\" : \"Green\", \"ip\" : \"1.1.1.1\"}"\n}",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer edf526c5374796cdcec5dce731405cee",
    "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 payout(request) :

    MERCHANT_PRIVATE_KEY = 'your-merchant-private-key'
    LIVE_URL = 'https://business.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.com'

    payload = {
        "amount" : 10000,
        "currency" : "EUR",
        "orderNumber": "10001",
        "card": {
            "pan" : "4276111152393643",
            "expires" : "08/2022"
        },

        "customer": {
            "first_name" : "Mike",
            "last_name" : "Green",
            "email" : "test@reactivepay.com",
            "address" : "test test",
            "ip" : "1.1.1.1"
        }
    }

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

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

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

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

params.put("amount", 1000);
params.put("currency", "EUR");
params.put("orderNumber", "[merchat system order number]");

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
       .url("https://business.reactivepay.com/api/v1/payouts")
       .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: Copy

{
  "success": true | false,
  "errors": [],
  "token": "[payment token]",
  "processingUrl": [
        {
            "webmoney": "http://business.reactivepay.com/pout/165998589a413b56ae72fbfdc15b016b/webmoney?locale=en"
        },
        {
            "bank_card": "http://business.reactivepay.com/pout/165998589a413b56ae72fbfdc15b016b/bank_card?locale=en"
        },
        {
            "qiwi_wallet": "http://business.reactivepay.com/pout/165998589a413b56ae72fbfdc15b016b/qiwi_wallet?locale=en"
        },
        {
            "skrill_wallet": "http://business.reactivepay.com/pout/165998589a413b56ae72fbfdc15b016b/skrill_wallet?locale=en"
        }
  ],
  "selectorURL": "https://business.reactivepay.com/select/pout/[payment token]/",
  "payment": {
    "amount": "10020",
    "currency": "CNY",
    "status": "init"
  }
}

In case multiple payout providers enabled to a merchant account, Create payout reponse JSON will have processingUrl object represented as an array of available payout providers (please refer to JSON response). Use those URLs to redirect your customer to a payout provider (method).

List of payout providers

In case you want a customer to choose a payout provider (method) it might be convenient to use a specific page (widget) with payout provider list, which is availabe by "selectorURL" parameter in JSON response object

P2P

ReactivePay p2p payment processing REST API.

Payment

Code: Copy

curl "https://business.reactivepay.com/api/v1/payments" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
      "product": "Tests",
      "amount": 100300,
      "currency": "RUB",
      "callbackUrl": "https://test.com",
      "redirectSuccessUrl": "https://success.test.com/",
      "redirectFailUrl": "https://declined.test.com/",
      "pendingUrl": "https://pending.test.com/",
      "bank_account": {
          "bank_name": "sber",
          "requisite_type": "sbp/card/account/link"
      },
      "customer": {
          "email": "test@test.com",
          "ip": "178.175.50.34"
      }
    }'
<?php

$curl = curl_init();

$data = [
    "product" => "Tests",
    "amount" => 100300,
    "currency" => "RUB",
    "callbackUrl" => "https://test.com",
    "redirectSuccessUrl" => "https://success.test.com/",
    "redirectFailUrl" => "https://declined.test.com/",
    "bank_account" => [
        "bank_name" => "sber",
        "requisite_type" => "sbp/card/account/link"
    ],
    "customer" => [
        "email" => "test@test.com",
        "ip" => "178.175.50.34"
    ]
];

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://business.reactivepay.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 => json_encode($data),
    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.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.com'

    payload = {
      "product": "Tests",
      "amount": 100300,
      "currency": "RUB",
      "callbackUrl": "https://test.com",
      "redirectSuccessUrl": "https://success.test.com/",
      "redirectFailUrl": "https://declined.test.com/",
      "bank_account": {
          "bank_name": "sber",
          "requisite_type": "sbp/card/account/link"
      },
      "customer": {
          "email": "test@test.com",
          "ip": "178.175.50.34"
      }
    }

    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))
import com.google.gson.Gson;
import okhttp3.*;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class Main {

    public static void main(String[] args) {
        MediaType JSON = MediaType.parse("application/json; charset=utf-8");

        Map<String, Object> params = new HashMap<>();
        params.put("product", "Tests");
        params.put("amount", 100300);
        params.put("currency", "RUB");
        params.put("callbackUrl", "https://test.com");
        params.put("redirectSuccessUrl", "https://success.test.com/");
        params.put("redirectFailUrl", "https://declined.test.com/");

        Map<String, String> bankAccount = new HashMap<>();
        bankAccount.put("bank_name", "sber");
        bankAccount.put("requisite_type", "sbp/card/account/link");
        params.put("bank_account", bankAccount);

        Map<String, String> customer = new HashMap<>();
        customer.put("email", "test@test.com");
        customer.put("ip", "178.175.50.34");
        params.put("customer", customer);

        OkHttpClient client = new OkHttpClient();

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

        client.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(Call call, IOException e)
;

Return status 200 and JSON: Copy

{
    "success": true,
    "result": 0,
    "status": 200,
    "token": "K9doc43HAPnqSuGdvN5RMX42tE54331",
    "processingUrl": [
        {
            "trader": "https://business.reactivepay.com/p/K9doc43HAPnqSuGdvN5RMX42tE54331?..."
        }
    ],
    "selectorUrl": "https://business.reactivepay.com/select/K9doc43HAPnqSuGdvN5RMX42tE54331?...",
    "payment": {
        "amount": 1000,
        "gateway_amount": 1000,
        "currency": "RUB",
        "status": "init",
        "two_stage_mode": false,
        "commission": 0
    }
}

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. Use redirect/GET to processingUrl after request.

HTTP Request via SSL

POST '/api/v1/payments'

Query Parameters

Parameter Mandatory Description Validation
product yes Product name (Service description) (example: 'iPhone'). minLength: 5, maxLength: 255
amount yes Payment amount in cents (10020), except JPY minLength: 1, maxLength: 32
currency yes Currency code (CNY, EUR, USD, JPY). minLength: 3, maxLength: 3
callbackUrl yes The server URL a merchant will be notified about a payment finalisation Valid URI format
redirectSuccessUrl no The URL a customer will be redirected to in the case of successfull payment Valid URI format
redirectFailUrl no The URL a customer will be redirected to in the case of payment error or failure Valid URI format
extraReturnParam no Bank/Payment method list, description, etc minLength: 1, maxLength: 1024
orderNumber no The current order number from a company system. minLength: 3, maxLength: 255 (string)
locale no The locale is used on a payment page by default. Currently supported locales: en, zh and jp from ISO 639-1. minLength: 2, maxLength: 5 (string)
bank_account no Bank details object for p2p payments.
customer yes Customer object for Host2Host payments.

Bank account Payment Object Parameters

Parameter Mandatory Description
bank_name no Customer bank name: sberbank/tbank/raiffeisen/uralsib/alfabank/sovcombank/humo/uzcard
requisite_type no Requisite type for payment: sbp/card/account/link

Customer Object Parameters (optional)

Parameter Mandatory Description Validation
email yes Customer’s email, is mandatory if Customer object posted on a request Valid email format
ip no Customer IP address Valid IP address format (XX.XX.XX.XX)

Payout Card

Code: Copy

curl "https://business.reactivepay.com/api/v1/payouts" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "amount" : 1000,
        "currency" : "RUB",
        "orderNumber": "10001",
        "callbackUrl": "https://test.com",
        "bank_account": {
            "bank_name": "sber",
            "requisite_type": "card"
        },
        "card": {
            "pan": "4627342642639018"
        },
        "customer": {
            "email": "test@test.com",
            "ip": "178.175.20.33",
            "first_name": "Иванов",
            "last_name": "Иван",
            "middle_name": "Иванович",
            "phone": "79998889900"
        }
    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.reactivepay.com/api/v1/payouts",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{ \"amount\" : 1000, \"currency\" : \"RUB\", \"orderNumber\" : \"10001\", \"extraReturnParam\" : \"test payout\", \"bank_account\": { \"bank_name\" : \"sber\", \"requisite_type\" : \"card\" }, \"card\": { \"pan\" : \"4276111152393643\" }, \"customer\": { \"email\" : \"test@reactivepay.com\", \"address\" : \"test test\", \"ip\" : \"1.1.1.1\"}"\n}",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer edf526c5374796cdcec5dce731405cee",
    "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 payout(request) :

    MERCHANT_PRIVATE_KEY = 'your-merchant-private-key'
    LIVE_URL = 'https://business.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.com'

    payload = {
        "amount" : 1000,
        "currency" : "RUB",
        "orderNumber": "10001",
        "callbackUrl": "https://test.com",
        "bank_account": {
            "bank_name": "sber",
            "requisite_type": "card"
        },
        "card": {
            "pan": "4627342642639018"
        },
        "customer": {
            "email": "test@test.com",
            "ip": "178.175.20.33",
            "first_name": "Иванов",
            "last_name": "Иван",
            "middle_name": "Иванович",
            "phone": "79998889900"
        }
    }

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

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

    if resp.status_code == 200:
        resp_o = json.loads(resp.text)
        return HttpResponseRedirect(resp_o['status'])
    else:
        return HttpResponse('<html><body><span>Something gone wrong: %s</span> : %s</body></html>' % (resp.status_code, resp.text))
import com.google.gson.Gson;
import okhttp3.*;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class Main {

    public static void main(String[] args) {
        MediaType JSON = MediaType.parse("application/json; charset=utf-8");

        Map<String, Object> params = new HashMap<>();
        params.put("amount", 1000);
        params.put("currency", "RUB");
        params.put("orderNumber", "10001");
        params.put("callbackUrl", "https://test.com");

        Map<String, String> bankAccount = new HashMap<>();
        bankAccount.put("bank_name", "sber");
        bankAccount.put("requisite_type", "card");
        params.put("bank_account", bankAccount);

        Map<String, String> card = new HashMap<>();
        card.put("pan", "4627342642639018");
        params.put("card", card);

        Map<String, String> customer = new HashMap<>();
        customer.put("email", "test@test.com");
        customer.put("ip", "178.175.20.33");
        customer.put("first_name", "Иванов");
        customer.put("last_name", "Иван");
        customer.put("middle_name", "Иванович");
        customer.put("phone", "79998889900");
        params.put("customer", customer);

        OkHttpClient client = new OkHttpClient();

        // Создаем запрос
        Request request = new Request.Builder()
                .url("https://business.reactivepay.com/api/v1/payouts")
                .post(RequestBody.create(JSON, new Gson().toJson(params)))
                .addHeader("content-type", "application/json")
                .addHeader("authorization", "Bearer merchant_private_key")
                .build();

        client.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
                System.err.println("onFailure(): " + e.getMessage());
            }

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

Return status 200 and JSON: Copy

{
    "success": true,
    "result": 0,
    "status": 200,
    "token": "c3452f792233e43aeaa819c68766043",
    "processingUrl": [
        {
            "trader": "https://business.reactivepay.com/payout/..."
        }
    ],
    "selectorUrl": "https://business.reactivepay.com/select/payout/c3452f792233e43aeaa819c68766043",
    "payment": {
        "amount": 30000,
        "currency": "RUB",
        "gateway_amount": 30000,
        "gateway_currency": "RUB",
        "status": "init"
    }
}

Create a payout operation. Use GET to processingUrl after request.

HTTP Request via SSL

POST '/api/v1/payouts'

Query Parameters

Parameter Mandatory Description
amount yes Payment amount in minimal values. ex: 123 RUB = 1.23 RUB.
currency yes Currency code
orderNumber yes ReactivePay's client inner order number
callbackUrl no merchat notification url
bank_account yes Bank details object for p2p payouts.
card yes Card object for card p2p payouts.
customer yes Customer object for payouts.

Card Payout Object Parameters

Parameter Mandatory Description
pan yes Customer’s card number (PAN). Any valid card number

Bank account Payout Object Parameters

Parameter Mandatory Description
bank_name no Customer bank name: sberbank/tbank/raiffeisen/uralsib/alfabank/sovcombank/humo/uzcard
requisite_type yes card

Customer Object Parameters

Parameter Mandatory Description
email yes Valid email format
ip yes Customer IP address
first_name no Customer name
last_name no Customer surname
middle_name no Customer middle name
phone no Customer phone for sbp

Payout SBP

Code: Copy

curl "https://business.reactivepay.com/api/v1/payouts" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "amount" : 1000,
        "currency" : "RUB",
        "orderNumber": "10001",
        "callbackUrl": "https://test.com",
        "bank_account": {
            "bank_name": "sber",
            "requisite_type": "sbp"
        },
        "customer": {
            "email": "test@test.com",
            "ip": "178.175.20.33",
            "first_name": "Иванов",
            "last_name": "Иван",
            "middle_name": "Иванович",
            "phone": "79998889900"
        }
    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.reactivepay.com/api/v1/payouts",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{ \"amount\" : 1000, \"currency\" : \"RUB\", \"orderNumber\" : \"10001\", \"extraReturnParam\" : \"test payout\", \"bank_account\": { \"bank_name\" : \"sber\", \"requisite_type\" : \"sbp\" }, \"customer\": { \"email\" : \"test@reactivepay.com\",\"phone\" : \"79998889900\", \"address\" : \"test test\", \"ip\" : \"1.1.1.1\"}"\n}",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer edf526c5374796cdcec5dce731405cee",
    "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 payout(request) :

    MERCHANT_PRIVATE_KEY = 'your-merchant-private-key'
    LIVE_URL = 'https://business.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.com'

    payload = {
        "amount" : 1000,
        "currency" : "RUB",
        "orderNumber": "10001",
        "callbackUrl": "https://test.com",
        "bank_account": {
            "bank_name": "sber",
            "requisite_type": "sbp"
        },
        "customer": {
            "email": "test@test.com",
            "ip": "178.175.20.33",
            "first_name": "Иванов",
            "last_name": "Иван",
            "middle_name": "Иванович",
            "phone": "79998889900"
        }
    }

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

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

    if resp.status_code == 200:
        resp_o = json.loads(resp.text)
        return HttpResponseRedirect(resp_o['status'])
    else:
        return HttpResponse('<html><body><span>Something gone wrong: %s</span> : %s</body></html>' % (resp.status_code, resp.text))
import com.google.gson.Gson;
import okhttp3.*;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class Main {

    public static void main(String[] args) {
        MediaType JSON = MediaType.parse("application/json; charset=utf-8");

        Map<String, Object> params = new HashMap<>();
        params.put("amount", 1000);
        params.put("currency", "RUB");
        params.put("orderNumber", "10001");
        params.put("callbackUrl", "https://test.com");

        Map<String, String> bankAccount = new HashMap<>();
        bankAccount.put("bank_name", "sber");
        bankAccount.put("requisite_type", "sbp");
        params.put("bank_account", bankAccount);

        Map<String, String> customer = new HashMap<>();
        customer.put("email", "test@test.com");
        customer.put("ip", "178.175.20.33");
        customer.put("first_name", "Иванов");
        customer.put("last_name", "Иван");
        customer.put("middle_name", "Иванович");
        customer.put("phone", "79998889900");
        params.put("customer", customer);

        OkHttpClient client = new OkHttpClient();

        // Создаем запрос
        Request request = new Request.Builder()
                .url("https://business.reactivepay.com/api/v1/payouts")
                .post(RequestBody.create(JSON, new Gson().toJson(params)))
                .addHeader("content-type", "application/json")
                .addHeader("authorization", "Bearer merchant_private_key")
                .build();

        client.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
                System.err.println("onFailure(): " + e.getMessage());
            }

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

Return status 200 and JSON: Copy

{
    "success": true,
    "result": 0,
    "status": 200,
    "token": "c3452f792233e43aeaa819c68766043",
    "processingUrl": [
        {
            "trader": "https://business.reactivepay.com/payout/..."
        }
    ],
    "selectorUrl": "https://business.reactivepay.com/select/payout/c3452f792233e43aeaa819c68766043",
    "payment": {
        "amount": 30000,
        "currency": "RUB",
        "gateway_amount": 30000,
        "gateway_currency": "RUB",
        "status": "init"
    }
}

Create a payout operation. Use GET to processingUrl after request.

HTTP Request via SSL

POST '/api/v1/payouts'

Query Parameters

Parameter Mandatory Description
amount yes Payment amount in minimal values. ex: 123 RUB = 1.23 RUB.
currency yes Currency code
orderNumber yes ReactivePay's client inner order number
callbackUrl no merchat notification url
bank_account yes Bank details object for p2p payouts.
customer yes Customer object for payouts.

Bank account Payout Object Parameters

Parameter Mandatory Description
bank_name yes Customer bank name: sberbank/tbank/raiffeisen/uralsib/alfabank/sovcombank/humo/uzcard
requisite_type yes sbp

Customer Object Parameters

Parameter Mandatory Description
email yes Valid email format
ip yes Customer IP address
first_name no Customer name
last_name no Customer surname
middle_name no Customer middle name
phone yes Customer phone for sbp

Payout Account

Code: Copy

curl "https://business.reactivepay.com/api/v1/payouts" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "amount" : 1000,
        "currency" : "RUB",
        "orderNumber": "10001",
        "callbackUrl": "https://test.com",
        "bank_account": {
            "bank_name": "sber",
            "requisite_type": "account",
            "account_number": "1234567891123456"
        },
        "customer": {
            "email": "test@test.com",
            "ip": "178.175.20.33",
            "first_name": "Иванов",
            "last_name": "Иван",
            "middle_name": "Иванович",
            "phone": "79998889900"
        }
    }'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.reactivepay.com/api/v1/payouts",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{ \"amount\" : 1000, \"currency\" : \"RUB\", \"orderNumber\" : \"10001\", \"extraReturnParam\" : \"test payout\", \"bank_account\": { \"bank_name\" : \"sber\", \"requisite_type\" : \"account\", \"account_number\" : \"1234567891123456\" }, \"customer\": { \"email\" : \"test@reactivepay.com\", \"address\" : \"test test\", \"ip\" : \"1.1.1.1\"}"\n}",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer edf526c5374796cdcec5dce731405cee",
    "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 payout(request) :

    MERCHANT_PRIVATE_KEY = 'your-merchant-private-key'
    LIVE_URL = 'https://business.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.com'

    payload = {
        "amount" : 1000,
        "currency" : "RUB",
        "orderNumber": "10001",
        "callbackUrl": "https://test.com",
        "bank_account": {
            "bank_name": "sber",
            "requisite_type": "account",
            "account_number": "1234567891123456"
        },
        "customer": {
            "email": "test@test.com",
            "ip": "178.175.20.33",
            "first_name": "Иванов",
            "last_name": "Иван",
            "middle_name": "Иванович",
            "phone": "79998889900"
        }
    }

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

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

    if resp.status_code == 200:
        resp_o = json.loads(resp.text)
        return HttpResponseRedirect(resp_o['status'])
    else:
        return HttpResponse('<html><body><span>Something gone wrong: %s</span> : %s</body></html>' % (resp.status_code, resp.text))
import com.google.gson.Gson;
import okhttp3.*;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class Main {

    public static void main(String[] args) {
        MediaType JSON = MediaType.parse("application/json; charset=utf-8");

        Map<String, Object> params = new HashMap<>();
        params.put("amount", 1000);
        params.put("currency", "RUB");
        params.put("orderNumber", "10001");
        params.put("callbackUrl", "https://test.com");

        Map<String, String> bankAccount = new HashMap<>();
        bankAccount.put("bank_name", "sber");
        bankAccount.put("requisite_type", "account");
        bankAccount.put("account_number","1234567891123456")
        params.put("bank_account", bankAccount);

        Map<String, String> customer = new HashMap<>();
        customer.put("email", "test@test.com");
        customer.put("ip", "178.175.20.33");
        customer.put("first_name", "Иванов");
        customer.put("last_name", "Иван");
        customer.put("middle_name", "Иванович");
        customer.put("phone", "79998889900");
        params.put("customer", customer);

        OkHttpClient client = new OkHttpClient();

        // Создаем запрос
        Request request = new Request.Builder()
                .url("https://business.reactivepay.com/api/v1/payouts")
                .post(RequestBody.create(JSON, new Gson().toJson(params)))
                .addHeader("content-type", "application/json")
                .addHeader("authorization", "Bearer merchant_private_key")
                .build();

        client.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
                System.err.println("onFailure(): " + e.getMessage());
            }

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

Return status 200 and JSON: Copy

{
    "success": true,
    "result": 0,
    "status": 200,
    "token": "c3452f792233e43aeaa819c68766043",
    "processingUrl": [
        {
            "trader": "https://business.reactivepay.com/payout/..."
        }
    ],
    "selectorUrl": "https://business.reactivepay.com/select/payout/c3452f792233e43aeaa819c68766043",
    "payment": {
        "amount": 30000,
        "currency": "RUB",
        "gateway_amount": 30000,
        "gateway_currency": "RUB",
        "status": "init"
    }
}

Create a payout operation. Use GET to processingUrl after request.

HTTP Request via SSL

POST '/api/v1/payouts'

Query Parameters

Parameter Mandatory Description
amount yes Payment amount in minimal values. ex: 123 RUB = 1.23 RUB.
currency yes Currency code
orderNumber yes ReactivePay's client inner order number
callbackUrl no merchat notification url
bank_account yes Bank details object for p2p payouts.
customer yes Customer object for payouts.

Bank account Payout Object Parameters

Parameter Mandatory Description
bank_name yes Customer bank name: sberbank/tbank/raiffeisen/uralsib/alfabank/sovcombank/humo/uzcard
account_number yes Customer’s account number. Any valid account number
requisite_type yes account

Customer Object Parameters

Parameter Mandatory Description
email yes Valid email format
ip yes Customer IP address
first_name no Customer name
last_name no Customer surname
middle_name no Customer middle name
phone no Customer phone for sbp

Balance

Request current ReactivePay balance.

Receive Balance

Code: Copy

curl "https://business.reactivepay.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.reactivepay.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.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.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.reactivepay.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: Copy

{
  "success": true | false,
  "result": 0,
  "status": 200,
  "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 (CNY)

Disputes

Request current ReactivePay dispute list.

Dispute list

Code: Copy

curl "https://business.reactivepay.com/api/v1/disputes" \
    -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.reactivepay.com/api/v1/disputes",
  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 disputes(request) :

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

    headers = {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY)
    }
    resp = requests.get('%s/api/v1/disputes' % (SANDBOX_URL), headers=headers)

OkHttpClient client = new OkHttpClient();

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

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

Return status 200 and JSON: Copy

{
    "success": true,
    "status": 200,
    "disputes": [
        {
            "id": 27,
            "amount": 2,
            "currency": "USD",
            "investigation_report": null,
            "status": "processing",
            "merchant_profile_id": 3,
            "user_profile_id": 3,
            "feed_id": 330,
            "created_at": "2019-09-13T08:46:21.302Z",
            "updated_at": "2019-09-13T08:46:21.343Z",
            "dispute_type": 2,
            "reason_code": "123",
            "comment": "some comment"
        }
    ]
}

Getting a list of last disputes for a business account.

HTTP Request via SSL

GET '/api/v1/disputes'

Query Parameters

Returns 100 latest records

Parameter Mandatory Description
status no Dispute status for filter [approved/pending/declined]
date no Date for filter
requisite no Requisite for filter
device no Device for filter

Create a dispute

Code: Copy

curl "https://business.reactivepay.com/api/v1/disputes" \
    -X POST \
    -header "Authorization: Bearer merchant_private_key" \
    --header 'Content-Type: application/json' \
    --form 'token="XsKkj4kmSjNATwoJdoiwwCmEKbT5efZX"' \
    --form 'description="test description"' \
    --form 'document=@"/home/test/Pictures/Screenshot from 2024-04-12 17-38-19.png"'
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.reactivepay.com/api/v1/disputes",
  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\" : XsKkj4kmSjNATwoJdoiwwCmEKbT5efZX, \"description\" : \"test description\", \"document\" : \"@"/home/test/Pictures/Screenshot from 2024-04-12 17-38-19.png"\"}",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer edf526c5374796cdcec5dce731405cee",
    "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 payout(request) :

    MERCHANT_PRIVATE_KEY = 'your-merchant-private-key'
    LIVE_URL = 'https://business.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.com'

    payload = {
        "token" : "XsKkj4kmSjNATwoJdoiwwCmEKbT5efZX",
        "description" : "test description",
        "document": ""/home/test/Pictures/Screenshot from 2024-04-12 17-38-19.png""
    }

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

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

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

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

params.put("token", "XsKkj4kmSjNATwoJdoiwwCmEKbT5efZX");
params.put("description", "test description");
params.put("document", "/home/test/Pictures/Screenshot from 2024-04-12 17-38-19.png");

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
       .url("https://business.reactivepay.com/api/v1/disputes")
       .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: Copy

{
  "success": true | false,
  "result": 0,
  "status": 200
}

Create a dispute.

HTTP Request via SSL

POST '/api/v1/disputes'

Query Parameters

Parameter Mandatory Description
token yes Payment token
description yes Description for dispute
document yes Payment receipt for dispute
amount no Amount for dispute

Notifications

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

Code: Copy

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: Copy

{

  "token": "payment token",
  "type": "payment type: payment | payout",
  "status" : "payment status: pending | approved | declined ",
  "extraReturnParam" : "extra params",
  "orderNumber" : "merchant order number",
  "walletToken": "payer's ReactivePay wallet unique identifier, only for reactivepay payments",
  "recurringToken": "payer's previously initialized recurring token, for making recurrent payment repeatedly",
  "sanitizedMask": "payer's sanitized card, if it was provided",
  "amount": "payment amount in cents",
  "currency": "payment currency",
  "gatewayAmount": "exchanged amount in cents",
  "gatewayCurrency": "exchanged currency"
}

Banking notifications

Notifications with the account or transfer status are sent to your callback URL using POST methods. In case account status's changed notification will be sent accordingly.

Code: Copy

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: Copy

{
  "subject": "account | transfer | compliance",
  "token": "transfer token | profile token",
  "status": "approved | pending | declined",
  "message" : "any comments from the system operator",
  "data" : {
      "account": {
          "number" : "IBAN or account number",
          "swift" : "valid SWIFT code"
      }, //or
      "transfer": {
            "token": "payment token",
            "updated-at": "2020-01-01 00:00:01",
            "created-at": "2020-01-01 00:00:00",
            "status": "pending",
            "name_from": "Mike Z.",
            "name_to": "Johny Depp",
            "operation_type": "payout",
            "payload": {
                "amount": "10000",
                "currency": "USD",
                "account_from": "account number",
                "account_to": "account number"
            },
            "bank_info": {
                "ref_number": "bank ref number",
                "extra_data": "some bank data"
            }
      }, //or
      "compliance": {
          "compliance_status":"documents_required | pending | approved  | declined"
      }
  }
}

Dictionaries

Errors

If any method failed, the JSON response with status code 403 returned that specified the problem.

Return status 403 and JSON: Copy

{'success': false, 'result': 1, 'status': 403, 'errors': {'list': [{'code': 'merchant_not_found', 'kind': 'api_error'}]}}

{'success': false, 'result': 1, 'status': 403, 'errors': [{'code': 'amount_less_than_minimum', 'kind': 'invalid_request_error'}]}

{'success': false, 'result': 1, 'status': 403, 'errors': [{'code': 'amount_less_than_balance', 'kind': 'processing_error'}]}

Payment states

State Final Description
init no Request to API will initiate payments.
pending no User redirected to the ReactivePay Checkout facility during payment processing period.
approved yes Successfully completed payment.
declined yes Unsuccessful payment.
expired no The transaction has expired due to timeout but may still be processed.

Kinds of errors

Kind Description
api_error Indicate rare occasions such as an ReactivePay 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.

Codes of errors

Code Description
incorrect_private_key The current private key cannot identify the user.
incorrect_address_info Absent or incorrect address information.
incorrect_bank_card_info Absent or incorrect bank card information.
order_number_already_exists Repeating an order of already identified order number.
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 value.
amount_less_than_minimum Minimum payout amount has not been requested.

Supported Chinese bank codes

Code Name
"ABC" "Agricultural Bank of China"
"ICBC" "Industrial and Commercial Bank of China"
"CCB" "China Construction Bank"
"BCOM" "Bank of Communication"
"BOC" "Bank of China"
"CMB" "China Merchants Bank"
"CMBC" "China Minsheng Bank"
"CEBB" "China Ever Bright Bank"
"BOB" "Bank of Beijing"
"SHB" "Bank of Shanghai"
"NBB" "Bank of Ningbo"
"HXB" "Hua Xia Bank"
"CIB" "China Industrial Bank"
"PSBC" "Postal Saving Bank of China"
"SPABANK" "Shenzhen Ping An Bank"
"SPDB" "Shanghai Pudong Development Bank"
"BEA" "Bank of East Asia"
"ECITIC" "China Citic Bank"
"GDB" "Guangdong Development Bank"

Supported Chinese state codes

State (Province) code State (Province) name
11 Beijing City
12 Tianjin City
13 Hebei Province
14 Shanxi Province
15 Inner Mogolia
21 Liaoning Province
22 Jilin Province
23 Heilongjiang Province
31 Shanghai City
32 Jiangsu Province
33 Zhejiang Province
34 Anhui Province
35 Fujian Province
36 Jiangxi Province
37 Shandong Province
41 Henan Province
42 Hubei Province
43 Hunan Province
44 Guangdong Province
45 Guangxi Province
46 Hainan Province
50 Chongqing City
51 Sichuan Province
52 Guizhou Province
53 Yunnan Province
54 Tibet
61 Shaanxi Province
62 Gansu Province
63 Qinghai Province
64 Ningxia
65 Xinjiang
71 Taiwan
81 Hong Kong
82 Macao

Supported Chinese city codes

City code City name State (Province) code
1000 Beijing City 11
1100 Tianjin City 12
1210 Shijiazhuang City 13
1240 Tangshan City 13
1260 Qinhuangdao City 13
1270 Handan City 13
1310 Xingtai City 13
1340 Baoding City 13
1380 Zhangjiakou City 13
1410 Chengde City 13
1430 Cangzhou City 13
1460 Langfang City 13
1480 Hengshui City 13
1610 Taiyuan city 14
1620 Datong City 14
1630 Yangquan city 14
1640 Changzhi City 14
1680 Jingcheng City 14
1690 Shuozhou City 14
1710 Xinzhou City 14
1730 Lvliang City 14
1750 Jingzhong City 14
1770 Linfeng City 14
1810 Yuncheng City 14
1910 Hohhot City 15
1920 Baotou City 15
1930 Wuhai City 15
1940 Chifeng City 15
1960 Hulunbeier City 15
1980 Hinggan League 15
1990 Tongliao City 15
2010 Xilin Gol League 15
2030 Ulanqab City 15
2050 Erdos City 15
2070 Bayan Nur City 15
2080 Alxa League 15
2210 Shenyang City 21
2220 Dalian City 21
2230 Anshan City 21
2240 Fushun City 21
2250 Benxi City 21
2260 Dandong City 21
2270 Jinzhou City 21
2276 Huludao City 21
2280 Yingkou City 21
2290 Fuxin City 21
2310 Liaoyang City 21
2320 Panjing City 21
2330 Tieling City 21
2340 Chaoyang City 21
2410 Changchun City 22
2420 Jilin City 22
2430 Siping City 22
2440 Liaoyuan City 22
2450 Tonghua City 22
2460 Baishan City 22
2470 Baicheng City 22
2490 Yanbian Korean Autonomous Prefecture 22
2520 Songyuan City 22
2610 Harbin City 23
2640 Qiqihar City 23
2650 Daqing City 23
2660 Jixi City 23
2670 Hegang City 23
2680 Shuangyashan City 23
2690 Jiamusi City 23
2710 Yichun City 23
2720 Mudanjiang City 23
2740 Qitaihe City 23
2760 Suihua City 23
2780 Heihe City 23
2790 Daxinganling region 23
2900 Shanghai City 31
3010 Nanjing City 32
3020 Wuxi City 32
3030 Xuzhou City 32
3040 Changzhou City 32
3050 Suzhou City 32
3060 Nantong City 32
3070 Lianyungang City 32
3080 Huai An City 32
3090 Suqian City 32
3110 Yancheng City 32
3120 Yangzhou City 32
3128 Taizhou City 32
3140 Zhenjiang City 32
3310 Hangzhou City 33
3320 Ningbo City 33
3330 Wenzhou City 33
3350 Jiaxing City 33
3360 Huzhou City 33
3370 Shaoxing City 33
3380 Jinhua City 33
3410 Quzhou City 33
3420 Zhoushan City 33
3430 Lishui City 33
3450 Taizhou City 33
3610 Hefei City 34
3620 Wuhu City 34
3630 Bengbu City 34
3640 Huainan City 34
3650 Ma anshan City 34
3660 Huaibei City 34
3670 Tongling City 34
3680 Anqing City 34
3710 Huangshan City 34
3720 Fuyang City 34
3722 Bozhou City 34
3740 Suzhou City 34
3750 Chuzhou City 34
3760 Liu an City 34
3771 Xuancheng City 34
3781 Chaohu City 34
3790 Chizhou City 34
3910 Fuzhou City 35
3930 Xiamen City 35
3940 Putian City 35
3950 Sanming City 35
3970 Quanzhou City 35
3990 Zhangzhou City 35
4010 Nanping City 35
4030 Ningde City 35
4050 Longyan City 35
4210 Nanchang City 36
4220 Jingdezhen City 36
4230 Pingxiang City 36
4240 Jiujiang City 36
4260 Xinyu City 36
4270 Yingtan City 36
4280 Ganzhou City 36
4310 Yichun City 36
4330 Shangrao City 36
4350 Ji an City 36
4370 Fuzhou City 36
4510 Jinan City 37
4520 Qingdao City 37
4530 Zibo City 37
4540 Zaozhuang City 37
4550 Dongying City 37
4560 Yantai City 37
4580 Weifang City 37
4610 Jining City 37
4630 Tai an City 37
4634 Laiwu City 37
4650 Weihai City 37
4660 Binzhou City 37
4680 Dezhou City 37
4710 Liaocheng City 37
4730 Linyi City 37
4732 Rizhao City 37
4750 Heze City 37
4910 Zhengzhou City 41
4920 Kaifeng City 41
4930 Luoyang City 41
4950 Pingdingshan City 41
4960 Anyang City 41
4970 Hebi City 41
4980 Xinxiang City 41
5010 Jiaozuo City 41
5020 Puyang City 41
5030 Xuchang City 41
5040 Luohe City 41
5050 Sanmenxia City 41
5060 Shangqiu City 41
5080 Zhoukou City 41
5110 Zhumendian City 41
5130 Nanyang City 41
5150 Xinyang City 41
5210 Wuhan City 42
5220 Huangshi City 42
5230 Shiyan City 42
5260 Yichang City 42
5280 Xiangfan City 42
5286 Suizhou City 42
5310 Ezhou City 42
5320 Jinmen City 42
5330 Huanggang City 42
5350 Xiaogan City 42
5360 Xianning City 42
5370 Jinzhou City 42
5410 Enshi Prefecture 42
5510 Changsha City 43
5520 Zhuzhou City 43
5530 Xiangtan City 43
5540 Hengyang City 43
5550 Shaoyang City 43
5570 Yueyang City 43
5580 Changde City 43
5590 Zhangjiajie City 43
5610 Yiyang City 43
5620 Loudi City 43
5630 Chenzhou City 43
5650 Yongzhou City 43
5670 Huaihua City 43
5690 Jishou City 43
5810 Guangzhou City 44
5820 Shaoguan City 44
5840 Shenzhen City 44
5850 Zhuhai City 44
5860 Shantou City 44
5865 Jieyang City 44
5869 Chaozhou City 44
5880 Foshan City 44
5890 Jiangmen City 44
5910 Zhanjiang City 44
5920 Maoming City 44
5930 Zhaoqing City 44
5937 Yunfu City 44
5950 Huizhou City 44
5960 Meizhou City 44
5970 Shanwei City 44
5980 Heyuan City 44
5990 Yangjiang City 44
6010 Qingyuan City 44
6020 Dongguan City 44
6030 Zhongshan City 44
6110 Nanning City 45
6128 Chongzuo City 45
6140 Liuzhou City 45
6155 Laibing City 45
6170 Guilin City 45
6210 Wuzhou City 45
6225 Hezhou City 45
6230 Beihai City 45
6240 Yulin City 45
6242 Guigang City 45
6261 Baise City 45
6281 Hechi City 45
6311 Qingzhou City 45
6330 Fangchenggang City 45
6410 Haikou City 46
6420 Sanya City 46
6510 Chengdu City 51
6530 Chongqing City 50
6550 Zigong City 51
6560 Panzhihua City 51
6570 Luzhou City 51
6580 Deyang City 51
6590 Mianyang City 51
6610 Guangyuan City 51
6620 Suining City 51
6630 Neijiang City 51
6636 Ziyang City 51
6650 Leshan City 51
6652 Meishan City 51
6670 Wanzhou District 50
6690 Fuling District 50
6710 Yibing City 51
6730 Nanchong City 51
6737 Guang an City 51
6750 Dazhou City 51
6758 Bazhong City 51
6770 Ya an City 51
6790 Aba Tibetan and Qiang Autonomous Region 51
6810 Garze Tibetan Autonomous Prefecture 51
6840 Yi Autonomous Prefecture of Liangshan 51
6870 Qianjiang District 50
7010 Guiyang City 52
7020 Liupanshui City 52
7030 Zunyi City 52
7050 Tongren District 52
7070 Qianxinan Prefecture 52
7090 Bijie District 52
7110 Anshun City 52
7130 Qiandongnan Prefecture 52
7150 Qianan Prefecture 52
7310 Kunming City 53
7340 Zhaotong City 53
7360 Qujing City 53
7380 Chuxiong City 53
7410 Yuxi City 53
7430 Honghe Hani Autonomous Prefecture 53
7450 Wenshan Zhuang-Miao Autonomous Prefecture 53
7470 Simao City 53
7490 Xishuangbanna Dai Autonomous Prefecture 53
7510 Dali Bai Autonomous prefecture 53
7530 Baoshan City 53
7540 Dehong Dai-Jingpo Autonomous Prefecture 53
7550 Lijiang City 53
7560 Nujiang Lisu Autonomous Prefecture 53
7570 Diqing Tibetan Autonomous Region 53
7580 Lincang City 53
7700 Lhasa City 54
7720 Changdu District 54
7740 Shannan District 54
7760 Shigatse District 54
7790 Naqu District 54
7811 Ali District 54
7830 Linzhi District 54
7910 Xi an City 61
7920 Tongchuan City 61
7930 Baoji City 61
7950 Xianyang City 61
7970 Weinan City 61
7990 Hanzhong City 61
8010 Ankang City 61
8030 Shangluo City 61
8040 Yan an City 61
8060 Yulin City 61
8210 Lanzhou City 62
8220 Jiayuguan City 62
8230 Jinchang City 62
8240 Baiyin City 62
8250 Tianshui City 62
8260 Jiuquan City 62
8270 Zhangye City 62
8280 Wuwei City 62
8290 Dingxi City 62
8310 Longnan City 62
8330 Pingliang City 62
8340 Qingyang City 62
8360 Linxia City 62
8380 Gannan Prefecture 62
8510 Xining City 63
8520 Haidong District 63
8540 Haibei Tibetan Autonomous Region 63
8550 Huangnan Tibetan Autonomous Region 63
8560 Hainan Tibetan Autonomous Region 63
8570 Guoluo Tibetan Autonomous Region 63
8580 Yushu Tibetan Autonomous Region 63
8590 Haixi Mogolian-Tibetan Autonomous Region 63
8710 Yinchuan City 64
8720 Shizuishan City 64
8731 Wuzhong City 64
8733 Zhongwei City 64
8741 Guyuan City 64
8810 Urumqi City 65
8820 Karamay City 65
8830 Turpan city 65
8840 Hami City 65
8844 Altay Prefecture 65
8850 Hui Autonomous Prefecture of Changji 65
8870 Bortala Mongol Autonomous Prefecture 65
8880 Bayingolin Mogol Autonomous Prefecture 65
8910 Akesu Prefecture 65
8930 Kizilsu Kirghiz Autonomous Prefecture 65
8940 Kashi Prefecture 65
8960 Hotan Prefecture 65
8980 Kazak Autonomous Prefecture of Ili 65
9010 Tacheng prefecture 65
9020 Altay Prefecture 65
9028 Shihezi City 65

Banking

Provides a wide range of methods for bank account opening, money transfer and profile/kyc checking facilitation

Create bank account

Code: Copy

curl "https://business.reactivepay.com/api/v1/banking/accounts" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
    "personal": {
        "email": "email",
        "phone": "12312312",
        "country": "ESP",
        "firstName": "Chris",
        "lastName": "Renjard",
        "address": {
            "postcode": "111111",
            "city": "Barcelona",
            "street": "Passeig del Born",
            "number": "123"
        },
        "birthday": "dd/mm/yy"
    },
    "business": {
        "legalName": "ReactivePay LLC",
        "tradeName": "ReactivePay",
        "industry": "software development",
        "email": "sales@reactivepay.com",
        "website": "reactivepay.com",
        "country": "ESP",
        "address": {
            "postcode": "111111",
            "city": "Barcelona",
            "street": "Passeig del Born",
            "number": "123"
        },
        "licenseNumber": "ADDASD1231231"
    },
    "currencies": ["USD", "GBP", "EUR"],
    "callback": "https://reactivepay.com/notify"
}'

Return status 200 and JSON: Copy

{
  "success": true | false,
  "errors": [],
  "personalProfileToken": "[profile token]",
  "businessProfileToken": "[profile token]"
}

Makes a bank account openning request -- use this method to start open bank account procedure. It updates/registers primary profile data and receive profile token using wich you can proceed with KYC validation and recieve callback once account open procedure has successfuly completed

If a company profile set then individual profile must contain inforamtion of legal/registered entity director or beneficiary owner

HTTP Request via SSL

POST 'api/v1/banking/accounts'

Basic Parameters

Parameter Mandatory Description Validation
personal yes Profile of an individual (subject from account opening) JSON Object
business no Profile of a company (subject from account opening) JSON Object
currencies yes List of account supported currencies (currencies must be sent according to ISO 4217) Array of strings
callback yes urk where to send account opening status website formatted string

Individual profile (individual_profile)

Parameter Mandatory Description Validation
email yes Individual email, valid and confirmed, used for sending notifications and official requests Valid email format
phone yes Valid/confirmed registered for the individual phone number +1(area code)number
country yes ISO country code minLength: 2, maxLength: 3, string (ESP, UK)
firstName yes First name same as on ID document minLength: 3, maxLength: 150 Only words (\w+)
lastName yes Last name same as on ID document minLength: 3, maxLength: 150 Only words (\w+)
address yes Individual registered address (same as on ID document or POA papers) JSON formatted address
birthday yes Individual birthday (same as on ID document) minLength: 8, maxLength: 8, EU formatted date (01/01/00)

Company profile (optional, company_profile)

Parameter Mandatory Description Validation
legalName yes Company legal name, same as on registraion papers minLength: 3, maxLength: 150
tradeName yes Company trade name, same as on web-site and business plan minLength: 3, maxLength: 150
industry yes Company industry in "ad libitum" form: gaming, sports, etc. minLength: 5, maxLength: 150
email yes Company email, valid and confirmed, used for sending notifications and official requests Valid email format
website yes Company web-site minLength: 5, maxLength: 255
country yes ISO country code minLength: 2, maxLength: 3, string (ESP, UK)
address yes Company registered address (same as on registration document) JSON formatted address
licenseNumber yes Company license/registration number minLength: 15, maxLength: 150

Address

Parameter Mandatory Description Validation
postcode yes Company HQ (official) postcode minLength: 3, maxLength: 150
city yes Company HQ (official) city minLength: 3, maxLength: 150
street yes Company HQ (official) street minLength: 5, maxLength: 150
number yes Company HQ (official) building number minLength: , maxLength: 150

Get bank accounts

Code: Copy

curl "https://business.reactivepay.com/api/v1/banking/accounts" \
    -X GET \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
            "profileToken": "a profile token value"
    }'

Return status 200 and JSON: Copy

[
    {
        "token": "account 1 token",
        "currency": "EUR",
        "balance": "1000.00",
        "held": "300.00",
        "details": {
            "iban": "iban",
            "swift": "bic / swift",
            "sepa": "bic / swift"
        }
    },
    {
        "token": "account 2 token",
        "currency": "GBP",
        "balance": "1000.00",
        "held": "300.00",
        "details": {
            "iban": "iban",
            "swift": "bic / swift",
            "bankCode": "bank code",
            "accountNumber": "account number",
        }
    },
]
    "AccountNumber1": {
        "balance": {
            "EUR": "1000",
            "GBP": "1000"
        },
        "held": {
            "EUR": "1000",
            "GBP": "1000"
        },
        "details": {
            "iban": "iban",
            "swift": "bic / swift",
            "sepa": "bic / swift",
            "sort_code": "sort_code",

        }
    }
}

Gets account details via customer's profile token

HTTP Request via SSL

GET 'api/v1/banking/accounts'

Basic Parameters

Parameter Mandatory Description Validation
profileToken yes Profile token parameter that must be retrieved and stored from create account API method string

Response Parameters

Parameter Description
balance Available for sepndings and cashflow balance in each supported currency
held The amount of held cash on the account
details Account bank specific details

Create compliance request

Code: Copy


// Compliance request

curl "https://business.reactivepay.com/api/v1/banking/compliance" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
            "profileToken": "profileToken",
            "compliance": {
                "IDNumber": "National ID number or passport/company license number"
            },
            "callback": "https://reactivepay.com/notify"
    }'

// Upload documents

curl "https://business.reactivepay.com/api/v1/banking/compliance/{complienceId}/upload" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -F "file=doc.jpg" -d '{
            "complienceId": "resently created complience id",
            "profileToken": "profileToken",
            "description": "PoA document"
    }'

Return status 200 and JSON: Copy

{
  "success": true | false,
  "errors": [],
  "complienceId": "",
  "status": "uploading"
}

Sends a compliance/KYC request to perform compliance and on-boarding procedure, once request's created the intial status will be "no_documents" which requires you to upload documents according to your local authority regulations and account type(business/company or personal) using appropriate profileToken, either for business or personal profile.

Note that you can upload multiple documents for different profile types using upload method several times

HTTP Request via SSL

POST 'api/v1/banking/compliance' POST 'api/v1/banking/compliance/{complienceId}/upload'

Compliance Parameters

Parameter Mandatory Description Validation
profileToken yes Profile token parameter that must be retrieved and stored from create account API method string
compliance yes Naitional ID number or passport number JSON Object
callback yes URL where to send KYC verification status URL formatted string

Upload parameters

Parameter Mandatory Description Validation
complienceId yes complience id the docs are been uploading complience id
file yes a single file of a certain document type (passport bank statement
description yes a description for the document, could be: "Passport" or "Driving license" or "PoA" minLenght=3, string

Get compliance status

Code: Copy


curl "https://business.reactivepay.com/api/v1/banking/compliance" \
    -X GET \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
            "profileToken": "profileToken"
    }'

Return status 200 and JSON: Copy

{
  "success": true | false,
  "errors": [],
  "status": "uploading" | "pending" | "approved" | "declined"
}

Gets compliance request current status

HTTP Request via SSL

GET 'api/v1/banking/compliance'

Basic Parameters

Parameter Mandatory Description Validation
profileToken yes profileToken token parameter that must be retrieved and stored from create account API method string

Create transfer

Code: Copy


curl "https://business.reactivepay.com/api/v1/banking/transfers" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
            "profileToken": "profile token",
            "amount": "10000.00",
            "currency": "USD",
            "type": "sepa | swift | faster",
            "beneficiary": {
                "account": {
                    "swift": {
                        "iban": "IBAN or account number",
                        "bic": "BIC/SWIFT code",
                    },
                    "sepa": {
                        "iban": "IBAN or account number",
                        "bic": "BIC/SWIFT code",
                    },
                    "faster": {
                        "bankCode": "refers to the sort code",
                        "accountNumber": "refers to bank account number"
                    }
                },
                "name": "Albert Plank",
                "country": "ESP",
                "address": {
                    "city": "Barcelona",
                    "postcode": "123",
                    "street": "Some street",
                    "number": "123"
                }
            }
            "reference": "Service agreement 10/203",
            "callback": "https://reactivepay.com"
        }'

Return status 200 and JSON: Copy

{
  "success": true | false,
  "errors": [],
  "transferToken": "transfer identificator",
  "status": "pending"
}

Creates a bank transfer between customer's account and a distination bank account To make internal transfers between the acccounts which are registered within one system use Core API reference

HTTP Request via SSL

POST 'api/v1/banking/transfers'

Basic Parameters

Parameter Mandatory Description Validation
profileToken yes sender profile token parameter that must be retrieved and stored from create account API method string
amount yes amount of cash to be transferred in cents minLength: 1, maxLength: 32
currency yes Currency code (CNY, EUR, USD, JPY). minLength: 3, maxLength: 3
type yes Transfer type sepa or swift or faster
beneficiary yes Beneficiary params JSON objwct
reference yes Supportive document reference for the transfer string
callback yes URL where to send transfer status to URL formatted string

Parameters

Parameter Mandatory Description Validation
account yes SWIFT, SEPA, UK Faster Payments bank account parameters JSON object
name yes Beneficiary name (same as on the ID document) String
country yes Beneficiary country of residence String
address yes Beneficiary address JSON object

Bank Account Parameters

Parameter Mandatory Description Validation
swift no SWIFT payment params JSON object
sepa no SEPA payment params JSON object
faster no UK faster payments payment params JSON object

SWIFT Bank Account Parameters

Parameter Mandatory Description Validation
iban yes IBAN format or any other valid account number String
bic yes International BIC / SWIFT code String

SEPA Bank Account Parameters

Parameter Mandatory Description Validation
iban yes IBAN format or any other valid account number String
bic yes International BIC / SWIFT code String

UK Faster Payments Bank Account Parameters

Parameter Mandatory Description Validation
bankCode yes refers to the UK Faster Payments sort code String
accountNumber yes refers to UK Faster Payments bank account number String

Beneficiary Address Parameters

Parameter Mandatory Description Validation
postcode yes Company HQ (official) postcode minLength: 3, maxLength: 150
city yes Company HQ (official) city minLength: 3, maxLength: 150
street yes Company HQ (official) street minLength: 5, maxLength: 150
number yes Company HQ (official) building number minLength: , maxLength: 150

Get transfer

Code: Copy


curl "https://business.reactivepay.com/api/v1/banking/transfers/{transferToken}" \
    -X GET \
    -H "Authorization: Bearer merchant_private_key"

Return status 200 and JSON: Copy

{
    "success": true | false,
    "errors": [],
    "transferToken": "transfer token",
    "createdAt": "2020-01-01 00:00:00",
    "processedAt": "2020-01-01 00:00:00",
    "status": "pending",
    "profileToken": "profile token",
    "amount": "10000.00",
    "currency": "USD",
    "operationType": "cashout | cashin",
    "transferType": "sepa | swift | faster",
    "swift": {
        "iban": "IBAN or account number",
        "swift": "SWIFT code",
    },
    "sepa": {
        "iban": "IBAN or account number",
        "sepa": "SEPA code",
    },
    "faster": {
        "bankCode": "refers to the sort code",
        "accountNumber": "refers to bank account number"
    },
    "beneficiary": {
        "name": "Albert Plank",
        "country": "ESP",
        "address": {
            "city": "Barcelona",
            "postcode": "123",
            "street": "Some street",
            "number": "123"
        }
    },
    "reference": "Service agreement 10/203"
}

Gets bank transfer

HTTP Request via SSL

GET 'api/v1/banking/transfers'

Basic Parameters

Parameter Mandatory Description Validation
transferToken yes token to get transfer for (retrieve from Create transfer response) string

List of transfers

Code: Copy


curl "https://business.reactivepay.com/api/v1/banking/transfers/" \
    -X GET \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '
      {
        "profileToken": "a profile token value",
        "dateFrom": "2020-01-01 00:00:00",
        "dateTo": "2020-01-02 00:00:00",
        "page": 1,
        "perPage": 100
      }
    '

Return status 200 and JSON: Copy

{
  "success": true | false,
  "errors": [],
  "total": 100,
  "transfers": [
                {
                  "transferToken": "transfer token",
                  "createdAt": "2020-01-01 00:00:00",
                  "processedAt": "2020-01-01 00:00:00",
                  "status": "pending",
                  "profileToken": "profile token",
                  "amount": "10000.00",
                  "currency": "USD",
                  "operationType": "cashout | cashin",
                  "transferType": "sepa | swift | faster",
                  "swift": {
                      "iban": "IBAN or account number",
                      "swift": "SWIFT code",
                  },
                  "sepa": {
                      "iban": "IBAN or account number",
                      "sepa": "SEPA code",
                  },
                  "faster": {
                      "bankCode": "refers to the sort code",
                      "accountNumber": "refers to bank account number"
                  },
                  "beneficiary": {
                      "name": "Albert Plank",
                      "country": "ESP",
                      "address": {
                          "city": "Barcelona",
                          "postcode": "123",
                          "street": "Some street",
                          "number": "123"
                      }
                  },
                  "reference": "Service agreement 10/203"
                }
            ]
}

Returns list of transfers for a profile, filtered by data and operation type

HTTP Request via SSL

GET 'api/v1/banking/transfers/list'

Basic Parameters

Parameter Mandatory Description Validation
profileToken yes profileToken token parameter that must be retrieved and stored from create account API method string
dateFrom yes date to select transfers from date-time format
dateTo yes date to stop selecting transfers to date-time format
page yes page number to return data for number
perPage yes limit of transfers to select per 1 request number

Exchange operation

Exchnage operation could be performed as inter-transfer wallet request via Core API.

DA

Digital assets API

Open Account

Code: Copy

curl "https://business.reactivepay.com/api/v1/da/accounts" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "token" : "User Token",
        "currency" : "BTC"
    }'
from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

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

    payload = {
        "token" : request['token'],
        "currency" : request['currency']
    }

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

    resp = requests.post('%s/api/v1/da/accounts' % (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", "User Token");
params.put("currency", "BTC");
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
       .url("https://business.reactivepay.com/api/v1/da/accounts")
       .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: Copy

{
  "success": true | false,
  "errors": [],
  "address": "da_address"
}

Open account

HTTP Request via SSL

POST '/api/v1/da/accounts'

Query Parameters

Parameter Mandatory Description
token yes User token.
currency yes Currency (BTC, ETH, XRP).

Exchange

Code: Copy

curl "https://business.reactivepay.com/api/v1/da/exchanges" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "token" : "User Token",
        "amount" : "1000",
        "from_currency" : "USD",
        "to_currency" : "BTC"
    }'
from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

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

    payload = {
        "token": request['token'],
    "amount": request['amount'],
    "from_currency": request['from_currency'],
    "to_currency": request['to_currency']
    }

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

    resp = requests.post('%s/api/v1/da/exchanges' % (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", "User Token");
params.put("amount", 1000);
params.put("from_currency", "USD");
params.put("to_currency", "BTC");
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
       .url("https://business.reactivepay.com/api/v1/da/exchanges")
       .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: Copy

{
  "success": true | false,
  "errors": [],
  "exchange": {
    "token": "[payment token]",
    "status": "[payment status]",
    "timestamp": "2016-06-09T03:46:45Z",
    "rate": 0.01
  }
}

Open account

HTTP Request via SSL

POST '/api/v1/da/exchanges'

Query Parameters

Parameter Mandatory Description
token yes User token.
amount yes Amount of funds to withdraw.
from_currency yes Currency ISO to be withdrawn, example: "EUR"
to_currency yes Currency ISO (BTC, ETH, XRP).

Payment

Code: Copy

curl "https://business.reactivepay.com/api/v1/da/payments" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "product" : "Your Product",
        "amount" : "1000",
        "currency" : "BTC",
        "redirect_success_url" : "https://your-site.com/success",
        "redirect_fail_url" : "https://your-site.com/fail",
        "extra_return_param" : "your order id or other info",
        "order_number" : "your order number",
        "locale": "zh"
    }'
from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

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

    payload = {
      "product": request['product'],
      "amount": request['amount'],
      "currency": request['currency'],
      "redirect_success_url": request['redirect_success_url'],
      "redirect_fail_url": request['redirect_fail_url'],
      "extra_return_param": request['extra_return_param'],
      "order_number": request['order_number'],
      "locale": request['locale']
    }

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

    resp = requests.post('%s/api/v1/da/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", "Product");
params.put("amount", 1000);
params.put("currency", "BTC");
params.put("redirect_success_url", "https://your-site.com/success");
params.put("redirect_fail_url", "https://your-site.com/fail");
params.put("extra_return_param", "your order id or other info");
params.put("order_number", "your order number");
params.put("locale", "zh");
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
       .url("https://business.reactivepay.com/api/v1/da/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: Copy

{
  "success": true | false,
  "errors": [],
  "token": "[payment token]",
  "processingUrl": "https://business.reactivepay.com/da/p/[payment token]",
  "payment": {
    "amount": "10020",
    "currency": "BTC",
    "status": "init"
  }
}

Open account

HTTP Request via SSL

POST '/api/v1/da/payments'

Query Parameters

Parameter Mandatory Description
product yes Product name (Service description) (example: 'iPhone').
amount yes Payment amount in cents (10020)
currency yes Currency code (BTC, ETH, XRP)
redirect_success_url yes The URL a customer will be redirected to in the case of successfull payment
redirect_fail_url yes The URL a customer will be redirected to in the case of payment error or failure
extra_return_param yes Bank/Payment method list, description, etc
order_number yes The current order number from a company system.
locale yes The locale is used on a payment page by default.

Payouts

Code: Copy

curl "https://business.reactivepay.com/api/v1/da/payouts" \
    -X POST \
    -H "Authorization: Bearer merchant_private_key" \
    -H "Content-Type: application/json" -d '{
        "amount" : 1000,
        "currency" : "BTC",
        "order_number" : "10001",
        "extra_return_param" : "test payout”,
        "address": "da_address"
    }'
from django.http import HttpResponseRedirect, HttpResponse
import requests
import json

def pay(request) :

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

    payload = {
      "amount": request['amount'],
      "currency": request['currency'],
      "order_number": request['order_number'],
      "extra_return_param": request['extra_return_param'],
      "address": request['address']
    }

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

    resp = requests.post('%s/api/v1/da/payouts' % (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("amount", 1000);
params.put("currency", "BTC");
params.put("order_number", "10001");
params.put("extra_return_param", "test payout");
params.put("address", "da_address");
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
       .url("https://business.reactivepay.com/api/v1/da/payouts")
       .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: Copy

{
  "success": true | false,
  "errors": [],
  "payout": {
    "token": "[payment token]",
    "status": "[payment status]",
    "timestamp": "2016-06-09T03:46:45Z"
  }
}

Open account

HTTP Request via SSL

POST '/api/v1/da/payouts'

Query Parameters

Parameter Mandatory Description
amount yes Amount of funds to withdraw.
currency yes Currency ISO.
order_number yes ReactivePay's client inner order number.
extra_return_param yes Additionals params.
address yes Cryptocurrency address where you want to send funds.

Operators

Operator

Code: Copy

curl "https://business.reactivepay.com/api/v1/operator?phone=77775415544" \
    -H "Authorization: Bearer merchant_private_key"
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://business.reactivepay.com/api/v1/operator?phone=77775415544",
  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 operator(request) :

    MERCHANT_PRIVATE_KEY = 'merchant-private-key'
    LIVE_URL = 'https://business.reactivepay.com';
    SANDBOX_URL = 'https://business.reactivepay.com'

    headers = {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer %s' % (MERCHANT_PRIVATE_KEY)
    }
    resp = requests.get('%s/api/v1/operator?phone=77775415544' % (SANDBOX_URL), headers=headers)

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
.url("https://business.reactivepay.com/api/v1/operator?phone=77775415544")
.get()
.addHeader("content-type", "application/json")
.addHeader("authorization", "Bearer merchant_private_key")
.build();

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

Return status 200 and JSON: Copy

{
  "success": true | false,
  "status": 200,
  "operator": "beeline"
}

Return operator by phone

HTTP Request via SSL

GET '/api/v1/operator'

Query Parameters

Parameter Mandatory Description
phone yes Phone number.

Gateway.Connect

This document outlines the structure and purpose of gateway integration settings used for H2H (Host-to-Host) payments. These settings control how request parameters are wrapped, which fields are allowed, and define behavior per payment method.

General Structure for H2H

For H2H payments, parameters are wrapped using: - Incoming request parameters - Static settings defined per gateway - Fields from the payments table in the database

Each payment method (pay, payout, refund, etc.) can have its own selector configuration.

Example Method Configuration

Field Type Description
final_waiting_seconds Integer Seconds before initiating status check (default: 15)
enable_status_checker Boolean Enable payment status polling (default: true)
params_fields Object Configuration for request parameters
params_fields.callback_3ds_url Boolean 3DS callback URL (default: true)
params_fields.callback_url Boolean Generic callback URL (default: true)
params_fields.processing_url Boolean Final redirect URL (default: true)
params_fields.params Array Request parameters (see below)
params_fields.payment Array Allowed fields from the payments record (see below)
params_fields.settings Array Static config flags (see below)
params_fields.params.pan String Card PAN (default: true)
params_fields.params.expires String Card expiration (default: true)
params_fields.params.holder String Card holder name (default: true)
params_fields.params.cvv String CVV code (default: true)
params_fields.params.email String Customer email (default: true)
params_fields.params.country String Customer country (default: true)
params_fields.params.city String Customer city (default: true)
params_fields.params.state String Customer state (default: true)
params_fields.params.phone String Customer phone (default: true)
params_fields.params.browser String Browser data (JSON object) (default: true)
params_fields.params.first_name String Customer first name (default: true)
params_fields.params.last_name String Customer last name (default: true)
params_fields.params.extra_return_param String Extra return parameter (default: true)
params_fields.payment.token String Internal payment token (default: true)
params_fields.payment.gateway_token String External gateway token (default: true)
params_fields.payment.gateway_amount String Converted amount (default: true)
params_fields.payment.gateway_currency String Converted currency (default: true)
params_fields.settings.sandbox Boolean Enable sandbox (test) mode (default: true)
"pay": {
  "final_waiting_seconds": 15,
  "enable_status_checker": true,
  "params_fields": {
    "callback_3ds_url": true,
    "callback_url": true,
    "processing_url": true,
    "params": [
      "pan",
      "expires",
      "holder",
      "cvv",
      "email",
      "country",
      "city",
      "state",
      "phone",
      "browser",
      "first_name",
      "last_name",
      "extra_return_param"
    ],
    "payment": [
      "token",
      "gateway_token",
      "gateway_amount",
      "gateway_currency"
    ],
    "settings": [
      "sandbox"
    ]
  }
}

Available parameter fields

Field Type Description
pan String Card PAN
expires String Card expiration date
holder String Card holder name
cvv String Card CVV code
email String Customer email
country String Customer country
city String Customer city
state String Customer state
postcode String Customer postal code
street String Customer street address
address String Customer address
region String Customer region
phone String Customer phone number
otp String One-time password
pin String Personal identification number
bank_code String Bank code
bank_account_number String Bank account number
identify_type String Identification type
identify_number String Identification number
recurring Boolean Recurring payment flag
need_confirmation Boolean Confirmation requirement
browser Object Browser data (JSON object)
country_code String Customer country code
first_name String Customer first name
father_name String Customer father's name
last_name String Customer last name
website String Customer website
birthday String Customer birthday
state String Customer state
recurring_data Object Recurring payment data
pending_url String URL for pending payments
extra_return_param String Extra return parameter

Available payment fields

Field Type Description
id Integer Payment ID (we don't use it field)
status String Payment status
token String Internal payment token
currency String Origin payment currency
product String Product name
callback_url String Merchant callback URL
redirect_success_url String URL for successful payment redirect
redirect_fail_url String URL for failed payment redirect
redirect_request String URL for redirect request (non used)
merchant_private_key String Private key for Merchant record
amount Integer Payment amount
gatewayable_type String Name of gateway (e.g., `Gateway::TestpayPayment)
gatewayable_id Integer ID of gateway record
created_at Datetime Payment creation date
updated_at Datetime Payment update date
extra_return_param String Extra return parameter
operation_type String Payment operation type (e.g., pay, refund, payout)
order_number String Merchant order number
declination_reason String Reason for payment declination
lead_id Integer ID of the lead record
ip String Customer IP address
browser_info String Browser information
bank_card_id Integer ID of the bank card record
kind String Payment kind (e.g., wallet, direct)
refund_id Integer ID of the refund payment record
scoring_remark String Scoring remark
country_code_by_BIN String Country code by BIN (e.g., US)
country_code_by_phone String Country code by phone (e.g., US)
country_code_by_IP String Country code by IP (e.g., US)
business_account_legal_name String Business account legal name from merchant core settings
business_account_profileID String Business account profile ID from merchant core settings
card_masked_number String Masked card number (e.g., 1234****234)
gateway_details JSON Gateway-specific details (containts gateway_ids, redirect_request and other data`)
gateway_currency String Gateway currency after conversion
gateway_amount Integer Gateway amount after conversion
details JSON Additional details (e.g., request data, error data etc.)
scoring_action String Scoring action (e.g., success)
scoring_action_log JSON Scoring action log (e.g., {riskscore: {...}})
gateway_alias String Gateway alias (e.g., testpay)
card_brand_name String Card brand name (e.g., Visa, MasterCard)
routing_logs JSON Routing logs (e.g., {prev_route: null {next_route...}})
gateway_token String External gateway ID (e.g., 123456789)
two_stage_mode Boolean Indicates if the payment is in two-stage mode
settings JSON Payment settings (e.g., {status_checker_time_rates: {...}})
rrn String RRN (Retrieval Reference Number)
commission_data JSON Commission data (e.g., {commission_fee: 10, commission_amount: 10})
notification_settings JSON Notification settings (e.g., {"recipient"=>"test@test.tt", "allow_notification"=>true})
customer_country String Customer country (e.g., US)
trader_id Integer Trader ID (e.g., 123456)
merchant_url String Merchant URL (e.g., http://example.com)
reference String Reference (e.g., 123456789)
locale String Locale (e.g., en-US)

Allowed Methods (field "method")

Field Type Description
pay String Payment initiatiate
status String Payment status check (if enable_status_checker is true)
confirm_secure_code String 3DS confirmation
payout String Outgoing payout
refund String Refund payment
resend_otp String Resend OTP code
next_payment_step String Next payment step for 3DS
decline String Decline payment

For enabled methods need to be set in the methods array

"methods": [
  "pay",
  "status",
  "confirm_secure_code",
  "payout",
  "refund"
]

Additional Top-Level Settings

Field Type Description
class String Integration class name, matches container or routing name (e.g., testpay)
processing_method String Communication method: http_requests or rabbit (currently only HTTP)
sandbox Boolean Indicates whether gateway is in test/sandbox mode
sign_key String Secret used to sign callback JWTs
status_checker_time_rates Object Polling intervals per retry group

Example Status Checker Time Rates

status_checker_time_rate's count ranges Interval (seconds) Description
1-3 30 Every 30s for attempts 1 to 3
4-6 60 Every 60s for attempts 4 to 6
7-9 120 Every 120s for attempts 7 to 9
10- 300 Every 300s (5 min) for 10th attempt and later
"status_checker_time_rates": {
  "1-3": 30,
  "4-6": 60,
  "7-9": 120,
  "10-": 300
}

This configuration controls how often the status of a payment is re-checked after creation.

Each setting allows you to tailor integration behavior for different gateway providers and payment types. These configurations ensure correct data handling, structured requests, and environment-specific behavior.

Gateway Routing Configuration

There describes the structure and purpose of the gateways_routing.yml configuration file. This file contains network-related settings for available integrations and their enabled status.

Configuration Location

/business/config/gateways_routing.yml

Example Structure

default:
  gateway_routes:
    testpay:
      full_link: "http://test:9090"
      host: test
      port: 9090
      enable: true

Field Descriptions

Field Type Description
full_link String Full URL of the gateway including protocol, host, and port
host String Hostname of the service (e.g., Docker container or domain name)
port Integer Port on which the service is listening
enable Boolean Indicates if the integration is enabled on the platform

These settings are environment-agnostic and loaded for all environments by default unless overridden.

Settings example

{
    "EUR": {
        "gateways": {
            "pay": {
                "default": "testpay"
            },
            "payout": {
                "default": "testpay"
            }
        }
    },
    "USD": {
        "gateways": {
            "pay": {
                "providers": [
                    {
                        "testpay": "testpay"
                    }
                ]
            },
            "payout": {
                "default": "testpay"
            }
        }
    },
    "gateways": {
        "allow_host2host": true,
        "testpay": {
            "class": "testpay",
            "confirm_secure_code": {
                "params_fields": {
                    "params": [
                        "headers",
                        "cres",
                        "checkout_result_token"
                    ]
                }
            },
            "methods": [
                "pay",
                "status",
                "confirm_secure_code",
                "payout",
                "refund"
            ],
            "pay": {
                "enable_status_checker": true,
                "final_waiting_seconds": 15,
                "params_fields": {
                    "callback_3ds_url": true,
                    "callback_url": true,
                    "params": [
                        "pan",
                        "expires",
                        "holder",
                        "cvv",
                        "email",
                        "country",
                        "city",
                        "state",
                        "phone",
                        "browser",
                        "first_name",
                        "last_name",
                        "extra_return_param"
                    ],
                    "payment": [
                        "token",
                        "gateway_token",
                        "gateway_amount",
                        "gateway_currency"
                    ],
                    "processing_url": true,
                    "settings": [
                        "sandbox"
                    ]
                }
            },
            "payout": {
                "enable_status_checker": true,
                "params_fields": {
                    "callback_3ds_url": true,
                    "callback_url": true,
                    "params": [
                        "pan",
                        "expires",
                        "holder",
                        "cvv",
                        "email",
                        "country",
                        "city",
                        "state",
                        "phone",
                        "browser",
                        "first_name",
                        "last_name",
                        "extra_return_param"
                    ],
                    "payment": [
                        "token",
                        "gateway_token",
                        "gateway_amount",
                        "gateway_currency"
                    ],
                    "processing_url": true,
                    "settings": [
                        "sandbox"
                    ]
                }
            },
            "processing_method": "http_requests",
            "refund": {
                "enable_status_checker": true,
                "params_fields": {
                    "params": [
                        "amount"
                    ],
                    "payment": [
                        "amount",
                        "gateway_token"
                    ]
                }
            },
            "sandbox": true,
            "sign_key": "efc63a792a8375213898a166e50bc64d",
            "status": {
                "params_fields": {
                    "params": [
                        "token"
                    ],
                    "payment": [
                        "gateway_token"
                    ]
                }
            },
            "status_checker_time_rates": {
                "1-3": 30,
                "10-": 300,
                "4-6": 60,
                "7-9": 120
            },
            "wrapped_to_json_response": false
        }
    }
}

Payment Requests (From ReactivePay)

Successful Response Fields:

Declined Requests:

Example Payment Request

{
  "params": {
    "settings": {
      "sandbox": true
    },
    "params": {
      "pan": "4392963203551251",
      "expires": "08/2025",
      "holder": "John Doe",
      "cvv": "196",
      "email": "50-18@gmail.com",
      "country": "AU",
      "city": "Transmetropolitan",
      "state": "AU",
      "phone": "+77022579074",
      "browser": {
        "accept_header": "application/json, text/plain, */*",
        "color_depth": "32",
        "ip": "109.48.0.1",
        "language": "us-US",
        "screen_height": "1080",
        "screen_width": "1920",
        "tz": "-180",
        "user_agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:92.0)",
        "java_enabled": "true",
        "window_width": "1240",
        "window_height": "560"
      },
      "first_name": "Test",
      "last_name": "Test2",
      "extra_return_param": "_blank_"
    },
    "payment": {
      "redirect_success_url": "https://success.foxew.com/?token=4gbk3dVf8QbdVp7KWCbKvHtgfXKtSWCk&type=pay&status=approved&extraReturnParam=_blank_&orderNumber=REPF72G59N&walletDisplayName=&amount=100000&currency=EUR&gatewayAmount=100000&gatewayCurrency=EUR&cardHolder=John+Doe&sanitizedMask=439296******1251&walletToken=52f58064f38a53e390546b18c1bf2fcf1020&signature=1db8de71a1ed8d10a0240561ce7748e4",
      "redirect_fail_url": "https://declined.foxew.com/?token=4gbk3dVf8QbdVp7KWCbKvHtgfXKtSWCk&type=pay&status=declined&extraReturnParam=_blank_&orderNumber=REPF72G59N&walletDisplayName=&amount=100000&currency=EUR&gatewayAmount=100000&gatewayCurrency=EUR&cardHolder=John+Doe&sanitizedMask=439296******1251&walletToken=52f58064f38a53e390546b18c1bf2fcf1020&signature=1db8de71a1ed8d10a0240561ce7748e4",
      "token": "4gbk3dVf8QbdVp7KWCbKvHtgfXKtSWCk",
      "gateway_amount": 100000,
      "gateway_currency": "EUR"
    },
    "processing_url": "http://business:4000/checkout_results/<token>/processing",
    "callback_url": "http://business:4000/callbacks/v2/gateway_callbacks/<token>",
    "callback_3ds_url": "http://business:4000/checkout_results/<token>/callback_3ds",
    "method_name": "pay"
  }
}

Example 3DS Payment Response

{
  "status": "ok",
  "gateway_token": "4409b224-b1a7-41e5-8216-7c98560f4f08",
  "result": "success",
  "card_3ds_enrolled": true,
  "processingUrl": "http://business:4000/checkout_results/<token>/processing",
  "redirect_request": {
    "url": "http://business:4000/checkout_results/<token>/processing",
    "type": "post_iframes",
    "iframes": [
      {
        "url": "http://test:9090/3ds",
        "data": {
          "creq": "<creq-token>",
          "token": "<token>"
        }
      }
    ]
  },
  "logs": [...]
}

Payout Request

Payout fields mostly mirror the payment request. Sample:

{
  "callback_url": "https://foxew.com",
  "amount": 1234,
  "currency": "USD",
  "extra_return_param": "Tinkoff",
  "order_number": "AutoTest#Payout-5264998",
  "card": {
    "pan": "4392963203551251",
    "expires": "03/2027",
    "holder": "Test Test",
    "cvv": "123"
  },
  "customer": {
    "email": "test@test.com",
    "phone": "79151002030",
    "ip": "1.2.3.4"
  },
  "ip": "1.2.3.4",
  "user_agent": "PostmanRuntime/7.43.0",
  "remote_ip": "172.19.0.1"
}

Payout Success Response

{
  "status": "ok",
  "gateway_token": "f268ae4e-e5b4-451d-a46c-7c7b44d47195",
  "result": "success",
  "processingUrl": "http://business:4000/checkout_results/<token>/processing",
  "logs": [...]
}

Payment Endpoints

path method description
/pay POST Pay request
/status POST Check status
/payout POST Payout request
/refund POST Refund request
/confirm_secure_code POST Confirm 3ds or OTP secret key
/next_payment_step POST For second request for ACS or appruve 3ds (if necessary)

General Structure for P2P

According to the p2p payment flow, we are redirected to some page that the provider returns to us. Or it will be generated in the business logic of the integration. The settings parameter "wrapped_to_json_response" is responsible for make the response in JSON format, without redirects.

For payments parameters are wrapped using: - Incoming request parameters - Static settings defined per merchant's gateway - Fields from the payments table in the database

Each payment method (pay, payout, refund, etc.) can have its own selector configuration.

Integration settings in /business/config/gateways_routing.yml define how the integration behaves, including which parameters to include in requests, whether to enable status checking, and other method-specific configurations. Merchant settings in settings service define which gateways are available for each currency and how they are configured. This includes the class name, sandbox mode, and other parameters.

Example Structure of Integration Settings

default:
  gateway_routes:
    testpay:
      full_link: "http://test:9090"
      enable: true
      callback: true
      gateway_key: testpay
      status_checker_time_rates:
        "1-3": 30
        "10-": 300
        "4-6": 60
        "7-9": 120
      processing_method: http_requests
      methods:
        confirm_secure_code:
          params_fields:
            params:
              - headers
              - cres
              - checkout_result_token
        pay:
          enable_status_checker: true
          final_waiting_seconds: 15
          params_fields:
            callback_3ds_url: true
            callback_url: true
            params:
              - pan
              - expires
              - holder
              - cvv
              - email
              - country
              - city
              - state
              - phone
              - browser
              - first_name
              - last_name
              - extra_return_param
            payment:
              - token
              - gateway_token
              - gateway_amount
              - gateway_currency
            processing_url: true
            settings:
              - sandbox
        payout:
          enable_status_checker: true
          params_fields:
            callback_url: true
            params:
              - pan
              - expires
              - holder
              - cvv
              - email
              - country
              - city
              - state
              - phone
              - browser
              - first_name
              - last_name
              - extra_return_param
            payment:
              - token
              - gateway_token
              - gateway_amount
              - gateway_currency
            processing_url: true
            settings:
              - sandbox
        refund:
          enable_status_checker: true
          params_fields:
            params:
              - amount
            payment:
              - amount
              - gateway_token
        status:
          params_fields:
            params:
              - token
            payment:
              - gateway_token

Additional Top-Level Settings

Field Type Description
class String Integration class name, matches container or routing name (e.g., testpay)
processing_method String Communication method: http_requests or rabbit (currently only HTTP)
status_checker_time_rates Object Polling intervals per retry group
full_link String Full URL of the gateway including protocol, host, and port
enable Boolean Indicates if the integration is enabled on the platform
methods Object Configuration for available methods and their parameters
callback Boolean Indicates if the gateway supports callbacks (default: true)
gateway_key String Unique key for the gateway, used for routing and identification(e.g., testpay, is equal to class in merchant settings)

Example Method Configuration

Field Type Description
final_waiting_seconds Integer Seconds before initiating status check (default: 15)
enable_status_checker Boolean Enable payment status polling (default: true)
params_fields Object Configuration for request parameters
params_fields.callback_url Boolean Generic callback URL (default: true)
params_fields.processing_url Boolean Final redirect URL (default: true)
params_fields.params Array Request parameters (see below)
params_fields.payment Array Allowed fields from the payments record (see below)
params_fields.settings Array Static config flags (see below)
params_fields.params.cvv String CVV code (default: true)
params_fields.params.email String Customer email (default: true)
params_fields.params.country String Customer country (default: true)
params_fields.params.city String Customer city (default: true)
params_fields.params.state String Customer state (default: true)
params_fields.params.phone String Customer phone (default: true)
params_fields.params.browser String Browser data (JSON object) (default: true)
params_fields.params.first_name String Customer first name (default: true)
params_fields.params.last_name String Customer last name (default: true)
params_fields.params.extra_return_param String Extra return parameter (default: true)
params_fields.payment.token String Internal payment token (default: true)
params_fields.payment.gateway_token String External gateway token (default: true)
params_fields.payment.gateway_amount String Converted amount (default: true)
params_fields.payment.gateway_currency String Converted currency (default: true)
params_fields.settings.sandbox Boolean Enable sandbox (test) mode (default: true)
pay:
  enable_status_checker: true
  final_waiting_seconds: 15
  params_fields:
    callback_3ds_url: true
    callback_url: true
    params:
      - pan
      - expires
      - holder
      - cvv
      - email
      - country
      - city
      - state
      - phone
      - browser
      - first_name
      - last_name
      - extra_return_param
    payment:
      - token
      - gateway_token
      - gateway_amount
      - gateway_currency
    processing_url: true
    settings:
      - sandbox

Available parameter fields

Field Type Description
email String Customer email
country String Customer country
city String Customer city
state String Customer state
postcode String Customer postal code
street String Customer street address
address String Customer address
region String Customer region
phone String Customer phone number
otp String One-time password
pin String Personal identification number
bank_code String Bank code
bank_account_number String Bank account number
identify_type String Identification type
identify_number String Identification number
recurring Boolean Recurring payment flag
need_confirmation Boolean Confirmation requirement
browser Object Browser data (JSON object)
country_code String Customer country code
first_name String Customer first name
father_name String Customer father's name
last_name String Customer last name
website String Customer website
birthday String Customer birthday
state String Customer state
recurring_data Object Recurring payment data
pending_url String URL for pending payments
extra_return_param String Extra return parameter

Available payment fields

Field Type Description
id Integer Payment ID (we don't use it field)
status String Payment status
token String Internal payment token
currency String Origin payment currency
product String Product name
callback_url String Merchant callback URL
redirect_success_url String URL for successful payment redirect
redirect_fail_url String URL for failed payment redirect
redirect_request String URL for redirect request (non used)
merchant_private_key String Private key for Merchant record
amount Integer Payment amount
gatewayable_type String Name of gateway (e.g., `Gateway::TestpayPayment)
gatewayable_id Integer ID of gateway record
created_at Datetime Payment creation date
updated_at Datetime Payment update date
extra_return_param String Extra return parameter
operation_type String Payment operation type (e.g., pay, refund, payout)
order_number String Merchant order number
declination_reason String Reason for payment declination
lead_id Integer ID of the lead record
ip String Customer IP address
browser_info String Browser information
kind String Payment kind (e.g., wallet, direct)
refund_id Integer ID of the refund payment record
scoring_remark String Scoring remark
country_code_by_BIN String Country code by BIN (e.g., US)
country_code_by_phone String Country code by phone (e.g., US)
country_code_by_IP String Country code by IP (e.g., US)
business_account_legal_name String Business account legal name from merchant core settings
business_account_profileID String Business account profile ID from merchant core settings
gateway_details JSON Gateway-specific details (containts gateway_ids, redirect_request and other data`)
gateway_currency String Gateway currency after conversion
gateway_amount Integer Gateway amount after conversion
details JSON Additional details (e.g., request data, error data etc.)
scoring_action String Scoring action (e.g., success)
scoring_action_log JSON Scoring action log (e.g., {riskscore: {...}})
gateway_alias String Gateway alias (e.g., testpay)
routing_logs JSON Routing logs (e.g., {prev_route: null {next_route...}})
gateway_token String External gateway ID (e.g., 123456789)
two_stage_mode Boolean Indicates if the payment is in two-stage mode
settings JSON Payment settings (e.g., {status_checker_time_rates: {...}})
rrn String RRN (Retrieval Reference Number)
commission_data JSON Commission data (e.g., {commission_fee: 10, commission_amount: 10})
notification_settings JSON Notification settings (e.g., {"recipient"=>"test@test.tt", "allow_notification"=>true})
customer_country String Customer country (e.g., US)
trader_id Integer Trader ID (e.g., 123456)
merchant_url String Merchant URL (e.g., http://example.com)
reference String Reference (e.g., 123456789)
locale String Locale (e.g., en-US)

Allowed Fields (field "method")

Field Type Description
pay String Payment initiatiate
status String Payment status check (if enable_status_checker is true)
confirm_secure_code String OTP confirmation
payout String Outgoing payout
refund String Refund payment
resend_otp String Resend OTP code
decline String Decline payment

For settings methods need to be set in the methods section of the configuration file.

methods:
  confirm_secure_code:
    params_fields:
      params:
        - headers
        - cres
        - checkout_result_token
  ...
  pay:
    enable_status_checker: true
    final_waiting_seconds: 15
    params_fields:
      callback_3ds_url: true
      callback_url: true
      params:
        - pan
...
  payout:
    enable_status_checker: true
    params_fields:
      callback_url: true
      params:
        - pan
        - expires
...etc.

Example Status Checker Time Rates

status_checker_time_rate's count ranges Interval (seconds) Description
1-3 30 Every 30s for attempts 1 to 3
4-6 60 Every 60s for attempts 4 to 6
7-9 120 Every 120s for attempts 7 to 9
10- 300 Every 300s (5 min) for 10th attempt and later
status_checker_time_rates:
  "1-3": 30
  "10-": 300
  "4-6": 60
  "7-9": 120

This configuration controls how often the status of a payment is re-checked after creation.

Each setting allows you to tailor integration behavior for different gateway providers and payment types. These configurations ensure correct data handling, structured requests, and environment-specific behavior.

Gateway Routing Configuration

There describes the structure and purpose of the gateways_routing.yml configuration file. This file contains network-related settings for available integrations and their enabled status.

Configuration Location

/business/config/gateways_routing.yml

Field Descriptions

Field Type Description
decline_payout_on_request_error Boolean Decline payout if request has server or client fails (default: true)
class String Integration class name, matches container or routing name (e.g., testpay and it is qual gateway_key)
wrapped_to_json_response Boolean If true, the response is wrapped in JSON format without redirects (default: false)
sandbox Boolean Indicates whether gateway is in test/sandbox mode
sign_key String Secret used to sign callback JWTs

These settings are environment-agnostic and loaded for all environments by default unless overridden.

Example structure of Merchant Settings

{
    "EUR": {
        "gateways": {
            "pay": {
                "default": "testpay"
            },
            "payout": {
                "providers": [
                    {
                        "default": "testpay_p2p"
                    }
                ]
            }
        }
    },
    "USD": {
        "gateways": {
            "pay": {
                "providers": [
                    {
                        "DDDDD": "testpay_p2p"
                    }
                ]
            },
            "payout": {
                "default": "testpay_p2p"
            }
        }
    },
    "gateways": {
        "allow_host2host": true,
        "testpay": {
            "class": "testpay",
            "sandbox": true,
            "sign_key": "efc63a792a8375213898a166e50bc64d"
        },
        "testpay_p2p": {
            "class": "testpay_p2p",
            "decline_payout_on_request_error": true,
            "sandbox": true,
            "sign_key": "22263a792a8375213898a166e50bc64d",
            "wrapped_to_json_response": false
        }
    }
}

ReactivePay P2P Payment Request and Response Documentation

Accepted Fields in P2P Payment Request

Section: customer

Section: bank_account

Section: default

Server Response for P2P Payments

Payment Endpoints

path method description
/pay POST Pay request
/status POST Check status
/payout POST Payout request
/refund POST Refund request
/confirm_secure_code POST Confirm OTP secret key
/p2p_redirect GET Redirect to charge page
/pay_by_form POST Approve payment by form

ReactivePay Callback Integration Manual

ReactivePay receives asynchronous notifications (callbacks) about payment events. These callbacks must be authenticated, validated, and follow specific payload and security requirements.

2. Callback Endpoint

Endpoint format:

POST /callbacks/v2/gateway_callbacks/:token

Where :token is the Payment.token of the current transaction.

3. Authentication & JWT Format

Callbacks are authenticated using a JWT token in the Authorization header:

Authorization: Bearer <JWT_TOKEN>

JWT Header:

{
  "alg": "HS512"
}

JWT Payload:

{
  "status": "approved",
  "currency": "USD",
  "amount": 100,
  "secure": {
    "encrypted_data": "<base64-string>",
    "iv_value": "<base64-string>"
  }
}

4. Encrypting the Merchant Key

Use AES-256-CBC encryption with the system master key:

Ruby Reference:

Code: Copy

openssl enc -aes-256-cbc -in merchant_key.txt -out encrypted_key.bin -K <master_token> -iv <iv_value>
<?php
function encryptMerchantKey(string $merchantKey, string $masterToken): array {
    // Cut the master token to 32 bytes
    $key = substr($masterToken, 0, 32);
    $iv = openssl_random_pseudo_bytes(16); // 16 bytes for AES-CBC IV

    $encryptedData = openssl_encrypt(
        $merchantKey,
        'aes-256-cbc',
        $key,
        OPENSSL_RAW_DATA,
        $iv
    );

    return [
        'encrypted_data' => base64_encode($encryptedData),
        'iv_value' => base64_encode($iv),
    ];
}

// Example usage
$merchantKey = 'merchant_private_key_string';
$masterToken = 'your_very_long_32+_byte_master_token_here';

$result = encryptMerchantKey($merchantKey, $masterToken);
print_r($result);
import base64
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes

def pad(data):
    pad_len = 16 - (len(data) % 16)
    return data + bytes([pad_len] * pad_len)

def encrypt_merchant_key(merchant_key: str, master_token: str):
    key = master_token.encode('utf-8')[:32]
    iv = get_random_bytes(16)

    cipher = AES.new(key, AES.MODE_CBC, iv)
    padded_data = pad(merchant_key.encode('utf-8'))
    encrypted = cipher.encrypt(padded_data)

    return {
        "encrypted_data": base64.b64encode(encrypted).decode('utf-8'),
        "iv_value": base64.b64encode(iv).decode('utf-8')
    }
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.util.Base64;
import java.security.SecureRandom;

public class AesEncryptor {

    public static void main(String[] args) throws Exception {
        String merchantKey = "merchant_private_key_string";
        String masterToken = "your_very_long_32+_byte_master_token_here";

        // Cut the master token to 32 bytes
        byte[] keyBytes = masterToken.substring(0, 32).getBytes("UTF-8");

        // Generate random IV
        byte[] ivBytes = new byte[16];
        new SecureRandom().nextBytes(ivBytes);

        // Encrypt the merchant key
        SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES");
        IvParameterSpec ivSpec = new IvParameterSpec(ivBytes);

        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
        cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec);

        byte[] encrypted = cipher.doFinal(merchantKey.getBytes("UTF-8"));

        // Encode to Base64
        String encryptedData = Base64.getEncoder().encodeToString(encrypted);
        String ivValue = Base64.getEncoder().encodeToString(ivBytes);

        System.out.println("encrypted_data: " + encryptedData);
        System.out.println("iv_value: " + ivValue);
    }
}

Output(#)

{
  "encrypted_data": "<Base64>",
  "iv_value": "<Base64>"
}

See language-specific examples in callback_request_manual.md.

5. Payload Schema Validation

Each request must conform to the following JSON schema:

{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "minLength": 32,
      "maxLength": 32
    },
    "gateway_token": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "pattern": "^(approved|declined|refunded)$"
    },
    "refund": {
      "type": "boolean"
    },
    "reason": {
      "type": "string",
      "minLength": 5
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 4
    },
    "amount": {
      "type": "integer"
    },
    "gateway_callback": {
      "type": "object"
    }
  },
  "required": ["token", "status", "currency", "amount"]
}

6. Server-side Validation Steps

a. Extract and decode JWT:

function extractSecureBlock(jwt_token):
    base64_payload = jwt_token.split('.')[1]
    decoded_payload = Base64Decode(base64_payload)
    json_payload = ParseJSON(decoded_payload)
    secure_block = json_payload["secure"]
    return secure_block

b. Decrypt merchant key:

function decryptMerchantKey(secure_block):
    encrypted_data = secure_block["encrypted_data"]
    iv = secure_block["iv_value"]
    master_key = GetConfig("master_token")[0:32]

    merchant_private_key = AES256Decrypt(
        key = master_key,
        iv = iv,
        data = encrypted_data
    )

    return merchant_private_key

c. Validate JWT signature:

function validateJwtSignature(jwt_token, sign_key):
    is_valid = JwtVerify(token = jwt_token, secret = sign_key, algorithm = "HS512")
    return is_valid

7. Success and Error Handling

Success:

Errors:

Code Message
401 Authorization token is missing
422 Invalid JWT signature
422 Invalid payload schema

8. Example CURL Request

curl --location 'http://business:4000/callbacks/v2/gateway_callbacks/gJJN4VytdaNxivS5kcvWkeMb448EWJQc' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <JWT_TOKEN>' \
--data '{
  "status": "approved",
  "currency": "USD",
  "amount": 100
}'

9. Logs and Debugging

Each callback is logged via InteractionLogger with:

10. Common Pitfalls

11. Useful References