From 3a8bbd68880a19440418af3798e79d59646f9b76 Mon Sep 17 00:00:00 2001 From: ljl Date: Mon, 14 Aug 2023 09:59:18 +0800 Subject: [PATCH] yh --- app/Command/MineCommand.php | 24 ++++++++++++++++++++- app/Controller/Payment/NotifyController.php | 6 +++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/app/Command/MineCommand.php b/app/Command/MineCommand.php index a56175d..ed82902 100644 --- a/app/Command/MineCommand.php +++ b/app/Command/MineCommand.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace App\Command; +use App\Helper\Platform\Notification; use App\Helper\Platform\Signer; use App\Helper\StringHelper; use App\Model\App; @@ -43,7 +44,7 @@ class MineCommand extends HyperfCommand public function handle(): void { - $this->register('test'); + $this->notify('http://ceshi-shop.hkcpex.com/index.php/pay/notify/baofu_f_register', $this->getApp(), ['userId' => '30684']); return; $this->rsyncUser('4673f922e30cfd2efeeb992ff6a32ece', '202308070000001', 'ELF1990'); $this->rsyncUser('247eda1b7de0c76603123c477f2072fa', '202308070000001', 'RLX1990'); @@ -268,4 +269,25 @@ class MineCommand extends HyperfCommand ]; $paymentService->refundConfirm($data, $this->getApp(), $this->getToken()); } + + protected function notify($url, $app, $data) + { + if (empty($url)) { + return 'empty url'; + } + $params = [ + 'app_id' => $app->app_id, + 'nonce_str' => StringHelper::getRandomString(32), + 'timestamp' => time(), + ]; + $params['data'] = json_encode($data); + $params['sign'] = Signer::sign($params, $app->app_key); + + Log::info('notifyToOut params:', $params, 'platform'); + + Log::info('notifyToOut url:' . $url, [], 'platform'); + $result = Notification::post($url, $params); + Log::info('notifyToOut response:' . $result, [], 'platform'); + var_dump($result); + } } \ No newline at end of file diff --git a/app/Controller/Payment/NotifyController.php b/app/Controller/Payment/NotifyController.php index 2f8fc3b..f60af4e 100644 --- a/app/Controller/Payment/NotifyController.php +++ b/app/Controller/Payment/NotifyController.php @@ -54,7 +54,7 @@ class NotifyController extends AbstractController $requestLog->getDataValue('notifyUrl'), $requestLog->app, [ - 'user_id' => $params['loginNo'], + 'userId' => $params['userId'], ] ); @@ -82,8 +82,8 @@ class NotifyController extends AbstractController $requestLog->getDataValue('notifyUrl'), $requestLog->app, [ - 'bind_card_flag' => $bindCardFlag, - 'user_id' => $params['loginNo'], + 'bindCardFlag' => $bindCardFlag, + 'userId' => $requestLog->getDataValue('userId'),, ] );