diff --git a/WeMini/Scheme.php b/WeMini/Scheme.php index 2d41fb62ac4b2c46daa7af3cba0013b8e8420c8b..91cba8bff0a1d56eaebe973973494d2b75fcc5a2 100644 --- a/WeMini/Scheme.php +++ b/WeMini/Scheme.php @@ -77,4 +77,16 @@ class Scheme extends BasicWeChat $url = 'https://api.weixin.qq.com/wxa/query_urllink?access_token=ACCESS_TOKEN'; return $this->callPostApi($url, ['url_link' => $urllink], true); } -} \ No newline at end of file + /** + * 创建 Short-Link + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function shortLink($data) + { + $url = "https://api.weixin.qq.com/wxa/genwxashortlink?access_token=ACCESS_TOKEN"; + return $this->callPostApi($url, $data, true); + } +} diff --git a/WePay/Order.php b/WePay/Order.php index 91cb1953d9c9aa879735cb4d83b0b422139a4fef..5040acb7d618b75f0195001bb85f6b71a7ec20ba 100644 --- a/WePay/Order.php +++ b/WePay/Order.php @@ -87,7 +87,7 @@ class Order extends BasicWePay public function jsapiParams($prepayId) { $option = []; - $option["appId"] = $this->config->get('appid'); + $option["appId"] = $this->config->get('sub_appid') ? $this->config->get('sub_appid') : $this->config->get('appid'); $option["timeStamp"] = (string)time(); $option["nonceStr"] = Tools::createNoncestr(); $option["package"] = "prepay_id={$prepayId}"; @@ -172,4 +172,4 @@ class Order extends BasicWePay $url = 'https://api.mch.weixin.qq.com/payitil/report'; return $this->callPostApi($url, $options); } -} \ No newline at end of file +}