From a0f67acdce822dde5c1d0a2f503f9af746192b03 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 9 Sep 2022 13:53:34 +0800 Subject: [PATCH] update --- app/controller/Wechat.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controller/Wechat.php b/app/controller/Wechat.php index fb0b6a6..685974d 100644 --- a/app/controller/Wechat.php +++ b/app/controller/Wechat.php @@ -68,13 +68,18 @@ class Wechat */ public function payment(): string { + $notifyUrl = Route::buildUrl('wechat/paid') + ->suffix(false) + ->domain(true); + + $config = Config::get('wechat.payment'); $payment = Factory::payment($config); $unify = $payment->order->unify([ 'body' => '商品订单', 'out_trade_no' => time(), 'total_fee' => 100, - 'notify_url' => '', + 'notify_url' => $notifyUrl, 'trade_type' => 'JSAPI', 'openid' => '$openid', ]);