|
|
@ -510,14 +510,21 @@ class Baofu
|
|
|
|
'body' => $body,
|
|
|
|
'body' => $body,
|
|
|
|
];
|
|
|
|
];
|
|
|
|
ksort($content);
|
|
|
|
ksort($content);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo PHP_EOL;
|
|
|
|
|
|
|
|
echo json_encode($content);
|
|
|
|
|
|
|
|
echo PHP_EOL;
|
|
|
|
$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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo json_encode($header);
|
|
|
|
|
|
|
|
echo PHP_EOL;
|
|
|
|
|
|
|
|
|
|
|
|
$url = 'https://public.baofu.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);
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|