php login VladykaAndrey ya ru password wYSVe6SxcSl3VQzHZe8P amount 30

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
$login = 'VladykaAndrey@ya.ru';
$password = 'wYSVe6SxcSl3VQzHZe8P';
$amount = '30'; //30 rur test paid
$ch = curl_init();
$tmpcook = 'tmpcook/' . time() . '-' . rand(1000, 9999) . '.cook';
curl_setopt_array($ch, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
//CURLOPT_FOLLOWLOCATION => true,
CURLOPT_COOKIEFILE => $tmpcook,
CURLOPT_COOKIEJAR => $tmpcook,
CURLOPT_URL => 'https://reg.2domains.ru/login.php',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => array(
'email' => $login,
'passwd' => $password,
'login' => null
)
));
curl_exec($ch); //create 2domains session
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt_array($ch, array(
CURLOPT_URL => 'https://reg.2domains.ru/billing/pay.php',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => array(
'amount' => $amount,
'pay_system_type' => 'RC',
'pay' => null
)
));
$res = curl_exec($ch);
preg_match('/InvId" value="(\d+)"/', $res, $inv);
preg_match('/SignatureValue" value="([0-9a-f]+)"/', $res, $signature);
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt_array($ch, array(
CURLOPT_URL => 'https://2domains.ru/payment/index.php',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => array(
'OutSum' => $amount,
'InvId' => $inv[1],
'SignatureValue' => $signature[1],
'Email' => $login,
'PanelId' => '1',
'phone1' => '',
'address1' => '',
'city' => '',
'zip' => ''
)
));
curl_exec($ch);
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt_array($ch, array(
CURLOPT_URL => 'https://2domains.ru/payment/init.php',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => array(
'order_id' => $inv[1],
'panel' => '1',
'amount' => $amount,
'user' => $login,
'phone1' => '',
'address1' => '',
'city' => '',
'zip' => '',
'pid' => '68' //Visa/MC
)
));
$res = curl_exec($ch);
preg_match('/total_amount" value="([\d\.]+)"/', $res, $usd);
preg_match('/checksum" value="([a-z0-9]+)"/', $res, $checksum);
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt_array($ch, array(
CURLOPT_URL => 'https://secure.gate2shop.com/ppp/purchase.do',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => array(
'merchant_site_id' => '115128',
'merchant_id' => '7154865435802323654',
'time_stamp' => date('Y-m-d H:i:s'),
'total_amount' => strval($usd[1]),
'currency' => 'USD',
'checksum' => $checksum[1],
'item_name_1' => 'Пополнение баланса (' . $login . ')',
'item_amount_1' => strval($usd[1]),
'item_quantity_1' => '1',
'version' => '3.0.0',
'payment_method' => 'cc_card',
'email' => $login,
'country' => 'RU',
'encoding' => 'utf-8',
'merchantlocale' => 'ru_RU',
'invoice_id' => $inv[1],
'merchant_unique_id' => $inv[1],
'phone1' => '',
'address1' => '',
'city' => '',
'zip' => ''
))
);
echo curl_exec($ch);
@unlink($tmpcook);