From 00ecb241e2f17e519791ad809b21d244e0fa6551 Mon Sep 17 00:00:00 2001 From: ljl Date: Wed, 30 Aug 2023 15:11:20 +0800 Subject: [PATCH] yh --- app/Command/MineCommand.php | 24 ++++++++++++++++++++++++ app/Helper/Baofu/Baofu.php | 7 ++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/app/Command/MineCommand.php b/app/Command/MineCommand.php index 7f8a7fe..8ee7fd3 100644 --- a/app/Command/MineCommand.php +++ b/app/Command/MineCommand.php @@ -458,4 +458,28 @@ class MineCommand extends HyperfCommand $baofu->notifySuccess(); } + + public function transferWithdraw() { + $baofu = new Baofu(); + $data = [ + 'transContent' => [ + [ + 'transNo' => time() . rand(1000, 9999), + 'transMoney' => 0.1, + 'transType' => 2, + 'transAccNo' => '4673f922e30cfd2efeeb992ff6a32ece', + 'transAccName' => '廖金灵', + 'transSummary' => '测试', + // 'cardBankName' => '', + // 'cardProName' => '', + // 'cardCityName' => '', + // 'cardAccDept' => '', + // 'cardCnap' => '', + // 'transIdCard' => '', + // 'transMobile' => '', + ] + ] + ]; + $baofu->transferWithdraw($data); + } } \ No newline at end of file diff --git a/app/Helper/Baofu/Baofu.php b/app/Helper/Baofu/Baofu.php index fa867bf..b7542aa 100644 --- a/app/Helper/Baofu/Baofu.php +++ b/app/Helper/Baofu/Baofu.php @@ -476,8 +476,8 @@ class Baofu public function transferWithdraw($params) { $header = []; - $header['memberId'] = $params['memberId']; - $header['terminalId'] = $params['82254']; + $header['memberId'] = $this->getMerchantNo(); + $header['terminalId'] = $this->getMerchantNo(); $header['serviceTp'] = 'T-1001-003-01'; $header['verifyType'] = 1; @@ -513,8 +513,9 @@ class Baofu $contentSign = SignatureUtil::sign(base64_encode(json_encode($content)), $this->getPfxFilePath(), $this->getPrivateKeyPassword()); $header['content'] = $contentSign; - $url = 'https://vgw.baofoo.com/union-gw/api/' . $header['serviceTp'] . '/transReq.do'; + $url = 'https://public.baofu.com/union-gw/api/' . $header['serviceTp'] . '/transReq.do'; $response = HttpClient::post($url, $header); + var_dump($response;) $result = Rsa::decryptByPublicKey($response, $this->getCerFilePath()); $result = base64_decode($result); return json_encode($result, true);