From c2c4cb338821b99e27df1416002f488efca51031 Mon Sep 17 00:00:00 2001 From: Anyon Date: Thu, 3 May 2018 15:11:22 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=B5=8B=E8=AF=95]=E5=BE=AE=E4=BF=A1JSAPI?= =?UTF-8?q?=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index 75366af42..a3807c3e9 100644 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -33,11 +33,12 @@ class Index extends Controller public function pay() { $wechat = new Pay(config('wechat.')); + $openid = WechatService::webOauth(0)['openid']; $options = [ 'body' => '测试商品', 'out_trade_no' => time(), 'total_fee' => '1', - 'openid' => 'o38gps3vNdCqaggFfrBRCRikwlWY', + 'openid' => $openid, 'trade_type' => 'JSAPI', 'notify_url' => 'http://a.com/text.html', 'spbill_create_ip' => '127.0.0.1',