From 65795904814509852a1fd7ba9aa143a3c2126a2c Mon Sep 17 00:00:00 2001 From: elf <360197197@qq.com> Date: Thu, 21 Dec 2023 23:00:17 +0800 Subject: [PATCH] yh --- app/Controller/Payment/AccountController.php | 11 +- app/Helper/StringHelper.php | 1 + public/account.html | 111 ++++++++++++------- 3 files changed, 80 insertions(+), 43 deletions(-) diff --git a/app/Controller/Payment/AccountController.php b/app/Controller/Payment/AccountController.php index 4a2772a..50304a7 100644 --- a/app/Controller/Payment/AccountController.php +++ b/app/Controller/Payment/AccountController.php @@ -147,14 +147,15 @@ class AccountController extends AbstractController $userInfo = $this->checkUser($request); $userId = $this->resetUserId($userInfo['userId']); $bankCard = BankCard::where('user_id', $userId)->first(); + $outOrderNo = StringHelper::generateOrderNo(StringHelper::ORDER_NO_TYPE_ACCOUNT_PAY); $requestLog = $this->createRequestLog([ 'userId' => $userId, 'goodsName' => '充值', 'agreementNo' => $bankCard->agreement_no, - 'notifyUrl' => 'http://www.baidu.com', - 'returnUrl' => 'http://www.baidu.com', + 'notifyUrl' => '', + 'returnUrl' => 'http://124.223.222.61:9701/account.html', 'amount' => intval($request->input('amount') * 100), - 'outOrderNo' => time() . rand(1000, 9999), + 'outOrderNo' => $outOrderNo, 'validDate' => date('Y-m-d', time() + 12*3600), 'marketInfo' => [ 'amount' => 0, @@ -164,13 +165,13 @@ class AccountController extends AbstractController [ 'splitUserId' => 'RLX1990', 'sellerFlag' => 1, - 'splitAmount' => 100, + 'splitAmount' => 1, 'subOutOrderNo' => time() . rand(1000, 9999), ] ] ]); $acsNo = $this->paymentService->transferPay($requestLog->getData(), $requestLog->app, $requestLog->request_token); - return $this->success(['acsNo' => $acsNo]); + return $this->success(['acsNo' => $acsNo, 'outOrderNo' => $outOrderNo]); } public function getUserInfo(RequestInterface $request) diff --git a/app/Helper/StringHelper.php b/app/Helper/StringHelper.php index 86a48d6..f0d8999 100644 --- a/app/Helper/StringHelper.php +++ b/app/Helper/StringHelper.php @@ -16,6 +16,7 @@ class StringHelper const ORDER_NO_TYPE_WITHDRAW_APPLY_BATCH_NUM = 'withdraw_apply_batch_num'; const ORDER_NO_TYPE_WITHDRAW_APPLY_NO = 'withdraw_apply_no'; const ORDER_NO_TYPE_WITHDRAW_NO = 'withdraw_no'; + const ORDER_NO_TYPE_ACCOUNT_PAY = 'account_pay'; public static function getRandomString($length, $withSpecialChar = false) { diff --git a/public/account.html b/public/account.html index 513fb4b..7bc918c 100644 --- a/public/account.html +++ b/public/account.html @@ -10,37 +10,73 @@
1. 输入金额,点击充值按钮
+2. 按提示转转
+