master
elf 1 year ago
parent a2a5d05e42
commit bca410f33e

@ -42,7 +42,7 @@ class MineCommand extends HyperfCommand
public function handle(): void
{
$this->payment();
$this->rsyncBankCards();
}
protected function generateToken() {
@ -135,7 +135,7 @@ class MineCommand extends HyperfCommand
* @var UserService $userService
*/
$userService = $this->container->make(UserService::class);
$userService->rsyncBankCards('247eda1b7de0c76603123c477f2072fa');
$userService->rsyncBankCards('4673f922e30cfd2efeeb992ff6a32ece');
}
protected function bindCard()
@ -155,18 +155,18 @@ class MineCommand extends HyperfCommand
*/
$paymentService = $this->container->make(PaymentService::class);
$data = [
'userId' => 'RLX1990',
'agreementNo' => '312023080700002049466',
'userId' => 'ELF1990',
'agreementNo' => '312023080400002047764',
'notifyUrl' => 'http://www.baidu.com',
'returnUrl' => 'http://www.baidu.com',
'amount' => 10,
'amount' => 100,
'outOrderNo' => time() . rand(1000, 9999),
'expiresIn' => 10*60,
'splitInfoList' => [
[
'userId' => 'ELF1990',
'userId' => 'RLX1990',
'sellerFlag' => 1,
'amount' => 10,
'amount' => 100,
'subOutOrderNo' => time() . rand(1000, 9999),
]
]

@ -35,15 +35,14 @@ class NotifyController extends AbstractController
{
[$token, $params] = $this->getTokenAndParams($request);
$token = $request->route('token');
$requestLog = $this->requestService->getRequestLogByToken($token);
$baofu = new Baofu();
if (!$baofu->notifyVerify($params, 'register')) {
Log::info('registerNotifyVerifyFail: ', $params);
return $baofu->notifySuccess();
}
$requestLog = $this->requestService->getRequestLogByToken($token);
$userId = $requestLog->getDataValue('userId');
$appId = $requestLog->app_id;
$this->userService->rsyncUser($params['loginNo'], $appId, $userId);
@ -63,13 +62,13 @@ class NotifyController extends AbstractController
{
[$token, $params] = $this->getTokenAndParams($request);
$requestLog = $this->requestService->getRequestLogByToken($token);
$baofu = new Baofu();
if (!$baofu->notifyVerify($params, 'bindCard')) {
Log::info('bindCardNotifyVerifyFail: ' . $params);
return $baofu->notifySuccess();
}
$requestLog = $this->requestService->getRequestLogByToken($token);
$bindCardFlag = $params['bindCardFlag'] && $params['bindCardFlag'] != 'false' ? true : false;
if ($bindCardFlag) {
@ -91,14 +90,14 @@ class NotifyController extends AbstractController
public function payment(RequestInterface $request)
{
[$token, $params] = $this->getTokenAndParams($request);
$requestLog = $this->requestService->getRequestLogByToken($token);
$baofu = new Baofu();
if (!$baofu->notifyVerify($params, 'payment')) {
Log::info('paymentNotifyVerifyFail: ' . $params);
return $baofu->notifySuccess();
}
$requestLog = $this->requestService->getRequestLogByToken($token);
$info = [
'member_id' => $params['loginId'],
@ -135,13 +134,13 @@ class NotifyController extends AbstractController
{
[$token, $params] = $this->getTokenAndParams($request);
$requestLog = $this->requestService->getRequestLogByToken($token);
$baofu = new Baofu();
if (!$baofu->notifyVerify($params, 'refund')) {
Log::info('refundNotifyVerifyFail: ' . $params);
return $baofu->notifySuccess();
}
$requestLog = $this->requestService->getRequestLogByToken($token);
$info = [
'refund_no' => $params['refundTradeId'],

@ -12,7 +12,7 @@ use App\Service\PaymentService;
use App\Service\UserService;
use Hyperf\Context\Context;
class PayController extends AbstractController
class PaymentController extends AbstractController
{
private UserService $userService;
private PaymentService $paymentService;

@ -3,7 +3,7 @@
declare(strict_types=1);
use App\Controller\Payment\NotifyController;
use App\Controller\Payment\PayController;
use App\Controller\Payment\PaymentController;
use App\Controller\Payment\ReturnController;
use Hyperf\HttpServer\Router\Router;
@ -12,16 +12,16 @@ Router::get('/favicon.ico', function () {
});
Router::addGroup('/payment',function () {
Router::post('/company-register', [PayController::class, 'companyRegister']);
Router::post('/register', [PayController::class, 'register']);
Router::post('/bind-card', [PayController::class, 'bindCard']);
Router::post('/unbind-card', [PayController::class, 'unbindCard']);
Router::post('/pwd-forget', [PayController::class, 'pwdForget']);
Router::post('/pwd-modify', [PayController::class, 'pwdModify']);
Router::post('/payment', [PayController::class, 'payment']);
Router::post('/refund-apply', [PayController::class, 'refundApply']);
Router::post('/refund-confirm', [PayController::class, 'refundConfirm']);
Router::post('/refund-cancel', [PayController::class, 'refundCancel']);
Router::post('/company-register', [PaymentController::class, 'companyRegister']);
Router::post('/register', [PaymentController::class, 'register']);
Router::post('/bind-card', [PaymentController::class, 'bindCard']);
Router::post('/unbind-card', [PaymentController::class, 'unbindCard']);
Router::post('/pwd-forget', [PaymentController::class, 'pwdForget']);
Router::post('/pwd-modify', [PaymentController::class, 'pwdModify']);
Router::post('/payment', [PaymentController::class, 'payment']);
Router::post('/refund-apply', [PaymentController::class, 'refundApply']);
Router::post('/refund-confirm', [PaymentController::class, 'refundConfirm']);
Router::post('/refund-cancel', [PaymentController::class, 'refundCancel']);
}, ['middleware' => [\App\Middleware\RequestLogMiddleware::class, \App\Middleware\AppAuthMiddleWare::class]]);
Router::addGroup('/notify',function () {

Loading…
Cancel
Save