|
|
|
@ -37,6 +37,7 @@ class RechargeController extends AbstractController
|
|
|
|
|
'cardNo' => $user->card_no ?? '',
|
|
|
|
|
'mobile' => $user->mobile ?? '',
|
|
|
|
|
'bankCardNo' => $bankCard->bank_card_no ?? '',
|
|
|
|
|
'amount' => intval($prePayLog->amount / 100),
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
return $this->success([
|
|
|
|
@ -51,15 +52,19 @@ class RechargeController extends AbstractController
|
|
|
|
|
throw new BusinessException('请输入姓名');
|
|
|
|
|
}
|
|
|
|
|
$amount = $request->input('amount');
|
|
|
|
|
if (empty($amount)) {
|
|
|
|
|
throw new BusinessException('请输入金额');
|
|
|
|
|
}
|
|
|
|
|
if (!is_numeric($amount)) {
|
|
|
|
|
throw new BusinessException('请输入金额');
|
|
|
|
|
}
|
|
|
|
|
if ($amount <= 0) {
|
|
|
|
|
throw new BusinessException('金额需大于0');
|
|
|
|
|
if ($prePayLog->amount == 0) {
|
|
|
|
|
$amount = $request->input('amount');
|
|
|
|
|
if (empty($amount)) {
|
|
|
|
|
throw new BusinessException('请输入金额');
|
|
|
|
|
}
|
|
|
|
|
if (!is_numeric($amount)) {
|
|
|
|
|
throw new BusinessException('请输入金额');
|
|
|
|
|
}
|
|
|
|
|
if ($amount <= 0) {
|
|
|
|
|
throw new BusinessException('金额需大于0');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$cardNo = $request->input('cardNo');
|
|
|
|
|
if (empty($cardNo)) {
|
|
|
|
|
throw new BusinessException('请输入身份证号');
|
|
|
|
@ -86,7 +91,8 @@ class RechargeController extends AbstractController
|
|
|
|
|
if ($bankCard) {
|
|
|
|
|
$outOrderNo = $prePayLog->out_order_no;
|
|
|
|
|
$nextStep = 'confirm-pay';
|
|
|
|
|
$bizData = $this->paymentService->protocolPayPreRequest($this->buildPrepayParams($prePayLog->out_member_id, $outOrderNo, $bankCard->protocol, intval($amount * 100), $app));
|
|
|
|
|
$amount = $prePayLog->amount > 0 ? $prePayLog->amount : intval($amount * 100);
|
|
|
|
|
$bizData = $this->paymentService->protocolPayPreRequest($this->buildPrepayParams($prePayLog->out_member_id, $outOrderNo, $bankCard->protocol, $amount, $app));
|
|
|
|
|
} else {
|
|
|
|
|
$mchOrderNo = StringHelper::generateBankCardOrderNo();
|
|
|
|
|
$nextStep = 'confirm-bind';
|
|
|
|
|