From b619e417f9a9c91bb5726dc7f8aacbac59212667 Mon Sep 17 00:00:00 2001 From: Peter Date: Thu, 20 Dec 2018 17:53:55 +0800 Subject: [PATCH] Update TransferGateway.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 可以自己指定客户端IP,自己测试的时候不至于获取到的是局域网IP地址,提交到网关被拒 --- src/Gateways/Wechat/TransferGateway.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gateways/Wechat/TransferGateway.php b/src/Gateways/Wechat/TransferGateway.php index a98e133..48d0c72 100644 --- a/src/Gateways/Wechat/TransferGateway.php +++ b/src/Gateways/Wechat/TransferGateway.php @@ -34,7 +34,7 @@ class TransferGateway extends Gateway $payload['mch_appid'] = Support::getInstance()->getConfig($type, ''); $payload['mchid'] = $payload['mch_id']; - if (php_sapi_name() !== 'cli') { + if (php_sapi_name() !== 'cli' && (!isset($payload['spbill_create_ip']) || empty($payload['spbill_create_ip']))) { $payload['spbill_create_ip'] = Request::createFromGlobals()->server->get('SERVER_ADDR'); }