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', ]);