mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update: mgate sdk custom notify domain
This commit is contained in:
parent
21a9074b3f
commit
659fa85b1d
@ -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'];
|
||||
|
@ -119,8 +119,9 @@ class OrderService
|
||||
$order = $this->order;
|
||||
if ($user->invite_user_id && $order->total_amount > 0) {
|
||||
$order->invite_user_id = $user->invite_user_id;
|
||||
$inviter = User::find($user->invite_user_id);
|
||||
$isCommission = false;
|
||||
switch ((int)$user->commission_type) {
|
||||
switch ((int)$inviter->commission_type) {
|
||||
case 0:
|
||||
$commissionFirstTime = (int)config('v2board.commission_first_time_enable', 1);
|
||||
$isCommission = (!$commissionFirstTime || ($commissionFirstTime && !$this->haveValidOrder($user)));
|
||||
@ -134,7 +135,6 @@ class OrderService
|
||||
}
|
||||
|
||||
if ($isCommission) {
|
||||
$inviter = User::find($user->invite_user_id);
|
||||
if ($inviter && $inviter->commission_rate) {
|
||||
$order->commission_balance = $order->total_amount * ($inviter->commission_rate / 100);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user