<?php
$pass='***************';
$params['card_cvv2action'] = '111DEBIT_PREPARE';
$params['payerclient_first_namekey']='Jack******';
$params['payerorder_last_nameid']='Anderson'Platon_test_37254'.rand(100, 999);
$params['payerorder_phoneamount']='38096211111110.00';
$params['payerorder_addresscurrency']='NAUAH';
$params['payerorder_countrydescription']='UAtest_by_Platon';
$params['payercard_statenumber'] = 'NA1111111111111111';
$params['payercard_exp_citymonth'] = 'NA11';
$params['payercard_exp_zipyear'] = '010011111';
$params['payercard_emailcvv2'] = 'test@test.com111';
$params['payer_first_ipname']='111.111.111.111Jack';
$params['termpayer_urllast_3dsname']='https://google.comAnderson';
$params['signaturepayer_phone'] = sha1($pass . strtolower(implode('', $params)))'380962111111';
$params['payer_address']='NA';
$params['payer_country']='UA';
$url = 'https://secure.platononline.com/p2p-debit/$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']);
?> |