mirror of
https://gitee.com/yansongda/pay.git
synced 2024-12-05 13:48:53 +08:00
fix some bugs
This commit is contained in:
parent
eeb1719792
commit
df34300b10
@ -25,9 +25,7 @@ class AppGateway extends Gateway
|
||||
$payload['appid'] = $this->config->get('appid');
|
||||
$payload['trade_type'] = $this->getTradeType();
|
||||
|
||||
if ($this->mode === Wechat::MODE_SERVICE) {
|
||||
$payload['sub_appid'] = $this->config->get('sub_appid');
|
||||
}
|
||||
$this->mode !== Wechat::MODE_SERVICE ?: $payload['sub_appid'] = $this->config->get('sub_appid');
|
||||
|
||||
$payRequest = [
|
||||
'appid' => $payload['appid'],
|
||||
|
@ -23,9 +23,7 @@ class GroupRedpackGateway extends Gateway
|
||||
$payload['wxappid'] = $payload['appid'];
|
||||
$payload['amt_type'] = 'ALL_RAND';
|
||||
|
||||
if ($this->mode === Wechat::MODE_SERVICE) {
|
||||
$payload['msgappid'] = $payload['appid'];
|
||||
}
|
||||
$this->mode !== Wechat::MODE_SERVICE ?: $payload['msgappid'] = $payload['appid'];
|
||||
|
||||
unset($payload['appid'], $payload['trade_type'], $payload['notify_url'], $payload['spbill_create_ip']);
|
||||
|
||||
|
@ -21,9 +21,7 @@ class MiniappGateway extends MpGateway
|
||||
{
|
||||
$payload['appid'] = $this->config->get('miniapp_id');
|
||||
|
||||
if ($this->mode === Wechat::MODE_SERVICE) {
|
||||
$payload['sub_appid'] = $this->config->get('sub_miniapp_id');
|
||||
}
|
||||
$this->mode !== Wechat::MODE_SERVICE ?: $payload['sub_appid'] = $this->config->get('sub_miniapp_id');
|
||||
|
||||
return parent::pay($endpoint, $payload);
|
||||
}
|
||||
|
@ -22,11 +22,9 @@ class RedpackGateway extends Gateway
|
||||
public function pay($endpoint, array $payload): Collection
|
||||
{
|
||||
$payload['wxappid'] = $payload['appid'];
|
||||
$payload['client_ip'] = php_sapi_name() === 'cli' ?: Request::createFromGlobals()->server->get('SERVER_ADDR');
|
||||
php_sapi_name() === 'cli' ?: $payload['client_ip'] = Request::createFromGlobals()->server->get('SERVER_ADDR');
|
||||
|
||||
if ($this->mode === Wechat::MODE_SERVICE) {
|
||||
$payload['msgappid'] = $payload['appid'];
|
||||
}
|
||||
$this->mode !== Wechat::MODE_SERVICE ?: $payload['msgappid'] = $payload['appid'];
|
||||
|
||||
unset($payload['appid'], $payload['trade_type'], $payload['notify_url'], $payload['spbill_create_ip']);
|
||||
|
||||
|
@ -28,7 +28,7 @@ class TransferGateway extends Gateway
|
||||
|
||||
$payload['mch_appid'] = $this->config->get($type, '');
|
||||
$payload['mchid'] = $payload['mch_id'];
|
||||
$payload['spbill_create_ip'] = php_sapi_name() === 'cli' ?: Request::createFromGlobals()->server->get('SERVER_ADDR');
|
||||
php_sapi_name() === 'cli' ?: $payload['spbill_create_ip'] = Request::createFromGlobals()->server->get('SERVER_ADDR');
|
||||
|
||||
unset($payload['appid'], $payload['mch_id'], $payload['trade_type'],
|
||||
$payload['notify_url'], $payload['type']);
|
||||
|
Loading…
Reference in New Issue
Block a user