diff --git a/webapp/controller/PayController.class.php b/webapp/controller/PayController.class.php index 2f9a4f2..c5f6e80 100644 --- a/webapp/controller/PayController.class.php +++ b/webapp/controller/PayController.class.php @@ -64,7 +64,7 @@ class PayController { return openssl_sign($str, $sign, $prikey, OPENSSL_ALGO_SHA1) ? base64_encode($sign) : false; } - public function scanPay() + public function aggregatePay() { /* if (!phpcommon\isValidSessionId( @@ -114,7 +114,7 @@ class PayController { ); $xml_txt = phpcommon\objectToXml($params, ''); $xml_txt = str_replace('', '', $xml_txt); - echo $xml_txt; +# echo $xml_txt; $requestDomain = base64_encode($xml_txt); $response = ''; if (phpcommon\HttpClient::post(self::SCAN_PAY_API_URL, @@ -127,12 +127,23 @@ class PayController { )); die();*/ } - var_dump(base64_decode($response)); + error_log(base64_decode($response)); $xmlobj = new \SimpleXMLElement(base64_decode($response)); - var_dump($xmlobj->respCode); - if ($xmlobj->respCode == '0000') { + if ($xmlobj->RespCode == '0000') { $conn = $this->getMysql($_REQUEST['account_id']); - $ret = $conn->execScript(); +# $ret = $conn->execScript(); + echo json_encode(array( + 'errcode' => 0, + 'errmsg' => '', + 'pay_str' => $xmlobj->PayStr + )); + die(); + } else { + echo json_encode(array( + 'errcode' => 1, + 'errmsg' => '平台错误:' . $xmlobj->RespCode, + )); + die(); } } @@ -193,7 +204,6 @@ class PayController { 'SignInfo' => '', 'PayType' => 'WXZF_ONLINE', 'RandomStr' => $orderid, - 'PayType' => 'WXZF_ONLINE', ); $params['SignInfo'] = $this->_reaEncode( 'MerNo=' . $params['MerNo'] . '&' . diff --git a/webapp/controller/PayNotifyController.class.php b/webapp/controller/PayNotifyController.class.php index ec92dd2..6b480c7 100644 --- a/webapp/controller/PayNotifyController.class.php +++ b/webapp/controller/PayNotifyController.class.php @@ -2,7 +2,7 @@ class PayNotifyController { - const PUB_KEY = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVd+f/YkGDi8s9AKhZvmHCxZ2+sPKIsr+JVS2Uj4pP6qApuNq5lEwtF4c6LzHJbUUxKge/OttiR7pR481tqW3PgeSYjyU6rayx0rSEo8/xqVHnh4XugbJREUVyq/Evp79f0BePO69zC0AdYZSjXOAVG8uduRzHl4RWb7BiDLBL3QIDAQAB'; + const PUB_KEY = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2g2T98rLysZAS1pVv2gE/2DOf9+LkHI9oEFVeKvVZKLHMNzEpZkXK+IXJMHpxlMNLStiwuLxLpnvCQQptGbFohqDsHACademc6/t+YVF2FX4F6GIgBuaPDdJwSGAljtU5P3vsCbJpGPXh6QNyKveBAJKILbXem6pPl+J01CMXyQIDAQAB'; protected function getMysql($accountid) {