NAV
PHP C#

API Reference

Intro

End point to create a transaction

https://secure.mandarinpay.com/api/transactions

End point to create a card binding

https://secure.mandarinpay.com/api/card-bindings

Fly API Mandarinpay is based on the Rest API technology. The system contains resource oriented end points. The requests, returned by the system, have the JSON format.

API Mandarinpay is unsynchronized (a few of the requests are done synchronously). You receive the payment ID(the request) and later receive a callback notification in the unsynchronized mode. This includes the earlier received payment ID, the operation status and other data about it.

For you to test the API, there is a special test mode (sandbox) mode, as well as the action one. The switchover between the two modes is in the project settings in your personal profile on the mandarinpay.com (Detailed instructions). Created requests in the sandbox mode are never transmitted into bank information systems and therefore are never charged.

Test cards

Data of the test cards for the functionality check (any card validity period, after the current month in month/year format)

Preference Value Comment
Card Number 4929509947106878 For the simulation of successful transactions without 3DSecure
Card Number 4692065455989192 For the simulation of successful transactions with 3DSecure
Card Number 4485913187374384 For the simulation of failed transactions without 3DSecure
Card Number 4556058936309366 For the simulation of failed transactions with 3DSecure
Name of the card owner CARD HOLDER
CVV 123

Monitoring during the set up (heartbeat)

It is best to use heartbeat for monitoring of transactions and call backs during the set up HeartBeat.

To log in use the MerchantID and Secret as your login and password.

Heart beat – Transactions - Transactions’ monitoring

Heart beat – Binding - Credit card binding

Heart beat - Notifications - Monitoring of call back notifications where our system didn’t get the 200th response from your system. - More

Authentication

Authentication of requests to API Mandarinpay is done in 2 ways:

  1. HTTP Basic Auth - more
  2. Authentication by hash - more

All requests to API must be made without HTTP. Requests with HTTP will be denied without transactions’ creation.

HTTP Basic Auth

You can read more about Basic Authentication on Wikipedia(https://en.wikipedia.org/wiki/Basic_access_authentication).

As with Mandarinpay, use merchantId, as the login and secret as your password.

Authentication by hash (X-auth)

Пример расчета X-Auth

<?php
function gen_auth($merchantId, $secret)
{
        $reqid = time() ."_". microtime(true) ."_". rand();
        $hash = hash("sha256", $merchantId ."-". $reqid ."-". $secret);
        return $merchantId ."-".$hash ."-". $reqid;
}
?>
public static string GenerateXAuth(string secret)
{
  var requestId = Guid.NewGuid().ToString("N");
    string hash;
    using (var sha256 = System.Security.Cryptography.SHA256.Create())
        hash = BitConverter.ToString(sha256.ComputeHash(Encoding.UTF8.GetBytes($"{merchantId}-{requestId}-{secret}"))).ToLower().Replace("-", "");
    return $"{merchantId}-{hash}-{requestId}";
}

The request must have the headline Content-Type: application/json The Authentication of requests to API happens by using API Secret Key and your Merchant ID in order to form the headlin X-Auth containing the following: merchantId-SHA256(merchantId-requestId-secret)-requestId

requestId - is a unique request number which has the timestamp in milliseconds or a set of bites, generated by the cryptographic random number generator.

API requests without a headline or with a wrong headline (including wrong X-Auth ) will be denied without transactions’ creation.

Response codes

Response examples

200-OK - Response processed successfully, transaction was created

For a transaction
{
  "id": "43913ddc000c4d3990fddbd3980c1725",
  "userWebLink": "https://secure.mandarinpay.com/Pay?transaction=0eb51e74-e704-4c36-b5cb-8f0227621518",
  "jsOperationId": "9874694yr87y73e7ey39ed80"
}
For a card binding
{
    "id": "0eb51e74-e704-4c36-b5cb-8f0227621518",
    "userWebLink": "https://secure.mandarinpay.com/CardBindings/New?id=0eb51e74-e704-4c36-b5cb-8f0227621518",
    "jsOperationId": "binding-4994591t5-194t694159t-43t5345"
}

400-Bad Request - Request is incorrect, transaction was not created

{
  "error": "Invalid request"

}

Mandarinpay operates on the standard HTTP codes for success or failure indication of API requests. Code with a 2xx format signalise success and codes of a 4xx format speak for request failure based on given information. (the lack of the needed format, wrongly written headline). Codes in the 5xx format speak for malfunction of the Mandarinpay server but it happens very rarely).

Field list and it’s description

Field Description
id id of the created operation
userWeblink Link to forward the user when working with the payment page
jsOperationId Operation Id for using with Hosted Fields
error Text description of the error

After receiving the response 3 things might happen:

  1. *1. For use of the payment page * - Fast forward the user to the userWebLink - more
  2. *2. To use the built in form Hosted Fields * - Use the jsOperationId as the OperationId according to the description - more
  3. 3. In some cases, no other actions are required. In this case, you will only get the id in the synchronized response..

Unsynchronized call backs

Example of a callback-successfull payment notification

merchantId=1&orderId=03917&email=sadukin%40mail.ru&price=11040&action=pay&customer_fullName=%20%20&customer_phone=%2B79189271304&customer_email=sadykin%40mail.ru&transaction=60a186c112e24b90ad839bb7bc65a9ff&object_type=transaction&status=success&payment_system=mandarinpayv1&card_number=403841XXXXXX6022&cb_customer_creditcard_number=403841XXXXXX6022&card_holder=RUSLAN%20SADYKOV&card_expiration_year=19&card_expiration_month=05&transaction_rrn=718791158407&d000d97e-a0db-4e56-9460-6934e4bec050=4d3bb82f-fd4f-43c6-b809-2aec91e0de8a&sign=ca3f0443a3fc60d96d2197f8dbf93deb5d6e3922a5854ed526e2c11ca723eb3

Example of a callback-successfull card binding notification

card_binding=abbd431d-fb01-4bf9-9eb9-773b794c2df9&card_holder=RULSAN%20MALYGIN&card_number=427638XXXXXX3811&card_expiration_year=2018&card_expiration_month=11&object_type=card_binding&status=success&merchantId=1&initial_hold_amount=1&orderId=1147710&f9d6c9d1-f4d4-4a3e-8ccf-9421eb483792=0ac5dff9-7aea-4d2f-90ac-c16d730cf2a1&sign=ee8d74a8b80c407a662dcf3ddf2260ba9de0cbb0bb455e8a429b7035205782c6

Example of a callback-notification with status payout-only

card_binding=abbd431d-fb01-4bf9-9eb9-773b794c2df9&card_holder=RULSAN%20MALYGIN&card_number=427638XXXXXX3811&card_expiration_year=2018&card_expiration_month=11&object_type=card_binding&status=payout-only&merchantId=1&initial_hold_amount=1&orderId=1147710&f9d6c9d1-f4d4-4a3e-8ccf-9421eb483792=0ac5dff9-7aea-4d2f-90ac-c16d730cf2a1&sign=ee8d74a8b80c407a662dcf3ddf2260ba9de0cbb0bb455e8a429b7035205782c6

Check example sign

<?php
function check_sign($secret, $req)
{
        $sign = $req['sign'];
        unset($req['sign']);
        $to_hash = '';
        if (!is_null($req) && is_array($req)) {
                ksort($req);
                $to_hash = implode('-', $req);
        }

        $to_hash = $to_hash .'-'. $secret;
        $calculated_sign = hash('sha256', $to_hash);
        return $calculated_sign == $sign;
}

check_sign("123", $_POST);
?>
public static string Calculate(string secret, IDictionary<string, string> values)
{
    using (var sha256 = System.Security.Cryptography.SHA256.Create())
        return BitConverter.ToString(sha256.ComputeHash(Encoding.UTF8.GetBytes(string.Join("-", values.OrderBy(x => x.Key, StringComparer.Ordinal).Select(x => x.Value)) + "-" + secret))).ToLower().Replace("-", "");
}

public static bool CheckSign(string secret, HttpRequest request)
{
    var sign = request.Form["sign"];
    if(string.IsNullOrWhiteSpace(sign))
      return false;
    return sign ==
        Calculate(secret, request.Form.Keys.Where(k => k != "sign").ToDictionary(k => k, k => request.Form[k]));
}

The notifications are sent to the CallbackUrl, which is indicated in the client interface or sent in the API request (also the Post request) Content-Type: application/x-www-urlencoded.

To confirm, that the notification came from the Mandarinpay system, and they also aren’t misrepresented, check the sign field.

The sign field is a sum of all preferences’ notification values in the alphabetic order (by names) andSecret, divided by this symbol -.

As a response that your callback was successful and has been processed you should respond to MandarinPay with a HTTP code of 200 and type OK

Depending in the object_type definition, notifications can have the following types:

Type Description
card_binding Card binding
transaction Transaction

The list and field description, transmitted as the callback- notifications

Field Example Description
merchantId 1 The ID of the merchant
orderId 1234OR Unique order number in the seller’s system
price 12.34 The payment amount. Necessary to transmit to the current system version.
action pay, payout Action (purchase or card payment) only plays a role in transactions
transaction 05991602ed7c47d996ca7ab119b07f66 ID transactions in the system – only plays a role in transactions
card_binding 38467cb0-da73-4755-84da-2acb7f638a59 ID bindings to the system – only significant for bindings
status success, failed, payout-only Operation status
customer_email [email protected] User’s email
customer_phone +71234567890 User’s phone number
card_holder VASILY PUPKIN Card holder
card_number 123456XXXXXX7890 Card number
card_expiration_year 18 Card expiration year
card_expiration_month 9 Card expiration
error_code 59 Error code
error_description Transaction Declined Error description
transaction_rrn 704191744222 Retrieval Reference Number - unique transaction ID in the bank emitent system of a credit card

PaymentID

Every API call has a unique ID which is called the payment ID. It is directly transmitted with the other response as an id. It is also included in the call back notification as the transaction or card_binding.

If you call the contact center about the payment, we advise you to know this ID and it will significantly speed up their response to you.

User Interfaces

Payment Page

The Payment system Mandarinpay has an adaptive design, contains your logo and payment information which you transmitted in the API request.

In order to work with the payment system, you need to use the user redirect at the userWebLink, which you received in the synchronized response to your API request. more

The built-in payment form (Hosted Fields)

<form id="form-hosted-pay">
  <div style="margin: 10px; padding: 10px; border: 1px solid gray">
    Card Number:
    <div class="mandarinpay-field-card-number hosted-field"><div class="glyphicon glyphicon-check"></div></div>
    Card Holder:
    <div class="mandarinpay-field-card-holder hosted-field"><div class="glyphicon glyphicon-check"></div></div>
    Card Expiration:
    <div class="mandarinpay-field-card-expiration hosted-field"><div class="glyphicon glyphicon-check"></div></div>
    CVV:
    <div class="mandarinpay-field-card-cvv hosted-field"><div class="glyphicon glyphicon-check"></div></div>
    <br/>
    <a href="#" onclick="return mandarinpay.hosted.process(this);" class="btn btn-default">Оплатить</a>
  </div>
</form>
<script>
mandarinpay.hosted.setup("#form-hosted-pay", {
  operationId: "9874694yr87y73e7ey39ed80",
  onsuccess: function(data) {
    alert("Success, id: " + data.transaction.id);
  },
  onerror: function(data) {
    alert("Error: " + data.error);
  }
});
</script>

CSS for fields

.hosted-field
{
    background: #f0f0f0;
    height: 40px;
    padding: 5px;
    border: 1px solid gray;
    border-radius: 10px;
}

.hosted-field {
    position: relative;
}

.hosted-field .glyphicon {
    visibility: hidden;
    position: absolute;
    right: 5px;
    top: 5px;
    color: green;
    float: right;
}

.mandarinpay-field-state-error
{
    background: #fff0f0;
    border: 1px solid #900000;
}

.mandarinpay-field-state-focused
{
    background: #ffffff;
    border: 1px solid yellowgreen;
}

.mandarinpay-field-state-valid {
    background: #c0ffc0 !important;
    border: 1px solid green !important;
}

.mandarinpay-field-state-valid  .glyphicon{
    visibility: visible;
}

The Built payment form Hosted Fields enables you to do a full integration to your interface and there is no requirement for you to fit the PCI DSS bank cards’ safety standards.

Hosted Fields is based on forms with fields which actually are separate pages in iframes. Because of that, you can stylize everything around those iframes.

Logically, this form has 2 parts:

To start the work, you should add <script src="https://secure.mandarinpay.com/api/hosted.js"></script>, and then activate mandarinpay.hosted.setupgiving it the form selector and the call functions in case of an error (or a success). In the button press processor, you should contact the return mandarinpay.hosted.process(this); (instead of this you can contact the form selector).

As the operationId you should transmit the vaue which you received in the direct response from Mandarinpay in the jsOperationid - more

As the user interacts with the form the div might receive the classes mandarinpay-field-state-error, mandarinpay-field-state-focused , mandarinpay-field-state-valid.

Example:

screen

Stylization of the text fields

Stylization is done by adding an appropriate field into the object which is transmitted by the mandarinpay.hosted.setup. There is a placeholder for change and a couple of CSS styles

Example of a design

mandarinpay.hosted.setup("#form-hosted-pay",
{
    onsuccess: function(data) {alert("Success, id: " + data.transaction.id);},
    onerror: function(data) {alert("Error: " + data.error);},
    fields:
    {
        "card-number": {
            settings: {
                placeholder: "НОМЕР КАРТЫ",
                styles: {
                    "font-size": "20px",
                    "font-family": "Helvetica",
                    "color": "#0000c0"
                },
                placeholderStyles: {
                    "color": "pink"  
                },
            }
        }
    }
});

Those are available for use:

Card payments (receiving)

Transaction types

To make a transaction you need to send a POST request https://secure.mandarinpay.com/api/transactions

Transaction types and their descriptions and assignments are displayed at the table

Transaction type Description
Purchase Charge-off money from a credit card
Rebill Recurring payment, a repeated money charge-off based on the previously successful payment transaction or its blocking
Refund Cancel of the money charge-off from the credit card
Preauth Blocking (preauthorization) of a money sum on a credit card – unfinancial operation
ConfirmAuth Confirmation of the charge-off of the blocked (perauthorized) money sum on the credit card
Reversal Return of a blocked (p[erauthorized) money sum on the card

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id and asynchronously the call – back notification. Below is the call back notification description below

The money charge-off can be done in a one or two stage payment plan.

One stage Purchase

- Purchase

Creation of a transaction Purchase

POST на https://secure.mandarinpay.com/api/transactions
{
  "payment":
  {
    "orderId": "123321",
    "action": "pay",
    "price": "10",
    "orderActualTill": "2016-10-29 12:34:56+00:00"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725",
   "userWebLink": "https://secure.mandarinpay.com/Pay?transaction=0eb51e74-e704-4c36-b5cb-8f0227621518",
   "jsOperationId": "9874694yr87y73e7ey39ed80"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

For the money charge-off of cards with a one stage payment plan you need to create a transaction type Purchase by sending the POST request in https://secure.mandarinpay.com/api/transactions

The list and the description of possible blocks and the necessity of their transaction are listed below:

The Block PAYMENT

This block is necessary

Element Necessary Description
action yes For the creation of the transaction purchase the pay value is being transmitted
price yes Pay amount. It is necessary to transmit in the current version of the system.
orderId yes The order number in the client’s system
orderActualTill no The deadline of the product or service reservation. After the given data the payment is not possible.

The CUSTOMERINFO Block

This Block is necessary

Element Necessary Description
email yes Email
phone no The user’s phone number in this format Russian format +79999999999

The CUSTOMVALUES Block

This block is not necessary and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

This block is necessary

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback-notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

The transaction will be made in the asynchronous mode. Because of the request, you will synchronously receive the transaction id more, and asynchronously the Callback-notification more.

The userWebLink which you received in the synchronous answer, should be used for the payment page operations(more), for work with Hosted Fields. (more)

Two stage payment (Preauth, ConfirmAuth, Reversal)

- Preauth

Creation of a transaction Preauth

{
  "payment":
  {
    "orderId": "123321",
    "action": "preauth",
    "price": "10",
    "orderActualTill": "2016-10-29 12:34:56+00:00"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725",
   "userWebLink": "https://secure.mandarinpay.com/Pay?transaction=0eb51e74-e704-4c36-b5cb-8f0227621518",
   "jsOperationId": "9874694yr87y73e7ey39ed80"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request" 
}

The two stage payment assumes a primary system blocking of money on the credit card (preauth) and later its full or partially confirmation (ConfirmAuth).

If you do not confirm the money charge-off operation, the money will automatically unblocked after some time (7 to 30 days).

A compulsory unblock of the entire blocked system is possible. (Reversal)

To unblock the money in the two-stage payment plan you need to create a transaction of a Preauth type

The list and the description of possible blocks and request elements and the necessity of their transmission are listed below.

The block PAYMENT

This Block is necessary

Element Necessary Description
action Yes To create preauth transaction, the preauth value is being transmitted: for its confirmation - pay, and to unblock - reversal
price Yes Payment amount. It is necessary for transmission in the current system version.
orderId Yes The order number in the client’s system
orderActualTill No The deadline of the product or service reservation. After the given data the payment is not possible.

The CUSTOMERINFO block

*This block is necessary *

Element Necessary Description
email Yes Email пользователя
phone No Телефон пользователя в формате +79999999999 российского образца

Блок CUSTOMVALUES

*This block is not necessary * and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs.

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback-notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

The transaction will be made in the asynchronous mode. Because of the request, you will synchronously receive the transaction id more, and asynchronously the callback-notification here.

The userWebLink which you received in the synchronous answer, should be used for the payment page operations (here), and jsOperationId for work with Hosted Fields. (here)

After you receive the callback- -notification about a successful preauthorization, the Id you received can be used for full or partial money charge-off (action->pay), ), and also for money unblocking (action->reversal) through the REST API as a value for target->transaction

- ConfirmAuth

Creation of a transaction to bill the previously blocked sum ConfirmAuth

{
  "payment":
  {
    "orderId": "123321",
    "action": "pay",
    "price": "10"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target":
  {
    "transaction": "43913ddc000c4d3990fddbd3980c1725"
  }
}

For a full or partial charge-off use the action->pay and the Id you received as a notification about a successful preauthorization as a value for target->transaction

The price value can be of any amount which was transmitted in the initial transaction preauth

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

- Reversal

Creation of a transaction to unblock the previously blocked sum Reversal

{
  "payment":
  {
    "orderId": "123321",
    "action": "reversal"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target":
  {
    "transaction": "43913ddc000c4d3990fddbd3980c1725"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
    "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
    "error": "Invalid request" 
}

To unblock the preauthorized money use action->reversal and the Id you received in the notification about the successful authorization, as a value for the target->transaction

The transaction will be made in the asynchronous mode. Because of the request, you will synchronously receive the transaction id here, and asynchronously the callback-notification here.

Cancel of a successful payment (Refund)

Creation of a transaction Refund

{
  "payment":
  {
    "orderId": "123321",
    "action": "reversal",
    "price": "10"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target":
  {
    "transaction": "43913ddc000c4d3990fddbd3980c1725"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
    "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
    "error": "Invalid request"
}

To cancel a successful transaction (pay/rebill/confirmauth) use actiion->reversaland the Id from the previous transaction for target->transaction

It is possible to cancel the whole transaction and a part of it (partial cancellation). You can have an unlimited number of cancellations of the payment (within the amount of the payment).

The list and the description of possible blocks and request elements, as well as their necessity are listed below:

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes To cancel a successful payment transaction and to refund the money the reversal
price Yes Payment amount. It is necessary for the transmission in the current system version.
orderId Yes The order number in the client’s system.

Блок CUSTOMVALUES

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback-notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

The transaction will be made in the asynchronous mode. Because of the request, you will synchronously receive the transaction id here, and asynchronously the callback-notification here.

Recurring payments

A recurring payment (Rebill) - is a money charge-off operation without credit card details. The system already knows the data from the binding card or the blocking operation. оплаты/блокировки привязки карты (pay/preauth/rebill/confirmauth)

You can find more information about the use of recurring payment here

- Binded rebill

Creation of a transaction Rebill with a previously binded card

{
  "payment":
  {
    "orderId": "123321",
    "action": "pay",
    "price": "10"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target":
  {
    "card": "0eb51e74-e704-4c36-b5cb-8f0227621518"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

The list and the description of possible blocks and request elements and the necessity of their transmission are listed below:

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes ДFor the creation of the transaction rebill the pay value is being transmitted.
price Yes Pay amount. It is necessary to transmit in the current version of the system.
orderId Yes The order number in the client’s system.

Блок CUSTOMVALUES

*This block is not necessary * and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs.

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback–notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

To create another money charge off from the card use action->pay and the Id of the previously successful card binding for привязки карты target->card

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

- Successfull pay rebill

Creation of a repeated Rebill transaction based on a successfull purchase/preauth

{
  "payment":
  {
    "orderId": "123321",
    "action": "pay",
    "price": "10"
  },
   "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target":
  {
    "rebill": "43913ddc000c4d3990fddbd3980c1725"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
    "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
    "error": "Invalid request"  
}

POST at https://secure.mandarinpay.com/api/transactions

Apart from use of the binding card, rebill is possible based on any previous successful operation (pay/rebill/confirmauth)and money blocking (preauth) .

To create a repeated money charge-off use action->pay and the Id of the previously successful transaction (pay/preauth/rebill/confirmauth) for the target->rebill

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes For the creation of the transaction purchase the pay value is being transmitted reversal
price Yes Pay amount. It is necessary to transmit in the current version of the system.
orderId Yes The order number in the client’s system

The CUSTOMVALUES Block

*This block is not necessary * and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs.

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback-notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

Interactive payments

An interactive payment is a one with the use of the previously binding card with which a user interaction is made:The user has to type in the card’s CVV. To make a payment like that the Hosted Fields technology is used. Hosted Fields

That way, you can use the card, which is binding in the payout-only mode, and also full bindings to create operations like purchase and preauth.

Transactions are done in 2 stages:

  1. Interactive transaction initiation in the REST API - here
  2. Creating a transaction with use of Hosted Fields here

Init interactive request

Initiation of a transaction Purchase/Preauth

{
  "payment":
  {
    "orderId": "123321",
    "action": "pay/preauth",
    "price": "10"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target":
  {
    "card": "0eb51e74-e704-4c36-b5cb-8f0227621518"
  },
  "interactive": true
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725",
   "jsOperationId": "9874694yr87y73e7ey39ed80"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request" 
}

In this case, the interactive: true preference is added to the standard fields’ list of payments with binding card interactive: true The response will contain the id of the transaction and the id and jsOperationId to create a transaction through the Hosted Fields.

Transaction interactive request

Creation of a transaction with hosted fields

<form id="form-hosted-pay">
  <div style="margin: 10px; padding: 10px; border: 1px solid gray">
    CVV:
    <div class="mandarinpay-field-card-cvv hosted-field"><div class="glyphicon glyphicon-check"></div></div>
    <br/>
    <a href="#" onclick="return mandarinpay.hosted.process(this);" class="btn btn-default">Оплатить</a>
  </div>
</form>
<script>
mandarinpay.hosted.setup("#form-hosted-pay", {
  operationId: "9874694yr87y73e7ey39ed80",
  onsuccess: function(data) {
    alert("Success, id: " + data.transaction.id);
  },
  onerror: function(data) {
    alert("Error: " + data.error);
  }
});
</script>

The jsOperationId which is received in the synchronous response in the context of the previous request needs to be used to create a transaction through Hosted Fields. Unlike in the regular transaction creation procedure through Hosted Fields, in this case, you only need to transmit the CVV.

More information about the transaction creation through Hosted Fields can be found in the the relevant section .

Consumer finance payments

Testing

For testing, you need to send a request as a buyer and get it signed.

In general, this process looks as follows:

  1. A request sending for money lending
  2. Fill out the form in your personal profile.
  3. Waiting on the creditor’s decision on the purchase page.
  4. Choosing the right terms
  5. Card binding or paying the primary fee.
  6. The signing of the lended money by sms.

Initially, you will have a test crediting mode. That means, that the procedure will be the same as in the regular mode, but the lended money will be marked as test and no real money will be transferred on it.

In the test mode, you need to choose options with a primary payment. In this case, you need to use a real credit card, where 1 rouble will be blocked and you will have it returned after the signing. The testing mode of the initial fee is possible with the use of made-up personal card data. But for that, you need to turn your project into a test mode for credit card use. You need to contact the support center for it.

It is recommended to use the following data for testing:

Preference Data
Full Name Joe Johnson
Gender male
Date of birth 19.05.1975
Passport number 7709 543987
The issued authority The Migration authority of Moscow
Issued date 01.01.2011
Subdivision code 770-001
Address of residency Moscow, Mira avenue 111, f. 11
Employment Any

Application of the request (Paybyloan)

POST на https://secure.mandarinpay.com/api/transactions

The list and the description of possible blocks and the necessity of their transaction are listed below:

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes For the creation of the transaction purchase the pay value is being transmitted
price Yes Pay amount. It is necessary to transmit in the current version of the system discount
orderId Yes The order number in the client’s system
method Yes Для создания запроса на кредит/рассрочку передается значение credit
orderActualTill Yes The deadline of the product or service reservation. After the given data the payment is not possible.

The CUSTOMERINFO block

*This block is necessary *

Element Necessary Description
email Yes Email
phone Yes The user’s phone number in this format Russian format +79999999999

*The CUSTOMVALUES Block *

*This block is not necessary * and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs.

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback-notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

The METADATA block

This block is necessary. It enables to transmit additional information, which the buyer will see while filling out the credit in instalments form аs well as the information which we require for a proper request processing. The following fields are currently available:

Name of the preference Necessary Description
picture_url No Link to the product/service image
description No Product description (it is possible to use html-tags)
type Yes Request type - credit (value = credit ) or by instalments (value = installments )
discount Yes The discount amount, offered by the seller in the format of 0.00 from the purchase amount. In case, the =installments is necessary for transmission. If this field is absent, the value of type = installments will be ignored.
purchase_amount Yes The product price without counting the discount. In case, if the type=installments field is necessary for transmission. If this field is absent, the type = installments value will be ignored.

- Paybyloan credit request

Creation of a paybyloan credit request

{
  "payment":
  {
    "orderId": "123321",
    "action": "pay",
    "price": "10",
    "method": "credit",
    "orderActualTill": "2016-10-29 12:34:56+00:00"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "metadata": 
  {
    "picture_url": "http://yourdomain.ru/bestgood.png",
    "description": "It is a wonderful product! <br> There is nothing better and we recommend it to everybody!",
    "type": "credit"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
  "id": "43913ddc000c4d3990fddbd3980c1725",
  "userWebLink": "https://secure.mandarinpay.com/Pay?transaction=0eb51e74-e704-4c36-b5cb-8f0227621518"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

This method is used to create a request as a shop to sell a product/service as a credit.

The list and the description of possible blocks and the necessity of their transaction are listed above

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

Then you need to redirect the user onto the userWebLink, which you received in the synchronized response.

- Paybyloan installments

Creation of a paybyloan installment plan request

{
  "payment":
  {
    "orderId": "123321",
    "action": "pay",
    "price": "9.1",
    "method": "credit",
    "orderActualTill": "2016-10-29 12:34:56+00:00"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "metadata": 
  {
    "picture_url": "http://yourdomain.ru/bestgood.png",
    "description": "Это замечательный товар! <br> Лучше него ничего не бывает и мы его рекомендуем абсолютно всем!",
    "type": "installments",
    "discount": "0.10",
    "purchase_amount": "10"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
  "id": "43913ddc000c4d3990fddbd3980c1725",
  "userWebLink": "https://secure.mandarinpay.com/Pay?transaction=0eb51e74-e704-4c36-b5cb-8f0227621518"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

This method is used to create a request as a shop to sell a product/service as a credit.

The list and the description of possible blocks and the necessity of their transaction are listed above

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

Then you need to redirect the user onto the userWebLink, which you received in the synchronized response.

Payout payments

Balance check

Code example to check balance

<?php
$merchantId=0;

$secret='******';

$reqid = time() ."_". microtime(true) ."_". rand();
$hash = hash("sha256", $merchantId ."-". $reqid ."-". $secret);
$auth= $merchantId ."-".$hash ."-". $reqid;

$url_transaction = "https://secure.mandarinpay.com/api/account/channels/bank_voronezh/balance";
$ch = curl_init($url_transaction);

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
 "Content-Type: application/json",
 "X-Auth:" . $auth
));

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);

var_dump($result);
?>

This call enables you to check the account’s balance, from which you make the payouts.

To make this call you need to send the GET request to https://secure.mandarinpay.com/api/account/channels/{name}/balance

As a name value {name} you need to transmit the preference according to the table below:

Preference Preference description
bank_voronezh To request a balance of the account 30232, at the Vorenezh bank or the nominal account 99948, at the Matrix Bank SIberia

Card MoneySend

It can be done in 3 ways:

  1. A transaction to an already binding card
  2. Transmit the card’s number per API call
  3. Type in the card number on the payment page

- Binded-card payout

POST на https://secure.mandarinpay.com/api/transactions

Creation of a transaction MoneySend with a previously binded card

{
  "payment":
  {
    "orderId": "123321",
    "action": "payout",
    "price": "10"
  },
  "customerInfo":
  {
    "fullName": "Vasia Pupkin"
  },
  "senderInfo":
  {
    "fullName": "Ivan Petrov",
    "birthDate": "1970.01.01"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target":
  {
    "card": "0eb51e74-e704-4c36-b5cb-8f0227621518"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

The list and the description of possible blocks and the necessity of their transaction are listed below:

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes To create a transactio MoneySend передается transmit the payout value
price Yes Payment amount. Necessary to transmit in the current system version.
orderId Yes Order number in the client’s system. The value should be a unique one amongst successful operations.

The CUSTOMERINFO block

Element Necessary Description
fullName Yes/No Card owner. This field is necessary when transacting to foreign credit cards. It doesn’t support transactions onto Russian credit cards.

The SENDERINFO Block

Element Necessary Description
fullName Yes Sender’s name in Roman Alphabet
birthDate Yes Sender’s date of birth

The CUSTOMVALUES Block

*This block is not necessary * and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs.

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback -notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

To this regular API call the target block is added where as the the id of the previously successful card here.

- KnownCardNumber payout

POST на https://secure.mandarinpay.com/api/transactions

Creation of a transaction MoneySend with a known card number

{
  "payment":
  {
    "orderId": "123321",
    "action": "payout",
    "price": "10"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567",
    "fullName": "Vasia Pupkin"
  },
  "senderInfo":
  {
    "fullName": "Ivan Petrov",
    "birthDate": "1970.01.01"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target":
  {
    "knownCardNumber": "4012888888881881"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

The list and the description of possible blocks and the necessity of their transaction are listed below:

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes To create a transaction MoneySend transmit the payout value
price Yes Payment amount. Necessary to transmit in the current system version.
orderId Yes Order number in the client’s system. The value should be a unique one amongst successful operations.

The CUSTOMERINFO block

*This block is necessary *

Element Necessary Description
email Yes User’s Email
phone Yes Phone number in Russian format +79999999999
fullName Yes/No Card owner. ** This field is necessary when transacting to foreign credit cards. It doesn’t support transactions onto Russian credit cards.**

The SENDERINFO Block

Element Necessary Description
fullName Yes Sender’s name in Roman Alphabet
birthDate Yes Sender’s date of birth

The CUSTOMVALUES Block

*This block is not necessary * and allows to send any additional information with a payment. You can transfer up to 8 blocks of parameters.

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback -notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

To this regular API call the target block is added where the the id of the previously successful card binding is transmitted as the knowncardnumber where the money is transferred to. The ordered must be inique.

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

- payment page payout

POST запрос на https://secure.mandarinpay.com/api/transactions

Creation of a transaction MoneySend with card parameters input on the payment form

{
  "payment":
  {
    "orderId": "123321",
    "action": "payout",
    "price": "10"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567",
    "fullName": "Vasia Pupkin"
  },
  "senderInfo":
  {
    "fullName": "Ivan Petrov",
    "birthDate": "1970.01.01"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725",
   "userWebLink": "https://secure.mandarinpay.com/Pay?transaction=0eb51e74-e704-4c36-b5cb-8f0227621518"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

The card number must be typed in onto the payment page. Therefore, you need to redirect the user onto the userWebLink , which you received in the synchronous answer. The order ID must be unique.

The list and the description of possible blocks and the necessity of their transaction are listed below:

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes To create a transaction MoneySend передается transmit the payout value
price Yes Payment amount. Necessary to transmit in the current system version.
orderId Yes Order number in the client’s system. The value should be a unique one amongst successful operations.

The CUSTOMERINFO block

*This block is necessary *

Element Necessary Description
email Yes User’s Email
phone Yes Phone number in format +79999999999
fullName Yes/No Card owner. This field is necessary when transacting to foreign credit cards. It doesn’t support transactions onto Russian credit cards.

The SENDERINFO Block

Element Necessary Description
fullName Yes Sender’s name in Roman Alphabet
birthDate Yes Sender’s date of birth

The CUSTOMVALUES Block

*This block is not necessary * and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs.

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback -notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

Other payouts

- Phone MoneySend

POST на https://secure.mandarinpay.com/api/transactions

Creation of a transaction MoneySend to replenishment of a mobile phone balance

{
  "payment":
  {
    "orderId": "123321",
    "action": "payout",
    "price": "10"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target": "phone"
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

The list and the description of possible blocks and the necessity of their transaction are listed below:

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes To create a transaction MoneySend передается transmit the payout value
price Yes Payment amount. Necessary to transmit in the current system version.
orderId Yes Order number in the client’s system. The value should be a unique one amongst successful operations.

The CUSTOMERINFO block

*This block is necessary *

Element Necessary Description
email Yes User’s Email
phone Yes Phone number in Russian format +79999999999

Блок CUSTOMVALUES

This block is not necessary and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback -notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

To this regular API call the target block is added where the phone is transmitted as the value. The phone number is taken from the customerinfo . The order ID must be unique.

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

- MoneySend yandexMoney

POST на https://secure.mandarinpay.com/api/transactions

Creation of a transaction MoneySend to increase balance of Yandex.Money e-wallet

{
  "payment":
  {
    "orderId": "123321",
    "action": "payout",
    "price": "10"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target":
  {
    "yandexMoney": "123456789091"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

The list and the description of possible blocks and the necessity of their transaction are listed below:

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes To create a transaction MoneySend передается transmit the payout value
price Yes Payment amount. Necessary to transmit in the current system version.
orderId Yes Order number in the client’s system. The value should be a unique one amongst successful operations.

The CUSTOMERINFO block

*This block is necessary *

Element Necessary Description
email Yes User’s Email
phone Yes Phone number in Russian format +79999999999

Блок CUSTOMVALUES

This block is not necessary and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback -notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

To this regular API call the target block is added where the Yandex money wallet number is transmitted as theyandexmoney value. The phone number is taken from the customerinfo. The order ID must be unique.

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

- Webmoney (MoneySend webmoney)

POST на https://secure.mandarinpay.com/api/transactions

Creation of a transaction MoneySend to increase balance of a WebMoney e-wallet

{
  "payment":
  {
    "orderId": "123321",
    "action": "payout",
    "price": "10"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target":
  {
    "webMoney": "R111222333444"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

The list and the description of possible blocks and the necessity of their transaction are listed below:

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes To create a transaction MoneySend передается transmit the payout value
price Yes Payment amount. Necessary to transmit in the current system version.
orderId Yes Order number in the client’s system. The value should be a unique one amongst successful operations.

The CUSTOMERINFO block

*This block is necessary *

Element Necessary Description
email Yes User’s Email
phone Yes Phone number in Russian format +79999999999

Блок CUSTOMVALUES

This block is not necessary and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback -notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

To this regular API call the target block is added, where the Webmoney wallet number is transmitted as the Webmoney value (WMR, WMZ, WME). The order ID must be unique.

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

- Qiwi (MoneySend qiwi)

POST на https://secure.mandarinpay.com/api/transactions

Creation of a transaction MoneySend to increase balance of a QIWI e-wallet

{
  "payment":
  {
    "orderId": "123321",
    "action": "payout",
    "price": "10"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target":
  {
    "qiwi": "+79001234567"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

The list and the description of possible blocks and the necessity of their transaction are listed below:

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes To create a transaction MoneySend передается transmit the payout value
price Yes Payment amount. Necessary to transmit in the current system version.
orderId Yes Order number in the client’s system. The value should be a unique one amongst successful operations.

The CUSTOMERINFO block

*This block is necessary *

Element Necessary Description
email Yes User’s Email
phone Yes Phone number in Russian format +79999999999

Блок CUSTOMVALUES

This block is not necessary and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback -notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

To this regular API call the target block is added, where the qiwi wallet number is transmitted as the qiwi value. The order id must be unique.

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

- MoneySend bank-account

POST на https://secure.mandarinpay.com/api/transactions

Creation of a transaction MoneySend to a bank account

{
 "payment": {
  "action": "payout",
  "orderId": "123321",
  "price": "123",
  "reason": "A reason"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567",
    "firstName": "John",
    "middleName": "K.",
    "lastName": "Smith",
    "bankAccount":
    {
       "number": "40101810800000010041",
       "bic": "044583001"
    },
    "address": {
       "rawString": "Full address"
    }
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target": "bank-account"
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

The list and the description of possible blocks and the necessity of their transaction are listed below:

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes To create a transaction MoneySend передается transmit the payout value
price Yes Payment amount. Necessary to transmit in the current system version.
orderId Yes Order number in the client’s system. The value should be a unique one amongst successful operations.

The CUSTOMERINFO block

*This block is necessary *

Element Necessary Description
email Yes User’s Email
phone Yes Phone number in format +79999999999

Блок CUSTOMVALUES

This block is not necessary and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback -notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

You need to transmit the bank-account as your target .

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

- Unistream (MoneySend bestmt)

POST на https://secure.mandarinpay.com/api/transactions

Создание транзакции MoneySend для перевода через систему денежных переводов (ПС БЭСТ / Unistream)

{
  "payment":
  {
    "orderId": "123321",
    "action": "payout",
    "price": "10"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567",
    "firstName": "Василий",
    "middleName": "Иванович",
    "lastName": "Пупкин",
    "document":
    {
        "rfnspDocId": 21,
        "docSeria": "7709",
        "docNum": "543987",
        "docIssuer":  "УПРАВЛЕНИЕ ФЕДЕРАЛЬНОЙ МИГРАЦИОННОЙ СЛУЖБЫ РОССИИ ПО ГОР.МОСКВЕ",
        "docIssuerCode": "770-001",
        "docIssuingDate": "2011-01-01"
    },
    "birthDate": "1980-01-01",
    "birthPlace": "г. Москва",
    "countryCode": "643",
    "taxInfo":
    {
          "isRussianFederationTaxResident": true
    }
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
    "target": "bestmt"
}

Ответ в случае успешного создания транзакции (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725"
}

Ответ в случае, если транзакция не создана (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

The list and the description of possible blocks and the necessity of their transaction are listed below:

The PAYMENT Block

*This block is necessary *

Element Necessary Description
action Yes To create a transaction MoneySend передается transmit the payout value
price Yes Payment amount. Necessary to transmit in the current system version.
orderId Yes Order number in the client’s system. The value should be a unique one amongst successful operations.

The CUSTOMERINFO block

*This block is necessary *

Element Necessary Description
email Yes User’s Email
phone Yes User’s phone number in Russian format +79999999999
firstName Yes User’s name
middleName Yes User’s middle name
lastName Yes User’s last name
rfnspDocId Yes Document type of a Russian classifier
docSeria Yes Document‘s series
docNum Yes Document’s number
docIssuer Yes The authority, which handed the document
docIssuerCode Yes The authority’s code, which handed the document
docIssuingDate Yes The issue date of the recipient’s document
birthDate Yes The birth date of the recipient
birthPlace Yes The Birth place of the recipient
countryCode Yes The country code of the recipient
isRussianFederationTaxResident Yes Is the recipient a Russian tax resident. true/false

Блок CUSTOMVALUES

This block is not necessary and it enables to transmit any additional information with the payment. You can transmit up to 8 preferences’ pairs

Element Necessary Description
name No The preference’s headline is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.
value No The preference’s value is used for binding of additional information to the payment data. If used, it is displayed in the right block of the payer’s payment page.

Block URLS

*This block is not necessary *

This block enables to transmit links for the sending of the callback-notification and the user return from the payment page after the payment.

Element Necessary Description
callback No Url for the callback -notification sending in the “transaction” status
return No Url for the redirect of the user after the payment

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

Wallet API

Wallet creation

POST https://secure.mandarinpay.com/api/wallets

Request to create an e-wallet

{
  "type": "person",
  "person":
  {
    "phone": "+71234567890",
    "fullName": "Иван Иванович Иванов",
    "document":
    {
      "docSeria": "7709",
      "docNum": "543987"
    },
    "innul": "123456789012",
    "snils": "123-456-789 00"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "6c971545-2dbe-466d-8306-f026b6f07b7c"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

This request is synchronous and you get the wallet’s ID in response.

Check wallet balance

Creation of a request to check a wallet balance

GET https://secure.mandarinpay.com/api/wallets/{id}/balance

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
  "USD": 100500
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

The request is synchronous and you get the wallet’s balance in response.

Wallet payin

POST https://secure.mandarinpay.com/api/transactions

Creation of a request to increase a balance of an e-wallet with a banking card.

{
  "payment":
  {
    "orderId": "123321",
    "action": "pay",
    "price": "10",
    "destinationWallet": "6c971545-2dbe-466d-8306-f026b6f07b7c"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725",
   "userWebLink": "https://secure.mandarinpay.com/Pay?transaction=0eb51e74-e704-4c36-b5cb-8f0227621518",
   "jsOperationId": "9874694yr87y73e7ey39ed80"
}

You can use any payment calls to put money onto the wallet by adding the destinationWallet preference to the payment block. In this example a credit card with a user’s given data is used.

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

The userWebLink received in the synchoronous response should be used to work with the (here), а jsOperationId to work through Hosted Fields (here)

Wallet payout

POST https://secure.mandarinpay.com/api/transactions

Creation of the request to send money from e-wallet balance to the previously binded card

{
  "payment":
  {
    "orderId": "123321",
    "action": "payout",
    "price": "10",
    "sourceWallet": "6c971545-2dbe-466d-8306-f026b6f07b7c"
  },
  "customerInfo":
  {
    "email": "[email protected]",
    "phone": "+79001234567"
  },
  "customValues":
  [
    {"name": "custom field 0", "value": "123321"},
    {"name": "custom field 1", "value": "123321"}
  ],
  "urls":
  {
    "callback": "http://...",
    "return": "http://..."
  },
  "target":
  {
    "card": "0eb51e74-e704-4c36-b5cb-8f0227621518"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

To put some money onto the wallet, you can use any calls related to the card transactions,by adding the sourceWallet preference into the payment block. Use the Id the previously binding card as the card value in this example. binding card

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

Wallet transfer

POST `https://secure.mandarinpay.com/api/transactions`
{
  "payment":
  {
    "orderId": "123321",
    "action": "pay",
    "price": "10",
    "sourceWallet": "6c971545-2dbe-466d-8306-f026b6f07b7c",
    "destinationWallet": "6c971545-2dbe-466d-8306-f026b6f07b7c"
  }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

All transactions are made in unsynchronized mode. As a result of the request, you would synchronously get the transaction id here, and asynchronously the callback-notification here.

Card binding

Card binding is used to charge-off or to credit without the user’s interaction. Also to check if the user has the access to this card (a test money charge-off, a check through 3DS)

Types of bindings and a short description are shown in the table

Binding’s types Description
full binding A full card binding
one-side binding A One-sided card binding

To make the transactions shown above you need to send the POST request to https://secure.mandarinpay.com/api/card-bindings

Full binding

POST запрос на https://secure.mandarinpay.com/api/card-bindings

Card binding creation

{
    "customerInfo":
    {
        "email": "[email protected]",
        "phone": "+79001234567"
    }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725",
   "userWebLink": "https://secure.mandarinpay.com/Pay?transaction=0eb51e74-e704-4c36-b5cb-8f0227621518",
   "jsOperationId": "9874694yr87y73e7ey39ed80"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

A blocking of 1 rouble with a later unblock. (preauth) This operation is done with 3DSecure.

After you receive the callback-notification about the successful card binding, you can use automatic payments. here

The list and the description of possible blocks and the necessity of their transaction are listed below:

The CUSTOMERINFO block

*This block is necessary *

Element Necessary Description
email Yes User’s Email
phone Yes Phone number in Russian format +79999999999

The transaction will be in asynchronous mode. As a result of the request, you will synchronously get the transaction’s id hereand asynchronously you will receive the callback notification here.

The userWebLink received in the synchronous response, can be used to work with the payment page and jsOperationId to work through Hosted Fields (here)

0 balance card binding (payout-only)

It is possible to bind the card in the payout only mode if the user’s balance is zero (error 51 after checking with 3D Secure) (status=payout-only in callback-notification). Such a card can be used for transactions or payment in interactive mode. (here).

To set this up contact the programmers at Mandarinpay.

Saving the card number (one-side binding)

Creation of a request to save a card number

{
    "customerInfo":
    {
        "email": "[email protected]",
        "phone": "+79001234567"
    },
  "target":
    {
      "knownCardNumber": "4012888888881881"
    }
}

Response on a successfull creation of the transaction (Standard HTTP 200 JSON response):

{
   "id": "43913ddc000c4d3990fddbd3980c1725"
}

Response on an unsuccessfull creation of the transaction (Standard HTTP 400 Bad request):

{
   "error": "Invalid request"  
}

This call is a tokenization of the card number and it is used to store your card number in the system. This operation is done in synchronous mode and you can the bindings id in response..

In comparison to the previous call, the binding may only be used for sending money to your card. (action=payout)

Binding card usage

A binding card may be later used for:

  1. Recurring payments (automatic card charge-offs) - here
  2. Card charge-offs interactive mode. In this case the user has to type in his CVV. - here
  3. Automatic card transations. - here

XML API MandarinInfo

This protocol is used for requests in the MandarinInfo system.

xml api endpoints

End points for real API requests - https://id01.mandarinpay.com/infoapi

End points for test API request - https://id01.mandarinpay.com/infoapi_test

Request sending methods

Request example through cURL

curl_setopt($ch, CURLOPT_INFILE, $xml); 
curl_setopt($ch, CURLOPT_INFILESIZE, 
strlen($xml)); curl_exec($ch);

The transmission of XMLrequests to the sluise can be done in 2 ways:

$ch – descriptor cURL;

$xml – the variable, which already contains the formed XML request.

The control money amount (hash)

For the user’s identification API additional preferences are used - product and hash , transmitted in the request as sub elements of the request element.

Preference Example Description
product 000001-0001-0001 User’s identificator API (of the client) in the Mandarinpay system
hash 1d2a5a126bfc3ad88435c1628b0d314a33e95802 Control money amount

The control money amount is calculated like that md5('secret-opcode-product')

Preference Example Description
secret 24t5fRTGH Code phrase, which both sides of the party know
opcode 752 Identifier of the request
product 000001-0001-0001 Identifier of the request

To see the right hash value, use our online service.

Bank card emission (co-branding)

- Fields and their descriptions (general items)

Set of the used fields:

Preference Necessity Description
Family Yes Last name
Name Yes First name
Patronim Yes Middle name
Sex Yes gender( муж, жен)
Patronim Yes Middle name
BirthDay Yes Date of Birth YYYY-MM-DD
BirthPlace Yes Place of Birth (text line in Russian)
Email Yes Email
Phone Yes Mobile phone number in the +79091000000 format
Document Yes The person’s document, contents and sub elements are listed below
RFNSPDocid Yes Identifier of the document type according to the classification. Check the Russian tax law number 1,2 ,3 ,8 and 25.
Docseria Yes Document series without blanks
Docnum Yes Document number without blanks
Docissuingdate Yes Date of the document issue in the format of YYYY-MM-DD
Docissuer Yes The authority’s name which issued the docum
Docissuercode Yes The authority’s unit code, which issued the document
Card Yes Data about the card; contents, sub elements are listed below
num Yes PAN card number without the blanks
passphrase Yes Code phrase
Address Yes The address of the card resipient, sub elements are listed below.
rupostindex Yes Index
kladrstreet Yes Identifier of the Kladr. If there is no street type in the settlement name.
house Yes House number
flat No Flat number

- Request for card activation (opcode 752)

Card activation request:

<?xml version="1.0" encoding="utf-8"?> 
<request>
<Opcode>752</Opcode> 
<Product>000001-0001-0001</Product> 
<hash>683419922c51c2c1edc367fae6ae39b0</hash> 
<source>503</source>
<Person>
  <Family>Шариков</Family> 
  <Name>Полиграф</Name> 
  <Patronim>Полиграфович</Patronim> 
  <Sex>муж</Sex> 
  <BirthDay>1975-05-19</BirthDay> 
  <BirthPlace>Москва</BirthPlace> 
  <Email>[email protected]</Email> 
  <Phone>+79091000000</Phone> 
  <Document>
    <RFNSPDocid>21</RFNSPDocid>
    <Docseria>7709</Docseria>
    <Docnum>543987</Docnum>
    <Docissuingdate>2011-01-01</Docissuingdate>
    <Docissuer>УПРАВЛЕНИЕ ФЕДЕРАЛЬНОЙ МИГРАЦИОННОЙ СЛУЖБЫ РОССИИ ПО ГОР.МОСКВЕ</Docissuer>
    <Docissuercode>770-001</Docissuercode> 
  </Document>
  <Address>
    <rupostindex>125047</rupostindex> 
    <kladrstreet>77000000000254200</kladrstreet> 
    <house>10</house>
    <flat>50</flat>
  </Address>
  <Card>
    <num>6705721234567895</num>
    <passphrase>Шарик</passphrase> 
  </Card>
</Person> 
</request>

Response on a successfull activation:

<?xml version="1.0" encoding="utf-8"?> 
<response>
<code>1100</code> 
<hash>2135417f4aac4896ae4464a6eabfab07</hash> 
<entities>
  <provider_desc>Проведен</provider_desc> 
  <actionName>FINDPAY</actionName> 
  <billNumber>8827044265228463343</billNumber> 
  <provider_code></provider_code> 
  <result_desc>Проведен</result_desc> 
  <result_finish>true</result_finish> 
  <result_code>1</result_code>
</entities>
<request_id>478</request_id> 
<date>2016-07-15T06:31:34+00:00</date> 
<message>OK</message>
</response>

Response on an unsuccessfull activation:

в поле <provider_desc> и <result_desc> the reason of the fail
<?xml version="1.0" encoding="utf-8"?> 
<response>
<code>1100</code> 
<hash>eb4c9665c85a4567af1a486c91ec58cd</hash>
<entities>
  <provider_desc>No card finded</provider_desc> 
  <actionName>FINDPAY</actionName> 
  <billNumber>7582787236450035160</billNumber> 
  <provider_code>2</provider_code> 
  <result_desc>Wrong client number</result_desc> 
  <result_finish>true</result_finish> 
  <result_code>-20140</result_code>
</entities>
<request_id>479</request_id> 
<date>2016-07-15T06:33:05+00:00</date> 
<message>OK</message>
</response>

Sometimes the bank needs more time to process the activation. The reply will be in this case:

<?xml version="1.0" encoding="utf-8"?> 
<response>
<code>1100</code> 
<hash>2135417f4aac4896ae4464a6eabfab07</hash> 
<entities>
  <provider_desc>Платеж в обработке</provider_desc> 
  <actionName>FINDPAY</actionName> 
  <billNumber>8827044265228463343</billNumber> 
  <provider_code></provider_code> 
  <result_desc>Платеж в обработке</result_desc> 
  <result_finish>true</result_finish> 
  <result_code>20002</result_code>
</entities>
<request_id>478</request_id> 
<date>2016-07-15T06:31:34+00:00</date> 
<message>OK</message>
</response>

- A repeated status request (opcode 751)

If you get the payment in process status, repeat a request till you get the response about the success or failure of the operation.

Repeated request of a status

<?xml version="1.0" encoding="utf-8"?> 
<request>
<Opcode>751</Opcode> 
<Product>111111-1111-0001</Product> 
<hash>aaf81e42d03b4034e1b128d1d081f1b9</hash> 
<source>503</source>
<request_id>478</request_id>
</request>

Response on a successfull operation:

<?xml version="1.0" encoding="utf-8"?> 
<response>
<code>1100</code> 
<hash>2135417f4aac4896ae4464a6eabfab07</hash> 
<entities>
  <provider_desc>Проведен</provider_desc> 
  <actionName>FINDPAY</actionName> 
  <billNumber>8827044265228463343</billNumber> 
  <provider_code></provider_code> 
  <result_desc>Проведен</result_desc> 
  <result_finish>true</result_finish> 
  <result_code>1</result_code>
</entities>
<request_id>478</request_id> 
<date>2016-07-15T06:31:34+00:00</date> 
<message>OK</message>
</response>

Response on an unsuccessfull operation:

в поле <provider_desc> и <result_desc> сthe reason of the fail
<?xml version="1.0" encoding="utf-8"?> 
<response>
<code>1100</code> 
<hash>eb4c9665c85a4567af1a486c91ec58cd</hash>
<entities>
  <provider_desc>The card was not found</provider_desc> 
  <actionName>FINDPAY</actionName> 
  <billNumber>7582787236450035160</billNumber> 
  <provider_code>2</provider_code> 
  <result_desc>Wrong client number</result_desc> 
  <result_finish>true</result_finish> 
  <result_code>-20140</result_code>
</entities>
<request_id>479</request_id> 
<date>2016-07-15T06:33:05+00:00</date> 
<message>OK</message>
</response>

Simplified identification СМЭВ (id-smev)

- Field and their description (generall items)

The set of used fields:

Preference Level Description
Family 1 Last Name
Name 1 First name
Patronim 1 Middle name
SNILS 1 Snils number
Phone 1 Mobile phone number in the format of +79091000000
Document 1 Person’s document. Contents and sub elements are listed below.
RFNSPDocid 2 Always 21, as the Russian Passport
Docseria 2 Document series without blanks
Docnum 2 Document number without blanks

A simplified identification with Smav is done in two stages:

- Identification request (opcode 761)

Request format

<?xml version="1.0" encoding="utf-8"?>
<request>
<Opcode>761</Opcode>
<Product>111111-1111-0001</Product>
<hash>2a7e6c16927a0c2ec729bc901bf4fdbb</hash>
<source>205</source>
<Person>
  <Family>Иванов</Family>
  <Name>Иван</Name>
  <Patronim>Иванович</Patronim>
  <SNILS>98765432101</SNILS>
  <Phone>+79091001216</Phone>
  <Document>
    <RFNSPDocid>21</RFNSPDocid>
    <Docseria>7701</Docseria>
    <Docnum>123456</Docnum>
  </Document>
</Person>
</request>

Response on a successfull operation:

<?xml version="1.0" encoding="utf-8"?>
<response>
  <date>2016-04-26T17:33:37+00:00</date>
  <message>OK</message>
  <code>1100</code>
  <request_id>[ID для следующих операций]</request_id>
  <pincodeformat>[формат кода, отправленного на телефон Phone посредством SMS]</pincodeformat>
</response>

In case of a failure response code is different from 1100, and message includes failure info.

It initiates a simplified personal ID with Smav according to the 115th laws of the Russian code.

It requires resource data with which identification takes place. In the current identification it looks like this source_group_id = 3 и source = 205.

- Transmission of the entered pincode (opcode 762)

Request format

<?xml version="1.0" encoding="utf-8"?>
<request>
  <Opcode>762</Opcode>
  <Product>111111-1111-0001</Product>
  <hash>48822176d8aa2b5fc36726f00504b219</hash>
  <source>205</source>
  <request_id>[ID запроса, выданный в ответе на опкод 761]</request_id>
  <pincode>[введенный пользователем код подтверждения] </pincode>
</request>

Response on a successfull operation:

<?xml version="1.0" encoding="utf-8"?>
<response>
  <date>2016-04-26T17:33:37+00:00</date>
  <message>OK</message>
  <code>1100</code>
  <request_id>[ID]</request_id>
  <reply>
    <person_valid>[true/false]</person_valid>
    <passport_valid>[true/false]</passport_valid>
    <snils_valid>[true/false]</snils_valid>
  </reply>
</response>

In case of a failure response code is different from 1100, and message includes failure info.

The confirmation code, which the user receives is getting checked and according to the results the identification gets confirmed (or not).

This opcode requires exact data with which the identificartion takes place. Currently it is done as follows source_group_id = 3 и source = 205.

The person_valid will have the True value in case of a successful personal identification. The elements passport_valid и snils_valid will be equal to True in this case.

If the personal identification fails (person_valid is equal to False) these elements are used to identify the reason for error (wrong passport or Snils).

CMS Plugins

In case, the required plugin is absent, contact the Support center, and we will think about what we can do.

Diafan CMS

New Version

Old version

Joomla

Joomla3.4 VirtueMart3

joomla2.5 JoomShopping3

joomla3 JoomShopping4

Old version VirtueMart

CS-CART

Download plugin

Bitrix

Download plugin

Drupal Ubercart

Download plugin

Magento

Download plugin

ModX

ModX Revo

ModX Evo

Old version

Opencart

Opencart 1

Opencart 2

PHP Shop

Download plugin

Prestashop

Download plugin

Old version

Simpla

Download plugin

UMI.CMS

Download plugin

Webasyst

Download plugin

Wordpress

Download plugin

Old version

Insales

You should register the client in our system on our website https://mandarinpay.com.

Then in the Insales you need to add a new payment method – the external payment method. In the pop up menu you should type in:

  1. merchantid as a shop identifier,
  2. The value secret as the password,
  3. http://insales.mandarinpay.com/mandarin_proxy.php as the outer link

Then you need to type in the link which you used in case of successful payment as the value of callbackurl

Article in our database about merchantid, secret and callbackurl