dever 5 years ago
parent
commit
1f47a2a671
2 changed files with 21 additions and 0 deletions
  1. 10 0
      lib/Wechat.php
  2. 11 0
      src/Api.php

+ 10 - 0
lib/Wechat.php

@@ -32,6 +32,16 @@ class Wechat extends Core
 		$result = $callback->Handle($this->config, false);
 	}
 
+	# 查询订单
+	public function search($order_id)
+	{
+		$input = new \WxPayOrderQuery();
+		$input->SetOut_trade_no($order_id);
+		$result = \WxPayApi::orderQuery($this->config, $input);
+
+		return $result;
+	}
+
 	/**
 	 * 获取统一下单的基本信息
 	 */

+ 11 - 0
src/Api.php

@@ -118,6 +118,17 @@ class Api
 		return \QRcode::png($url);
 	}
 
+	/**
+	 * 查询支付
+	 *
+	 * @return mixed
+	 */
+	public function search($param = array())
+	{
+		$this->order_id = $this->getParam($param, 'order_id');
+		return $this->method->search($this->order_id);
+	}
+
 	/**
 	 * 初始化 设置参数
 	 *