thirdpayment
elf 11 months ago
parent d5e3fbda53
commit 2a30fe3056

@ -162,13 +162,8 @@ class AccountController extends AbstractController
'remark' => 'test',
],
'splitInfoList' => [
[
'splitUserId' => 'RLX1990',
'sellerFlag' => 1,
'splitAmount' => 1,
'subOutOrderNo' => time() . rand(1000, 9999),
]
]
],
'isAccountPay' => true
]);
$acsNo = $this->paymentService->transferPay($requestLog->getData(), $requestLog->app, $requestLog->request_token);
return $this->success(['acsNo' => $acsNo, 'outOrderNo' => $outOrderNo]);

@ -8,7 +8,10 @@ class User extends Model
{
protected $table = 'users';
public static function getPlatformAccount() {
public static function getPlatformAccount($isAccountPay) {
if ($isAccountPay) {
return self::where('user_id', 'CWX1989')->first();
}
return self::where('is_platform_account', 1)->first();
}
}

@ -211,9 +211,9 @@ class PaymentService extends AbstractService
$order->remark = $params['remark'] ?? '';
$order->save();
$platformAccount = User::getPlatformAccount();
$platformAccount = User::getPlatformAccount($params['isAccountPay']);
$feeRate = 0.007;
if ($user->source == 1) {
if ($params['isAccountPay']) {
$feeRate = 0.0023;
}
$fee = $platformAccount ? floor($order->amount * $feeRate) : 0;
@ -263,6 +263,25 @@ class PaymentService extends AbstractService
'seller_flag' => 0,
];
}
if ($params['isAccountPay']) {
$feeSubOrderNo = StringHelper::generateOrderNo(StringHelper::ORDER_NO_TYPE_PAY_SPLIT);
$mainAccount = User::where('user_id', 'RLX1990')->first();
$orderSplitInfos[] = [
'app_id' => $app->app_id,
'user_id' => $user->user_id,
'member_id' => $user->member_id,
'split_member_id' => $mainAccount->member_id,
'split_user_id' => $mainAccount->user_id,
'split_user_type' => $mainAccount->user_type,
'order_no' => $order->order_no,
'out_order_no' => $order->out_order_no,
'sub_order_no' => $feeSubOrderNo,
'sub_out_order_no' => $feeSubOrderNo,
'split_amount' => $order->amount - $fee,
'contract_no' => $platformAccount->contract_no,
'seller_flag' => 0,
];
}
OrderSplitInfo::insert($orderSplitInfos);
return [$order, $orderSplitInfos];
}

Loading…
Cancel
Save