mirror of
https://github.com/v2board/v2board.git
synced 2024-11-14 07:29:13 +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)
|
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 = [
|
$params = [
|
||||||
'out_trade_no' => $order['trade_no'],
|
'out_trade_no' => $order['trade_no'],
|
||||||
'total_amount' => $order['total_amount'],
|
'total_amount' => $order['total_amount'],
|
||||||
'notify_url' => $order['notify_url'],
|
'notify_url' => $notifyUrl ?? $order['notify_url'],
|
||||||
'return_url' => $order['return_url']
|
'return_url' => $order['return_url']
|
||||||
];
|
];
|
||||||
$params['app_id'] = $this->config['mgate_app_id'];
|
$params['app_id'] = $this->config['mgate_app_id'];
|
||||||
|
@ -119,8 +119,9 @@ class OrderService
|
|||||||
$order = $this->order;
|
$order = $this->order;
|
||||||
if ($user->invite_user_id && $order->total_amount > 0) {
|
if ($user->invite_user_id && $order->total_amount > 0) {
|
||||||
$order->invite_user_id = $user->invite_user_id;
|
$order->invite_user_id = $user->invite_user_id;
|
||||||
|
$inviter = User::find($user->invite_user_id);
|
||||||
$isCommission = false;
|
$isCommission = false;
|
||||||
switch ((int)$user->commission_type) {
|
switch ((int)$inviter->commission_type) {
|
||||||
case 0:
|
case 0:
|
||||||
$commissionFirstTime = (int)config('v2board.commission_first_time_enable', 1);
|
$commissionFirstTime = (int)config('v2board.commission_first_time_enable', 1);
|
||||||
$isCommission = (!$commissionFirstTime || ($commissionFirstTime && !$this->haveValidOrder($user)));
|
$isCommission = (!$commissionFirstTime || ($commissionFirstTime && !$this->haveValidOrder($user)));
|
||||||
@ -134,7 +135,6 @@ class OrderService
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($isCommission) {
|
if ($isCommission) {
|
||||||
$inviter = User::find($user->invite_user_id);
|
|
||||||
if ($inviter && $inviter->commission_rate) {
|
if ($inviter && $inviter->commission_rate) {
|
||||||
$order->commission_balance = $order->total_amount * ($inviter->commission_rate / 100);
|
$order->commission_balance = $order->total_amount * ($inviter->commission_rate / 100);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user