From 8da33e241494d8a7918dc7c343bbf970de9c97e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=99?= Date: Mon, 27 Dec 2021 13:40:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BE=AE=E4=BF=A1=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/WeChatPayService.php | 4 ++++ config/wechat.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Services/WeChatPayService.php b/app/Services/WeChatPayService.php index fa382360..865d1d75 100644 --- a/app/Services/WeChatPayService.php +++ b/app/Services/WeChatPayService.php @@ -55,6 +55,10 @@ class WeChatPayService */ public function pay(array $params) { + if (isset($params['notify_url'])) { + $params['notify_url'] = url(route('wxpay.paid_notify', [], false), [], true); + } + // 如果交易类型不存在,则使用 App 支付 if (! isset($params['trade_type'])) { $params['trade_type'] = static::TRADE_TYPE_APP; diff --git a/config/wechat.php b/config/wechat.php index f1206e16..d3303768 100644 --- a/config/wechat.php +++ b/config/wechat.php @@ -9,7 +9,7 @@ return [ 'key' => env('WECHAT_PAYMENT_KEY'), 'cert_path' => env('WECHAT_PAYMENT_CERT_PATH'), // 绝对地址 'key_path' => env('WECHAT_PAYMENT_KEY_PATH'), // 绝对地址 - 'notify_url' => url(route('wxpay.paid_notify', [], false), [], true), + 'notify_url' => env('WECHAT_PAYMENT_NOTIFY_URL'), ], ], ];