|
@@ -26,14 +26,26 @@ class Api
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 发起支付 用于页面支付(jsapi、小程序、支付宝h5等)
|
|
|
+ * 发起支付 用于小程序支付
|
|
|
+ *
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function applet($param = array())
|
|
|
+ {
|
|
|
+ $this->init($param);
|
|
|
+ return $this->method->applet($this->get(1));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 发起支付 用于页面支付
|
|
|
*
|
|
|
* @return mixed
|
|
|
*/
|
|
|
public function page()
|
|
|
{
|
|
|
+ $this->init($param);
|
|
|
if (!$this->refer) {
|
|
|
- Dever::alert('没有回调url');
|
|
|
+ Dever::alert('没有回调refer');
|
|
|
}
|
|
|
return $this->method->page($this->get(1), $this->refer);
|
|
|
}
|
|
@@ -45,6 +57,7 @@ class Api
|
|
|
*/
|
|
|
public function qrcode()
|
|
|
{
|
|
|
+ $this->init($param);
|
|
|
$url = $this->method->qrcode($this->get(2), $this->refer);
|
|
|
Dever::apply('sdk/qrcode');
|
|
|
return \QRcode::png($url);
|
|
@@ -57,6 +70,9 @@ class Api
|
|
|
*/
|
|
|
private function init($param = array())
|
|
|
{
|
|
|
+ if (isset($this->account_id)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
$this->account_id = $this->getParam($param, 'account_id');
|
|
|
$this->uid = $this->getParam($param, 'uid');
|
|
|
$this->username = $this->getParam($param, 'username');
|