+31
-1
@@ -110,6 +110,36 @@ abstract class Ca
|
||||
* @param array $data
|
||||
* @return bool
|
||||
*/
|
||||
/**
|
||||
* Timestamp sign service.
|
||||
* @param string $to_sign
|
||||
* @return mixed
|
||||
*/
|
||||
public function getTimestampSign(string $to_sign): mixed
|
||||
{
|
||||
$generator = $this->container->get(IdGeneratorInterface::class);
|
||||
|
||||
$option = [
|
||||
'form_params' => [
|
||||
'requestId' => $generator->generate(),
|
||||
'toSign' => $to_sign,
|
||||
]
|
||||
];
|
||||
|
||||
try {
|
||||
$response = $this->httpRequest(
|
||||
$this->api_url . '/signgw-service/api/signgw/timestamap/sign',
|
||||
$option
|
||||
);
|
||||
if (empty($response)) {
|
||||
throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR));
|
||||
}
|
||||
return $response;
|
||||
} catch (GuzzleException $e) {
|
||||
throw new BusinessException($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function addUserSignConfig(string $user_id, string $card_num, array $data): bool
|
||||
{
|
||||
$arg = [
|
||||
@@ -455,4 +485,4 @@ abstract class Ca
|
||||
|
||||
return hash_hmac("sha1", $data, $this->secret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user