DengiOnline

2017-07-29 03:29:14

Alfa-Click

When creating invoice for a payment through the Alfa-Click system the mode_type parameter should have the value provided by the technical specialists during the integration.

Also 3 more mandatory parameters are added to the usual parameter list

Parameter Description Format Mandatory

mode_type

Payment mode ID

Provided by the System specialists Yes

xml

Response method ID

1 Yes

AlfaClickUserID

User ID in the Alfa-Click system (coincides with the user login in the Alfa-Click system)

interger (16) 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

url

Alfa-Click Payment System URL-address to which the Project can redirect users after successful invoicing.

 

NOTE! Due to the Alfa-Click features the invoice confirmation may take up to 50 second.

Response example (success)

<?xml version="1.0" encoding="UTF-8"?>
<response>
       <status>0</status>
       <comment><![CDATA[Request was processed successfully]]></comment>
       <ODpaymentID>265631332</ODpaymentID>
       <url>https://click.alfabank.ru/ALFAIBSR/</url>
</response>

Response example (failure)

<?xml version="1.0" encoding="UTF-8"?>
<response>
	<status>-1</status>
	<comment><![CDATA[Invalid ID for the Alfa-Click system]]></comment>
	<ODpaymentID>265631508</ODpaymentID>
	<url>https://click.alfabank.ru/ALFAIBSR/</url>
</response>

Background invoicing example for the Alfa-Click system (PHP)

<?php 
$requestVars = array(
	'project' => 294, 
	'nickname' => 'alip', 
	'amount' => 12, 
	'mode_type' => NN, 
	'xml' => 1, 
	'AlfaClickUserID' => 123456, 
	'paymentCurrency' => 'RUB'
); 
 
$ch = curl_init('https://www.onlinedengi.ru/wmpaycheck.php'); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($requestVars)); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
$result = curl_exec($ch); 
print_r($result); 
?>