Update TransferGateway.php

可以自己指定客户端IP,自己测试的时候不至于获取到的是局域网IP地址,提交到网关被拒
This commit is contained in:
Peter 2018-12-20 17:53:55 +08:00 committed by GitHub
parent e71a5f6fc8
commit b619e417f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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');
}