DengiOnline

2018-04-26 03:00:16

QIWI-Wallet

When invoices are created in the background the mode_type parameter acquires special value — mobilePayment.

For such procedures also three mandatory parameter is added to the usual list.

Parameter Description Format Mandatory

mode_type

Background payment mode ID

mobilePayment

Yes

sendQIWIPayment

QIWI-Wallet Payment System ID

1

Yes

qiwi_phone

Wallet number with the country code

string,
e.g.: +79211234567

Yes

md5

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

  • Project secret key

  • Project ID in the System

  • nickname parameter value

  • amount parameter value

  • qiwi_phone parameter value

  • Project secret key

md5(strtolower(secret
key.project.nickname.
floatval(amount).phone.secret key))

Yes

After processing the data provided by the Project the System sends a response in UTF-8 encoded 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

ODpaymentID

Payment ID in the System in case of successful payment

integer

Response example (success)

<?xml version="1.0" encoding="UTF-8"?>
<response>
	<status>0</status>
	<comment>Request was processed successfully</comment>
	<ODpaymentID>3386642</ODpaymentID>
</response>

Response example (failure)

<?xml version="1.0" encoding="UTF-8"?> 
<response>
	<status>-1</status>
	<comment><![CDATA[Incorrect security signature]]></comment>
</response>

Request example for QIWI-Wallet invoicing (PHP)

<?php 
$secret = 'XXXXXXX'; 
$vars = array( 
	'project' => 123, 
	'nickname' => 'payment to test project', 
	'mode_type' => 'mobilePayment', 
	'amount' => 100, 
	'qiwi_phone' => '9211234567', 
	'sendQIWIPayment' => 1,
	'paymentCurrency' => 'RUB'
); 

$vars['md5'] = $vars['md5'] = md5(strtolower($secret.$vars['project'].$vars['nickname'].floatval($vars['amount']). $vars['qiwi_phone'].$secret)); 

$vars = http_build_query($vars); 

$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); 
?>