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