增加通过 小程序/app 账号进行企业付款功能

This commit is contained in:
yansongda 2018-02-07 23:27:56 +08:00
parent d2f2336322
commit a03c4f9778

View File

@ -20,11 +20,13 @@ class TransferGateway extends Gateway
*/
public function pay($endpoint, array $payload): Collection
{
$payload['mch_appid'] = $payload['appid'];
$type = isset($order['type']) ? ($order['type'].($order['type'] == 'app' ?: '_').'id') : 'app_id';
$payload['mch_appid'] = $this->config->get($type, '');
$payload['mchid'] = $payload['mch_id'];
$payload['spbill_create_ip'] = Request::createFromGlobals()->server->get('SERVER_ADDR');
unset($payload['appid'], $payload['mch_id'], $payload['trade_type'], $payload['notify_url']);
unset($payload['appid'], $payload['mch_id'], $payload['trade_type'], $payload['notify_url'], $payload['type']);
$payload['sign'] = Support::generateSign($payload, $this->config->get('key'));