diff --git a/webapp/controller/PayController.class.php b/webapp/controller/PayController.class.php index 77cecea..2f9a4f2 100644 --- a/webapp/controller/PayController.class.php +++ b/webapp/controller/PayController.class.php @@ -136,76 +136,7 @@ class PayController { } } - public function scanPay1() - { - /* - if (!phpcommon\isValidSessionId( - $_REQUET['account_id'], - $_REQUET['session_id'] - )) { - echo json_encode(array( - 'errcode' => 100, - 'errmsg' => 'session无效', - )); - die(); - } - */ - $orderid = $this->getOrderId(); - if (empty($orderid)) { - die(); - } - $nowtime = time(); - $advice_url = ''; - if (SERVER_ENV != _ONLINE) { - $advice_url = "https://gamepay-test.kingsome.cn/webapp/index.php?c=PayNotify&a=payNotify"; - } else { - $advice_url = "https://gamepay.kingsome.cn/webapp/index.php?c=PayNotify&a=payNotify"; - } - $advice_url = 'https://gamepay.kingsome.cn/webapp/index.php'; - $params = array( - 'MerNo' => self::MER_NO, - 'BillNo' => $orderid, - 'payType' => 'WxJsapi_OffLine', - 'Amount' => '0.1', - 'OrderTime' => strftime('%Y%m%d%H%M%S', $nowtime), - 'AdviceUrl' => htmlentities($advice_url), - 'ScanpayMerchantCode' => '', - 'SignInfo' => '', - 'products' => '', - 'remark' => '', - 'MerName' => '', - ); - $params['SignInfo'] = $this->_reaEncode( - 'MerNo=' . $params['MerNo'] . '&' . - 'BillNo=' . $params['BillNo'] . '&' . - 'Amount=' . $params['Amount'] . '&' . - 'OrderTime=' . $params['OrderTime'] . '&' . - 'AdviceUrl=' . $advice_url - ); - echo $params['SignInfo']; - var_dump(phpcommon\objectToXml($params, '')); - $requestDomain = base64_encode(phpcommon\objectToXml($params, '')); - $response = ''; - if (phpcommon\HttpClient::post(self::SCAN_PAY_API_URL, - 'requestDomain='. urlencode($requestDomain), - $response) - ) { - /* echo json_encode(array( - 'errcode' => 101, - 'errmsg' => '交易失败:' . $response, - )); - die();*/ - } - var_dump($response); - $xmlobj = new \SimpleXMLElement($response); - var_dump($xmlobj->respCode); - if ($xmlobj->respCode == '0000') { - $conn = $this->getMysql($_REQUEST['account_id']); - $ret = $conn->execScript(); - } - } - - public function merchantIn() + private function merchantIn() { $orderid = $this->getOrderId(); if (empty($orderid)) { @@ -250,7 +181,7 @@ class PayController { var_dump(base64_decode($response)); } - public function merchantInQuery() + private function merchantInQuery() { $orderid = $this->getOrderId(); if (empty($orderid)) {