DengiOnline

2018-04-26 03:00:17

Cash transfers

NOTE! The amount paid by user may differ from the invoiced amount.  

Cash transfer systems include the following payment modes: 

  • Rapida (mode_type=54)

  • Euroset kiosks (mode_type=62)

When creating invoice for a payment through the systems listed above, the request along with the usual mandatory and optional parameter should also include 2 more obligatory parameters — xml and md5.

Mandatory parameters for cash transfer invoicing

Parameter Description Format Mandatory

xml

Response method ID

1

Yes

md5

Request signature. Formed as hash using md5 algorithm. Consists of the following parameters (concatenated):

  • Project secret key

  • Project ID in the System

  • amount parameter value without zeros after the point

  • mode_type parameter value

  • order_id parameter value

md5(secret key.project.floatval(amount).mode_type.order_id)

Yes

After processing the data provided by the Project the System sends a response in XML format containing the following nodes:

Parameter Description Format

status

Invoicing status code

0 - request is successful, -1 - request failed

comment

Status comment and the list of all errors

string

ODpaymentData

Invoice details, if invoicing was successful. Invoice details should be displayed to the user in order to conduct the payment.

The ODpaymentData node includes DataForUser tags with the invoice details in the following format: <DataForUser title=”Parameter name” value=”Parameter value" />.

Response example (success)

<?xml version="1.0" encoding="UTF-8"?>
<response>
	<status>0</status>
	<comment>Request was processed successfully</comment>
	<ODpaymentData>
		<DataForUser title="Payment receiver" value="DengiOnline" />
		<DataForUser title="Payment number" value="3672080" />
	</ODpaymentData>
</response>

Response example (failure)

<?xml version="1.0" encoding="UTF-8"?>
<response>
	<status>-1</status>
	<comment><![CDATA[Payment amount is invalid]]></comment>
</response>

Request example for cash transfer invoicing (PHP)

<?php 
$secret = 'XXXXXX'; 
$vars = array( 
	'project' => 123, 
	'nickname' => 'payment to test project', 
	'order_id' => '123456', 
	'amount' => 10, 
	'paymentCurrency' => 'RUB',
/*  * To create invoice for another system you need to  * change the mode_type parameter value: * 54 - Rapida * 62 - Euroset */ 
	'mode_type' => 62, 
	'xml' => 1, 
); 
 
$vars['md5'] = md5($secret.$vars['project'].floatval($vars['amount']).$vars['mode_type'].$vars['order_id']); 
 
$ch = curl_init('https://www.onlinedengi.ru/wmpaycheck.php'); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $vars); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
curl_setopt($ch, CURLOPT_HEADER, 0); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
$res = curl_exec($ch); 
curl_close($ch); 
?>