1<?
if (!defined(
"B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !==
true)
die();?><?
3if(!function_exists(
"bx_hmac"))
5 function bx_hmac($algo,
$data,
$key, $raw_output =
false)
7 $algo = mb_strtolower($algo);
8 $pack =
"H".mb_strlen($algo(
"test"));
10 $opad = str_repeat(chr(0x5C), $size);
11 $ipad = str_repeat(chr(0x36), $size);
13 if (mb_strlen(
$key) > $size) {
14 $key = str_pad(pack($pack, $algo(
$key)), $size, chr(0x00));
16 $key = str_pad(
$key, $size, chr(0x00));
19 $lenKey = mb_strlen(
$key) - 1;
20 for (
$i = 0;
$i < $lenKey;
$i++) {
25 $output = $algo($opad.pack($pack, $algo($ipad.$data)));
52 CSalePaySystemAction::InitParamArrays($arOrder, $arOrder[
"ID"]);
101 $strPS_STATUS_DESCRIPTION =
"";
102 $strPS_STATUS_DESCRIPTION .=
"ACTION: ".$p_action.
"; ";
103 $strPS_STATUS_DESCRIPTION .=
"RC: ".$p_rc.
"; ";
104 $strPS_STATUS_DESCRIPTION .=
"APPROVAL: ".$p_approval.
"; ";
105 $strPS_STATUS_DESCRIPTION .=
"RRN: ".$p_rrn.
"; ";
106 $strPS_STATUS_DESCRIPTION .=
"INT_REF: ".$p_int_ref.
"; ";
111 "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION,
112 "PS_STATUS_MESSAGE" =>
"",
115 "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat(
"FULL", LANG))),
130 if($arOrder[
"PAYED"] !=
"Y")
131 CSaleOrder::PayOrder($arOrder[
"ID"],
"Y",
true,
true);
132 if($arOrder[
"ALLOW_DELIVERY"] !=
"Y" && $ALLOW_DELIVERY ==
"Y")
133 CSaleOrder::DeliverOrder($arOrder[
"ID"],
"Y");
136 $time = gmdate(
"YmdHis", time());
137 $var = unpack(
"H*r",
ToUpper(mb_substr(md5(uniqid(30)), 0, 8)));
140 $signew = bx_hmac(
"sha1",
155 $res .=
"TRTYPE=".$trtype;
156 $res .=
"&ORDER=".$order;
157 $res .=
"&AMOUNT=".$amount;
158 $res .=
"&CURRENCY=".$currency;
159 $res .=
"&RRN=".$p_rrn;
160 $res .=
"&INT_REF=".$p_int_ref;
161 $res .=
"&TERMINAL=".$terminal;
162 $res .=
"&TIMESTAMP=".$time;
163 $res .=
"&NONCE=".$nonce;
164 $res .=
"&EMAIL=".$email;
166 $res .=
"&P_SIGN=".$signew;
168 $header =
"POST ".$server_url.
" HTTP/1.0\r\n";
169 $header .=
"Content-Type: application/x-www-form-urlencoded\r\n";
170 $header .=
"Content-Length: ".mb_strlen(
$res) .
"\r\n\r\n";
172 $fp = fsockopen(
"ssl://3ds.eximb.com", 443, $errno, $errstr, 60);
174 fputs ($fp, $header.$res);
static GetParamValue($key, $defaultValue=null)
static Update($ID, $arFields, $bDateUpdate=true)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
GetMessage($name, $aReplace=null)
GetLangFileName($before, $after, $lang=false)
if(mb_strlen($order)< 6) $desc
if(!function_exists("bx_hmac")) $amount
if(!function_exists("bx_hmac")) $p_terminal
if(empty($signedUserToken)) $key