<?php
$client_pass = '***';
$client$data['client_key'] = '***';
$action$data['action'] = 'CREDITVOID';
$trans$data['trans_id'] = '19848-26243-92097';
$amount$data['amount'] = '85.00';
$card = '41111111111111111';
$email = ''; // пошта з транзакції $hashоплати, якщо була вказана
$data['hash'] = md5(
strtoupper(
$client_pass.
$trans$data['trans_id']
)
);
$curl$url = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "'https://secure.platononline.com/post-unq/",';
$crq = CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array('action' => 'CREDITVOID','client_key' => $client_key, 'trans_id' => $trans_id,'amount' => $amount,'hash' => $hash),
CURLOPT_HTTPHEADER => array("Content-Type: text/html"),
));
$response = curl_exec($curl);
curl_close($curl);
echo $responsecurl_init();
curl_setopt($crq, CURLOPT_URL, $url);
curl_setopt($crq, CURLOPT_HEADER, 0);
curl_setopt($crq, CURLOPT_POST, 1);
curl_setopt($crq, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($crq, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($crq, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($crq, CURLOPT_POSTFIELDS, http_build_query($data));
$result = curl_exec($crq);
if (curl_errno($crq)) {
echo 'ERROR: '.curl_error($crq);
}else{
echo $result;
}
curl_close($crq); |