From 24b23aa085483b3d813fa7d5324ffeeaf67b1175 Mon Sep 17 00:00:00 2001 From: ljl Date: Tue, 20 Jun 2023 12:26:09 +0800 Subject: [PATCH 1/9] yh --- app/Service/PaymentService.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Service/PaymentService.php b/app/Service/PaymentService.php index 09a8aff..57bab0f 100644 --- a/app/Service/PaymentService.php +++ b/app/Service/PaymentService.php @@ -7,8 +7,7 @@ namespace App\Service; use App\Exception\BusinessException; use App\Helper\Efps\Api; use App\Helper\Efps\Result; -use App\Helper\Redis; -use App\Helper\RedisKey; +use App\Helper\Log; use App\Helper\StringHelper; use App\Model\App; use App\Model\BankCard; @@ -159,7 +158,8 @@ class PaymentService extends AbstractService $result = Api::bindCard($reqData); if (!$result->isSuccess()) { - throw new BusinessException($result->getMessage()); + $message = $result->getMessage(); + throw new BusinessException($message == '支付渠道未配置' ? '暂不支持该银行卡' : $message); } $user = User::where('member_id', $memberId)->first(); @@ -347,6 +347,7 @@ class PaymentService extends AbstractService throw new BusinessException('请输入金额'); } if ($reqData['amount'] < 100 || $reqData['amount'] > 300000) { + Log::error('reqData:', $reqData); throw new BusinessException('充值金额必须为100~300000'); } } From b26aadadc9bd4addabc4b50c7a5412387329c287 Mon Sep 17 00:00:00 2001 From: ljl Date: Tue, 20 Jun 2023 12:38:29 +0800 Subject: [PATCH 2/9] yh --- public/payment.html | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/public/payment.html b/public/payment.html index 05d7703..86bc380 100644 --- a/public/payment.html +++ b/public/payment.html @@ -38,6 +38,22 @@ + + +

支持的银行

+ + + + + + + + +
+
@@ -99,6 +115,28 @@ amount: 1, remark: '' }, + banks: [ + { + bank1: '中国工商银行', + bank2: '中国邮政银行', + bank3: '浦发银行', + }, + { + bank1: '广发银行', + bank2: '民生银行', + bank3: '光大银行', + }, + { + bank1: '中信银行', + bank2: '华夏银行', + bank3: '平安银行', + }, + { + bank1: '上海银行', + bank2: '区域性银行', + bank3: '', + } + ], amountDisabled: false } }, From ac149ddcf53f748a58f2e37df7bec7ba64c68ce2 Mon Sep 17 00:00:00 2001 From: ljl Date: Tue, 20 Jun 2023 12:40:44 +0800 Subject: [PATCH 3/9] yh --- app/Command/MineCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Command/MineCommand.php b/app/Command/MineCommand.php index 4d579ba..7a189ca 100644 --- a/app/Command/MineCommand.php +++ b/app/Command/MineCommand.php @@ -248,7 +248,7 @@ class MineCommand extends HyperfCommand 'data' => json_encode([ 'outOrderNo' => time().rand(1000, 9999), 'outMemberId' => 'T001', - 'amount' => 100, + 'amount' => 3000, 'notifyUrl' => 'https://www.baidu.com', ]), ]; From 80a3fcfc765fda8232b7eee263fff0c84e017fe7 Mon Sep 17 00:00:00 2001 From: ljl Date: Tue, 20 Jun 2023 12:43:08 +0800 Subject: [PATCH 4/9] yh --- app/Command/MineCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Command/MineCommand.php b/app/Command/MineCommand.php index 7a189ca..58148ad 100644 --- a/app/Command/MineCommand.php +++ b/app/Command/MineCommand.php @@ -242,12 +242,12 @@ class MineCommand extends HyperfCommand public function pay() { $params = [ - 'app_id' => '202304270000004', + 'app_id' => '202305270000004', 'timestamp' => time(), 'nonce_str' => StringHelper::getRandomString(32), 'data' => json_encode([ 'outOrderNo' => time().rand(1000, 9999), - 'outMemberId' => 'T001', + 'outMemberId' => 'ACCCCC', 'amount' => 3000, 'notifyUrl' => 'https://www.baidu.com', ]), From a95495a7285b3da678b5330035a2917c31285376 Mon Sep 17 00:00:00 2001 From: ljl Date: Tue, 20 Jun 2023 12:43:39 +0800 Subject: [PATCH 5/9] yh --- app/Command/MineCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Command/MineCommand.php b/app/Command/MineCommand.php index 58148ad..fa10bfa 100644 --- a/app/Command/MineCommand.php +++ b/app/Command/MineCommand.php @@ -242,7 +242,7 @@ class MineCommand extends HyperfCommand public function pay() { $params = [ - 'app_id' => '202305270000004', + 'app_id' => '202305270000001', 'timestamp' => time(), 'nonce_str' => StringHelper::getRandomString(32), 'data' => json_encode([ From b094f9d9f71340b2a2cccb1dd2f132b1487bf52d Mon Sep 17 00:00:00 2001 From: ljl Date: Tue, 20 Jun 2023 12:44:51 +0800 Subject: [PATCH 6/9] yh --- app/Command/MineCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Command/MineCommand.php b/app/Command/MineCommand.php index fa10bfa..8fbb087 100644 --- a/app/Command/MineCommand.php +++ b/app/Command/MineCommand.php @@ -263,7 +263,7 @@ class MineCommand extends HyperfCommand // 'outOrderNo' => 'P202306152340565850000' // ]) // ];lSHKbuFngCXHN8Ue1s8QHAAzPvOL3u9O nM2bUJT89njQGzoeDyK8cLmEYJloUsJX - $sign = \App\Helper\Platform\Signer::sign($params, 'lSHKbuFngCXHN8Ue1s8QHAAzPvOL3u9O'); + $sign = \App\Helper\Platform\Signer::sign($params, 'lsHKbuFngCXhN8Ue1s8QHAgzPvOL3u9O'); $params['sign'] = $sign; // echo json_encode($params); return $params; From ca5869c84d327d428f31430dbd0fe8991674e051 Mon Sep 17 00:00:00 2001 From: ljl Date: Tue, 20 Jun 2023 12:46:17 +0800 Subject: [PATCH 7/9] yh --- app/Command/MineCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Command/MineCommand.php b/app/Command/MineCommand.php index 8fbb087..0339c07 100644 --- a/app/Command/MineCommand.php +++ b/app/Command/MineCommand.php @@ -248,7 +248,7 @@ class MineCommand extends HyperfCommand 'data' => json_encode([ 'outOrderNo' => time().rand(1000, 9999), 'outMemberId' => 'ACCCCC', - 'amount' => 3000, + 'amount' => 300000, 'notifyUrl' => 'https://www.baidu.com', ]), ]; From fb89138d3ed84ef2f9b0e2f8d96ec0f496f56115 Mon Sep 17 00:00:00 2001 From: ljl Date: Tue, 20 Jun 2023 14:37:27 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/PaymentService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Service/PaymentService.php b/app/Service/PaymentService.php index 57bab0f..9f736ff 100644 --- a/app/Service/PaymentService.php +++ b/app/Service/PaymentService.php @@ -82,7 +82,7 @@ class PaymentService extends AbstractService $app = $req->getApp(); $data = $req->getData(); - if ($data['payAmount'] > 3000) { + if ($data['payAmount'] > 300000) { throw new BusinessException('超出限额'); } From ab517f7ab74267156ea9b72042d198ed0eff41b9 Mon Sep 17 00:00:00 2001 From: ljl Date: Tue, 20 Jun 2023 17:16:35 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/Recharge/RechargeController.php | 6 +++--- app/Service/PaymentService.php | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Controller/Recharge/RechargeController.php b/app/Controller/Recharge/RechargeController.php index 366292b..244bebd 100644 --- a/app/Controller/Recharge/RechargeController.php +++ b/app/Controller/Recharge/RechargeController.php @@ -325,9 +325,9 @@ class RechargeController extends AbstractController if (empty($log)) { throw new BusinessException('预支付记录不存在'); } - // if ($log->created_at->timestamp < time() - 5*60) { - // throw new BusinessException('支付超时,请重新请求'); - // } + if ($log->created_at->timestamp < time() - 5*60) { + throw new BusinessException('支付超时,请重新请求'); + } $app = App::where('app_id', $log->app_id)->first(); if (empty($app)) { throw new BusinessException('应用异常'); diff --git a/app/Service/PaymentService.php b/app/Service/PaymentService.php index 9f736ff..92c5a03 100644 --- a/app/Service/PaymentService.php +++ b/app/Service/PaymentService.php @@ -96,6 +96,7 @@ class PaymentService extends AbstractService $user = User::where('app_id', $app->app_id)->where('out_member_id', $data['outMemberId'])->first(); if (!$user) { + Log::error('UserUndefiend: ', $data); throw new BusinessException('用户不存在'); } $order = $this->createOrder($app, $data, $user);