function result($data) { global $rmag_options; $data->pay_summ = $_REQUEST["OutSum"]; $data->pay_id = $_REQUEST["InvId"]; $data->user_id = $_REQUEST["shpa"]; $data->pay_type = $_REQUEST["shpb"]; $crc = strtoupper($_REQUEST["SignatureValue"]); $my_crc = strtoupper(md5("{$data->pay_summ}:" . "{$data->pay_id}:" . "" . $rmag_options['tworobopass'] . ":" . "Shp_item=" . $_REQUEST['Shp_item'] . ":" . "shpa={$data->user_id}:" . "shpb={$data->pay_type}")); if ($my_crc != $crc) { rcl_mail_payment_error($my_crc); die; } if (!parent::get_pay($data)) { parent::insert_pay($data); } echo 'OK'; exit; }
function print_answer($result, $description, $signature = false) { rcl_mail_payment_error($signature); print "WMI_RESULT=" . strtoupper($result) . "&"; print "WMI_DESCRIPTION=" . urlencode($description); exit; }
function check_hash($data) { global $rmag_options; $hash = md5($_POST['action'] . ';' . $data->pay_summ . ';' . $_POST['orderSumCurrencyPaycash'] . ';' . $_POST['orderSumBankPaycash'] . ';' . $_POST['shopId'] . ';' . $_POST['invoiceId'] . ';' . $data->user_id . ';' . $rmag_options['secret_word']); if (strtolower($hash) != strtolower($_POST['md5'])) { $code = 1; } else { //if (!$this->get_pay()) $code = 200; //Если данного заказа нет if ($data->pay_summ != $_POST['orderSumAmount']) { $code = 100; } else { $code = 0; } } if ($code) { rcl_mail_payment_error($hash); } return $code; }
function result($data) { global $rmag_options; $data->pay_summ = $_REQUEST["ik_am"]; $data->pay_id = $_REQUEST["ik_pm_no"]; $data->user_id = $_REQUEST["ik_x_user_id"]; $data->pay_type = $_REQUEST["ik_x_type"]; foreach ($_POST as $key => $value) { if (!preg_match('/ik_/', $key)) { continue; } $arr[$key] = $value; } $ikSign = $arr['ik_sign']; unset($arr['ik_sign']); if ($arr['ik_pw_via'] == 'test_interkassa_test_xts') { $secret_key = $rmag_options['intertestkey']; } else { $secret_key = $rmag_options['intersecretkey']; } ksort($arr, SORT_STRING); array_push($arr, $secret_key); $signStr = implode(':', $arr); $sign = base64_encode(md5($signStr, true)); if ($sign != $ikSign) { rcl_mail_payment_error($sign); die; } if (!parent::get_pay($data)) { parent::insert_pay($data); } exit; }