style: Pint 포맷팅 적용

This commit is contained in:
김보곤
2026-02-25 11:45:01 +09:00
parent 68b1622a4e
commit 9a7c548246
199 changed files with 1420 additions and 1083 deletions

View File

@@ -13,17 +13,24 @@
class CooconService
{
private ?CooconConfig $config = null;
private bool $isTestMode = true;
/**
* API ID 상수
*/
public const API_COMPANY_INFO = 'OA08'; // 기업 기본정보
public const API_CREDIT_SUMMARY = 'OA12'; // 신용요약정보
public const API_SHORT_TERM_OVERDUE = 'OA13'; // 단기연체정보 (한국신용정보원)
public const API_NEGATIVE_INFO_KCI = 'OA14'; // 신용도판단정보 (한국신용정보원)
public const API_NEGATIVE_INFO_CB = 'OA15'; // 신용도판단정보 (신용정보사)
public const API_SUSPENSION_INFO = 'OA16'; // 당좌거래정지정보 (금융결제원)
public const API_WORKOUT_INFO = 'OA17'; // 법정관리/워크아웃정보
/**
@@ -43,6 +50,7 @@ class CooconService
* 기본 URL
*/
private const BASE_URL_TEST = 'https://dev2.coocon.co.kr:8443/sol/gateway/oapi_relay.jsp';
private const BASE_URL_PRODUCTION = 'https://sgw.coocon.co.kr/sol/gateway/oapi_relay.jsp';
public function __construct(bool $isTestMode = true)
@@ -65,6 +73,7 @@ private function loadConfig(): void
public function reloadConfig(): self
{
$this->loadConfig();
return $this;
}
@@ -75,6 +84,7 @@ public function setTestMode(bool $isTestMode): self
{
$this->isTestMode = $isTestMode;
$this->loadConfig();
return $this;
}
@@ -111,7 +121,7 @@ private function getBaseUrl(): string
*/
private function callApi(string $apiId, array $params = []): array
{
if (!$this->config) {
if (! $this->config) {
return [
'success' => false,
'error' => '쿠콘 API 설정이 없습니다. 설정을 먼저 등록해주세요.',
@@ -151,10 +161,10 @@ private function callApi(string $apiId, array $params = []): array
'rslt_msg' => $result['RSLT_MSG'] ?? 'N/A',
]);
if (!$response->successful()) {
if (! $response->successful()) {
return [
'success' => false,
'error' => 'HTTP 오류: ' . $response->status(),
'error' => 'HTTP 오류: '.$response->status(),
'code' => 'HTTP_ERROR',
'http_status' => $response->status(),
];
@@ -186,7 +196,7 @@ private function callApi(string $apiId, array $params = []): array
return [
'success' => false,
'error' => '쿠콘 API 호출 중 오류가 발생했습니다: ' . $e->getMessage(),
'error' => '쿠콘 API 호출 중 오류가 발생했습니다: '.$e->getMessage(),
'code' => 'EXCEPTION',
];
}
@@ -197,14 +207,14 @@ private function callApi(string $apiId, array $params = []): array
*/
private function generateTransactionSequence(): string
{
return date('YmdHis') . substr(microtime(), 2, 6);
return date('YmdHis').substr(microtime(), 2, 6);
}
/**
* 기업 기본정보 조회 (OA08)
*
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
* @param string $idscdcg 식별자구분코드 (기본값: 09-사업자등록번호)
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
* @param string $idscdcg 식별자구분코드 (기본값: 09-사업자등록번호)
*/
public function getCompanyInfo(string $companyKey, string $idscdcg = '09'): array
{
@@ -217,7 +227,7 @@ public function getCompanyInfo(string $companyKey, string $idscdcg = '09'): arra
/**
* 신용요약정보 조회 (OA12)
*
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
*/
public function getCreditSummary(string $companyKey): array
{
@@ -229,8 +239,8 @@ public function getCreditSummary(string $companyKey): array
/**
* 단기연체정보 조회 (OA13) - 한국신용정보원
*
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
* @param string|null $reqDate 기준일자 (YYYYMMDD), 미입력시 현재 날짜
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
* @param string|null $reqDate 기준일자 (YYYYMMDD), 미입력시 현재 날짜
*/
public function getShortTermOverdueInfo(string $companyKey, ?string $reqDate = null): array
{
@@ -246,7 +256,7 @@ public function getShortTermOverdueInfo(string $companyKey, ?string $reqDate = n
/**
* 신용도판단정보 조회 (OA14) - 한국신용정보원 (공공정보 포함)
*
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
*/
public function getNegativeInfoKCI(string $companyKey): array
{
@@ -258,7 +268,7 @@ public function getNegativeInfoKCI(string $companyKey): array
/**
* 신용도판단정보 조회 (OA15) - 신용정보사
*
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
*/
public function getNegativeInfoCB(string $companyKey): array
{
@@ -270,7 +280,7 @@ public function getNegativeInfoCB(string $companyKey): array
/**
* 당좌거래정지정보 조회 (OA16) - 금융결제원
*
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
*/
public function getSuspensionInfo(string $companyKey): array
{
@@ -282,9 +292,9 @@ public function getSuspensionInfo(string $companyKey): array
/**
* 법정관리/워크아웃정보 조회 (OA17)
*
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
* @param int $pageNo 페이지 번호
* @param int $pageSize 페이지 사이즈
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
* @param int $pageNo 페이지 번호
* @param int $pageSize 페이지 사이즈
*/
public function getWorkoutInfo(string $companyKey, int $pageNo = 1, int $pageSize = 10): array
{
@@ -298,7 +308,7 @@ public function getWorkoutInfo(string $companyKey, int $pageNo = 1, int $pageSiz
/**
* 전체 신용정보 조회 (모든 API 호출)
*
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
* @param string $companyKey 사업자번호, 법인번호, 업체코드 중 하나
*/
public function getAllCreditInfo(string $companyKey): array
{