dever 3 years ago
parent
commit
fa691a6be0
2 changed files with 7 additions and 3 deletions
  1. 6 2
      lib/Wechat.php
  2. 1 1
      src/Api.php

+ 6 - 2
lib/Wechat.php

@@ -147,8 +147,12 @@ class Wechat extends Core
 	{
 		$notify = new \NativePay($this->config);
 		$result = $notify->GetPayUrl($order);
-		$url = $result['code_url'];
-		return $url;
+		if (isset($result['code_url'])) {
+			$url = $result['code_url'];
+			return $url;
+		}
+
+		return '';
 	}
 
 	/**

+ 1 - 1
src/Api.php

@@ -153,7 +153,7 @@ class Api
 	public function qrcode($param = array())
 	{
 		$this->init($param);
-		$url = $this->method->qrcode($this->get(2), $this->refer);
+		return $this->method->qrcode($this->get(2), $this->refer);
 		Dever::apply('sdk/qrcode');
 		return \QRcode::png($url);
 	}