From 308343322266f56e427b4ca0285825468974b2fc Mon Sep 17 00:00:00 2001 From: Anyon Date: Fri, 4 May 2018 17:20:33 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=94=B9=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1JSAPI=E6=94=AF=E4=BB=98=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/store/controller/wechat/Demo.php | 14 +++++++++++++- config/wechat.php | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/application/store/controller/wechat/Demo.php b/application/store/controller/wechat/Demo.php index 710fb9462..36733d653 100644 --- a/application/store/controller/wechat/Demo.php +++ b/application/store/controller/wechat/Demo.php @@ -42,7 +42,7 @@ class Demo 'total_fee' => '1', 'openid' => $openid, 'trade_type' => 'JSAPI', - 'notify_url' => 'http://a.com/text.html', + 'notify_url' => url('@wx-demo-notify', '', true, true), 'spbill_create_ip' => '127.0.0.1', ]; // 生成预支付码 @@ -78,4 +78,16 @@ class Demo "; } + /** + * 支付通过接收处理 + * @return string + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function notify() + { + $wechat = new Pay(config('wechat.')); + p($wechat->getNotify()); + return 'SUCCESS'; + } + } \ No newline at end of file diff --git a/config/wechat.php b/config/wechat.php index 430e611a9..099b03c7c 100644 --- a/config/wechat.php +++ b/config/wechat.php @@ -14,6 +14,7 @@ return [ 'service_url' => 'https://service.thinkadmin.top', + // 下面参数用作微信支付 'appid' => 'wx60a43dd8161666d4', 'mch_id' => '1332187001', 'mch_key' => 'A82DC5BD1F3359081049C568D8502BC5',