<?php
$pass='***************';
$params['card_exp_monthaction'] = '11DEBIT_PREPARE';
$params['cardclient_exp_yearkey'] = '1111'******';
$params['cardorder_cvv2id'] = '111'Platon_test_37254'.rand(100, 999);
$params['payerorder_first_nameamount']='Jack10.00';
$params['payerorder_last_namecurrency']='AndersonUAH';
$params['payerorder_phonedescription']='380962111111test_by_Platon';
$params['payercard_addressnumber'] = 'NA1111111111111111';
$params['payercard_exp_countrymonth'] = 'UA11';
$params['payercard_exp_stateyear'] = 'NA1111';
$params['payercard_citycvv2'] = 'NA111';
$params['payer_zipfirst_name']='01001Jack';
$params['payer_emaillast_name']='test@test.comAnderson';
$params['payer_ipphone']='111.111.111.111380962111111';
$params['termpayer_url_3dsaddress']='https://google.comNA';
$params['signaturepayer_country'] = sha1($pass . strtolower(implode('', $params)));
$url = 'https://secure.platononline.com/p2p-debit/'UA';
$params['payer_state']='NA';
$params['payer_city']='NA';
$params['payer_zip']='01001';
$tempData = array()$params['payer_email']='test@test.com';
$params['payer_ip']='111.111.111.111';
foreach ($params as $key => $value) {
$tempData[] = $key.'='.urlencode($value)$params['term_url_3ds']='https://google.com';
$params['signature'] = sha1($pass . strtolower(implode('', $params)));
$url = 'https://secure.platononline.com/p2p-debit/';
}
$crq $tempData = curl_initarray();
curl_setopt($crq, CURLOPT_URL, $url);
curl_setopt($crq, CURLOPT_HEADER, 0);
curl_setopt($crq, CURLOPT_RETURNTRANSFER, 1foreach ($params as $key => $value) {
$tempData[] = $key.'='.urlencode($value);
}
$crq = curl_init();
curl_setopt($crq, CURLOPT_SSL_VERIFYHOSTURL, 0$url);
curl_setopt($crq, CURLOPT_SSL_VERIFYPEERHEADER, 0);
curl_setopt($crq, CURLOPT_POSTFIELDSRETURNTRANSFER, implode('&', $tempData));
1);
$result = curl_execsetopt($crq);
if (curl_errno($crq)) {
echo 'ERROR: '.curl_error($crq);
}
curl_, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($crq, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($crq, CURLOPT_POSTFIELDS, implode('&', $tempData));
$result = curl_exec($crq);
if (curl_errno($crq)) {
echo 'ERROR: '.curl_error($crq);
}
curl_close($crq);
echo $result;
$moda = json_decode($result, true);
$pars['action']='DEBIT_RUN';
$pars['client_key']='*******';
$pars['trans_id']=$moda['trans_id'];
$pars['card_cvv2']='111';
$pars['signature']= sha1($pass . strtolower(implode('', $pars)));;
$temp = array();
foreach ($pars as $key => $value) {
$temp[] = $key.'='.urlencode($value);
}
$crq = curl_init();
curl_setopt($crq, CURLOPT_URL, $url);
curl_setopt($crq, CURLOPT_HEADER, 0);
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, implode('&', $temp));
$res = curl_exec($crq);
if (curl_errno($crq)) {
echo 'ERROR: '.curl_error($crq);
}
curl_close($crq);
echo $res;
$respRedirect = json_decode($res, true);
echo $respRedirect['redirect_url'];
header('Location: '.$respRedirect['redirect_url']);
?> |