public function notify() { //支付跳转返回页 $class_name = strim($_REQUEST['class_name']); $class_act = strim($_REQUEST['class_act']); $log_html = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><form action="' . SITE_DOMAIN . APP_ROOT . '/index.php" method="post" >'; foreach ($_REQUEST as $k => $v) { $log_html .= $k . ':<input type="text" name="' . $k . '" value="' . $v . '"><br>'; } $log_html .= '<button type="submit">submit</button></form>'; file_put_contents(APP_ROOT_PATH . "system/collocation/log/" . $class_act . "_notify_" . strftime("%Y%m%d%H%M%S", time()) . ".html", $log_html); $collocation_info = array('MerCode' => 808801); // $GLOBALS['db']->getRow("select * from ".DB_PREFIX."payment where class_name = '".$class_name."'"); if ($collocation_info) { require_once APP_ROOT_PATH . "system/collocation/" . $class_name . "_collocation.php"; $collocation_class = $class_name . "_collocation"; $collocation_object = new $collocation_class(); adddeepslashes($_REQUEST); $collocation_code = $collocation_object->notify($_REQUEST, $class_act); } else { //showErr($GLOBALS['lang']['PAYMENT_NOT_EXIST']); } }
public function notify() { //支付跳转返回页 if ($GLOBALS['pay_req']['class_name']) { $_REQUEST['class_name'] = $GLOBALS['pay_req']['class_name']; } $class_name = addslashes(trim($_REQUEST['class_name'])); $payment_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment where class_name = '" . $class_name . "'"); if ($payment_info) { require_once APP_ROOT_PATH . "system/payment/" . $payment_info['class_name'] . "_payment.php"; $payment_class = $payment_info['class_name'] . "_payment"; $payment_object = new $payment_class(); adddeepslashes($_REQUEST); $payment_code = $payment_object->notify($_REQUEST); } else { showErr($GLOBALS['lang']['PAYMENT_NOT_EXIST']); } }
function adddeepslashes(&$request) { foreach ($request as $k => $v) { if (is_array($v)) { adddeepslashes($request[$k]); } else { $request[$k] = addslashes(trim($v)); } } }
public function in_notify() { //支付跳转返回页 $plugcode = addslashes(trim($_REQUEST['plugcode'])); $payment_info = $this->db->getRow("select * from " . db_prefix . "order_pay where paycode = '" . $plugcode . "'"); if ($payment_info && $plugcode) { include_once admin_ROOT . 'public/plug/payment/' . $plugcode . '.php'; $payobj = new $plugcode(); adddeepslashes($_REQUEST); $return = $payobj->response($_REQUEST); } else { $return['info'] = 'failed'; $return['status'] = false; } if ($return['status']) { $this->in_charge($return['oid']); } echo $return['info']; }