ljl 1 year ago
parent 7d8b76f9f4
commit 0223f71f93

@ -510,14 +510,21 @@ class Baofu
'body' => $body,
];
ksort($content);
echo PHP_EOL;
echo json_encode($content);
echo PHP_EOL;
$contentSign = SignatureUtil::sign(base64_encode(json_encode($content)), $this->getPfxFilePath(), $this->getPrivateKeyPassword());
$header['content'] = $contentSign;
echo json_encode($header);
echo PHP_EOL;
$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);
// $result = Rsa::decryptByPublicKey($response, $this->getCerFilePath());
// $result = base64_decode($result);
return json_encode($result, true);
}
}

Loading…
Cancel
Save