update: mgate sdk custom notify domain

This commit is contained in:
tokumeikoi
2022-02-09 12:18:42 +08:00
parent 21a9074b3f
commit 659fa85b1d
2 changed files with 7 additions and 3 deletions

View File

@ -43,10 +43,14 @@ class MGate {
public function pay($order)
{
if ($this->config['notify_domain']) {
$parseUrl = parse_url($order['notify_url']);
$notifyUrl = "{$parseUrl['scheme']}://{$this->config['notify_domain']}{$parseUrl['path']}";
}
$params = [
'out_trade_no' => $order['trade_no'],
'total_amount' => $order['total_amount'],
'notify_url' => $order['notify_url'],
'notify_url' => $notifyUrl ?? $order['notify_url'],
'return_url' => $order['return_url']
];
$params['app_id'] = $this->config['mgate_app_id'];