dever 6 년 전
부모
커밋
55a17b1166
2개의 변경된 파일7개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 5
      lib/Wechat.php
  2. 1 1
      src/Api.php

+ 6 - 5
lib/Wechat.php

@@ -53,13 +53,14 @@ class Wechat extends Core
 		if ($type == 1) {
 			$order = \WxPayApi::unifiedOrder($this->config, $input);
 			# 下单信息
-			$this->updateOrderParam($order_id, $order);
 			$order['time'] = time();
-			return array($order_id, $order);
+			$order['order_id'] = $order_id;
+			$this->updateOrderParam($order_id, $order);
+			return $order;
 		} else {
 			# 下单信息
 			$this->updateOrderParam($order_id, $input);
-			return array($order_id, $input);
+			return $input;
 		}
 	}
 
@@ -69,7 +70,7 @@ class Wechat extends Core
 	public function qrcode($order, $refer)
 	{
 		$notify = new \NativePay();
-		$result = $notify->GetPayUrl($order[1]);
+		$result = $notify->GetPayUrl($order);
 		$url = $result['code_url'];
 		return $url;
 	}
@@ -82,7 +83,7 @@ class Wechat extends Core
 	{
 		$refer = urldecode($refer);
 		$tools = new \JsApiPay($this->config);
-		$info = $tools->GetJsApiParameters($order[1]);
+		$info = $tools->GetJsApiParameters($order);
 
 		$html = '<script type="text/javascript">
 		function jsApiCall()

+ 1 - 1
src/Api.php

@@ -19,7 +19,7 @@ class Api
 			$pay = Dever::db('pay/order')->one(array('order_id' => $this->order_id));
 			if ($pay && $pay['status'] == 1 && $pay['param']) {
 				$order = Dever::array_decode($pay['param']);
-				return array($order_id, $order);
+				return $order;
 			}
 		}
 		return $this->method->order($this->account_id, $this->uid, $this->username, $this->product_id, $this->name, $this->cash, $this->openid, $type);