|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|