Example #1
0
 if ($p_action == "0" && ($p_rc = "00")) {
     if (DoubleVal($p_amount) == DoubleVal($arOrder["PRICE"]) && $p_currency == $currency) {
         echo $PAY_OK;
         $bError = false;
         $arFields["PS_STATUS"] = "Y";
         if ($arOrder["PAYED"] != "Y") {
             CSaleOrder::PayOrder($arOrder["ID"], "Y", true, true);
         }
         if ($arOrder["ALLOW_DELIVERY"] != "Y" && $ALLOW_DELIVERY == "Y") {
             CSaleOrder::DeliverOrder($arOrder["ID"], "Y");
         }
         $trtype = 21;
         $time = gmdate("YmdHis", time());
         $var = unpack("H*r", ToUpper(substr(md5(uniqid(30)), 0, 8)));
         $nonce = $var[r];
         $signew = bx_hmac("sha1", strlen($order) . $order . strlen($amount) . $amount . strlen($currency) . $currency . strlen($p_rrn) . $p_rrn . strlen($p_int_ref) . $p_int_ref . strlen($trtype) . $trtype . strlen($terminal) . $terminal . strlen($time) . $time . strlen($nonce) . $nonce, $key);
         $res = "";
         $res .= "TRTYPE=" . $trtype;
         $res .= "&ORDER=" . $order;
         $res .= "&AMOUNT=" . $amount;
         $res .= "&CURRENCY=" . $currency;
         $res .= "&RRN=" . $p_rrn;
         $res .= "&INT_REF=" . $p_int_ref;
         $res .= "&TERMINAL=" . $terminal;
         $res .= "&TIMESTAMP=" . $time;
         $res .= "&NONCE=" . $nonce;
         $res .= "&EMAIL=" . $email;
         $res .= "&LANG=";
         $res .= "&P_SIGN=" . $signew;
         $header = "POST " . $server_url . " HTTP/1.0\r\n";
         $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
Example #2
0
$backref = htmlspecialcharsbx(CSalePaySystemAction::GetParamValue("SHOP_RESULT"));
$mac = CSalePaySystemAction::GetParamValue("MAC");
if (strlen(CSalePaySystemAction::GetParamValue("IS_TEST")) > 0) {
    $server_url = "https://3ds.eximb.com:443/cgi-bin/cgi_test";
} else {
    $server_url = "https://3ds.eximb.com/cgi-bin/cgi_link";
}
$trtype = 0;
$country = "";
$merch_gmt = "";
$time = "";
$var = unpack("H*r", ToUpper(substr(md5(uniqid(30)), 0, 8)));
$nonce = $var[r];
$key = pack("H*", $mac);
$time = gmdate("YmdHis", time());
$sign = bx_hmac("sha1", (strlen($amount) > 0 ? strlen($amount) . $amount : "-") . (strlen($currency) > 0 ? strlen($currency) . $currency : "-") . (strlen($order) > 0 ? strlen($order) . $order : "-") . (strlen($desc) > 0 ? strlen($desc) . $desc : "-") . (strlen($m_name) > 0 ? strlen($m_name) . $m_name : "-") . (strlen($m_url) > 0 ? strlen($m_url) . $m_url : "-") . (strlen($merchant) > 0 ? strlen($merchant) . $merchant : "-") . (strlen($terminal) > 0 ? strlen($terminal) . $terminal : "-") . (strlen($email) > 0 ? strlen($email) . $email : "-") . (strlen($trtype) > 0 ? strlen($trtype) . $trtype : "-") . "--" . (strlen($time) > 0 ? strlen($time) . $time : "-") . (strlen($nonce) > 0 ? strlen($nonce) . $nonce : "-") . (strlen($backref) > 0 ? strlen($backref) . $backref : "-"), $key);
?>

<form name="cardform" action="<?php 
echo $server_url;
?>
" method="post">
<input type="hidden" name="TRTYPE" VALUE="<?php 
echo $trtype;
?>
">
<input type="hidden" name="AMOUNT" value="<?php 
echo $amount;
?>
"> 
<input type="hidden" name="CURRENCY" value="<?php