dever 6 år sedan
förälder
incheckning
aea1e0eaf3
2 ändrade filer med 8 tillägg och 6 borttagningar
  1. 6 1
      lib/Cmbc.php
  2. 2 5
      sdk/cmbc/Api/Notify.php

+ 6 - 1
lib/Cmbc.php

@@ -26,8 +26,13 @@ class Cmbc extends Core
 	public function notify()
 	{
 		$input = file_get_contents("php://input");
+		if ($input) {
+			parse_str($input, $input);
+		} else {
+			$input = Dever::input();
+		}
 		$this->log('支付回调-初始化', $input);
-		parse_str($input, $input);
+		
 		$tools = new \Cmbc\Handle();
 		$callback = $tools->get('notify', $this->config);
 		$result = $callback->request($input, $this);

+ 2 - 5
sdk/cmbc/Api/Notify.php

@@ -6,14 +6,11 @@ class Notify extends Core
 	protected function init()
 	{
 		$this->api = 'https://ipaynow.acquire.cmbchina.com/';
-		$this->param['funcode'] = 'WP001';
-		$this->param['version'] = '1.0.0';
 	}
 
 	public function request($request, $tool = false)
 	{
 		$this->data = $request;
-		$tool->log('支付回调-初始化11', $request);
 		$this->setParam('mhtOrderNo');
 		$this->setParam('mhtOrderName');
 		$this->setParam('mhtOrderType');
@@ -37,15 +34,15 @@ class Notify extends Core
 		$this->setParam('cardType');
 		$this->setParam('signType');
 		$this->setParam('funcode');
+		$this->setParam('version');
 		$error = $this->getError();
 		if ($error) {
 			$tool->updateOrder($this->param['mhtOrderNo'], $this->param['mhtOrderAmt'], $error);
 			return false;
 		}
 
-		$tool->log('支付回调-初始化22', $this->param);
+		unset($this->param['mhtSubAppId']);
 		$signature = $this->createSignature($this->param['signType']);
-		$tool->log('支付回调-初始化33', $signature);
 		if ($signature != $this->data['signature']) {
 			$tool->updateOrder($this->param['mhtOrderNo'], $this->param['mhtOrderAmt'], '签名错误');
 			return false;