mirror of
https://gitee.com/yansongda/pay.git
synced 2024-12-05 21:58:26 +08:00
fix #86
This commit is contained in:
parent
2809f3af38
commit
48186e4dd1
@ -24,6 +24,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');
|
||||
}
|
||||
|
@ -21,10 +21,11 @@ class GroupRedpackGateway extends Gateway
|
||||
public function pay($endpoint, array $payload): Collection
|
||||
{
|
||||
$payload['wxappid'] = $payload['appid'];
|
||||
$payload['amt_type'] = 'ALL_RAND';
|
||||
|
||||
if ($this->mode === Wechat::MODE_SERVICE) {
|
||||
$payload['msgappid'] = $payload['appid'];
|
||||
}
|
||||
$payload['amt_type'] = 'ALL_RAND';
|
||||
|
||||
unset($payload['appid'], $payload['trade_type'], $payload['notify_url'], $payload['spbill_create_ip']);
|
||||
|
||||
|
@ -20,6 +20,7 @@ class MiniappGateway extends MpGateway
|
||||
public function pay($endpoint, array $payload): Collection
|
||||
{
|
||||
$payload['appid'] = $this->config->get('miniapp_id');
|
||||
|
||||
if ($this->mode === Wechat::MODE_SERVICE) {
|
||||
$payload['sub_appid'] = $this->config->get('sub_miniapp_id');
|
||||
}
|
||||
|
@ -22,10 +22,11 @@ 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');
|
||||
|
||||
if ($this->mode === Wechat::MODE_SERVICE) {
|
||||
$payload['msgappid'] = $payload['appid'];
|
||||
}
|
||||
$payload['client_ip'] = Request::createFromGlobals()->server->get('SERVER_ADDR');
|
||||
|
||||
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'] = Request::createFromGlobals()->server->get('SERVER_ADDR');
|
||||
$payload['spbill_create_ip'] = php_sapi_name() === 'cli' ?: 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