@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Extend\Ca_V2;
|
||||
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Exception\BusinessException;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
|
||||
class CaOffline extends Ca
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->initConfig('ca.v2.offline', 'ca_v2_offline');
|
||||
}
|
||||
|
||||
public function getCloudCert(array $data, string $type = 'Personal'): mixed
|
||||
{
|
||||
$option = [
|
||||
'form_params' => [
|
||||
'entityId' => $data['user_id'],
|
||||
'entityType' => $type,
|
||||
'pin' => $data['user_id'],
|
||||
'cardNumber' => $data['card_num'],
|
||||
],
|
||||
];
|
||||
|
||||
try {
|
||||
$response = $this->httpRequest(
|
||||
$this->api_url . '/cloud-certificate-service/api/cloudCert/open/v2/cert/offlineAuthCertEnroll',
|
||||
$option
|
||||
);
|
||||
if (empty($response)) {
|
||||
throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR));
|
||||
}
|
||||
|
||||
return $response;
|
||||
} catch (GuzzleException $e) {
|
||||
throw new BusinessException($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user