From 7159f4c72eb9f13a06a2400ea19f0fbeb6bc3129 Mon Sep 17 00:00:00 2001 From: Innovation <1028932693@qq.com> Date: Fri, 13 Oct 2023 11:33:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=9B=E5=BB=BAJsApi=E5=8F=8AH5=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=8F=82=E6=95=B0=E6=97=B6=E5=85=BC=E5=AE=B9=E5=AD=90?= =?UTF-8?q?=E5=95=86=E6=88=B7=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WePay/Order.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WePay/Order.php b/WePay/Order.php index 91cb195..5040acb 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 +} From 06cb748924ae1ccbea15e29f10b3d9e119f77ce0 Mon Sep 17 00:00:00 2001 From: Innovational <1028932693@qq.com> Date: Wed, 23 Oct 2024 15:39:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E5=88=9B=E5=BB=BA=20S?= =?UTF-8?q?hort-Link?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WeMini/Scheme.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/WeMini/Scheme.php b/WeMini/Scheme.php index 2d41fb6..91cba8b 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); + } +}