ljl 1 year ago
parent 17eef6737f
commit 00ecb241e2

@ -458,4 +458,28 @@ class MineCommand extends HyperfCommand
$baofu->notifySuccess(); $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);
}
} }

@ -476,8 +476,8 @@ class Baofu
public function transferWithdraw($params) { public function transferWithdraw($params) {
$header = []; $header = [];
$header['memberId'] = $params['memberId']; $header['memberId'] = $this->getMerchantNo();
$header['terminalId'] = $params['82254']; $header['terminalId'] = $this->getMerchantNo();
$header['serviceTp'] = 'T-1001-003-01'; $header['serviceTp'] = 'T-1001-003-01';
$header['verifyType'] = 1; $header['verifyType'] = 1;
@ -513,8 +513,9 @@ class Baofu
$contentSign = SignatureUtil::sign(base64_encode(json_encode($content)), $this->getPfxFilePath(), $this->getPrivateKeyPassword()); $contentSign = SignatureUtil::sign(base64_encode(json_encode($content)), $this->getPfxFilePath(), $this->getPrivateKeyPassword());
$header['content'] = $contentSign; $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); $response = HttpClient::post($url, $header);
var_dump($response;)
$result = Rsa::decryptByPublicKey($response, $this->getCerFilePath()); $result = Rsa::decryptByPublicKey($response, $this->getCerFilePath());
$result = base64_decode($result); $result = base64_decode($result);
return json_encode($result, true); return json_encode($result, true);

Loading…
Cancel
Save