refactor: [barobill] 바로빌 연동 코드 전면 개선

- config/services.php에 barobill 설정 등록 (운영/테스트 모드 분기 정상화)
- BarobillSetting 모델에 BelongsToTenant 적용 및 use_* 필드 casts 추가
- BarobillService API URL을 baroservice.com(SOAP)으로 수정
- BarobillService callApi 메서드 경로 하드코딩 제거 (서비스별 분기)
- BarobillService 예외 이중 래핑 문제 수정
- BarobillController URL 메서드 중복 코드 제거
- 누락 모델 16개 생성 (MNG 패턴 준수, BelongsToTenant 적용)
- 바로빌 전 테이블 options JSON 컬럼 추가 마이그레이션
This commit is contained in:
김보곤
2026-03-11 18:16:59 +09:00
parent 0be88f95ca
commit 18a6f3e7aa
21 changed files with 1390 additions and 79 deletions

View File

@@ -28,7 +28,7 @@ public function status()
'barobill_id' => $setting->barobill_id,
'biz_no' => $setting->corp_num,
'status' => $setting->isVerified() ? 'active' : 'inactive',
'server_mode' => config('services.barobill.test_mode', true) ? 'test' : 'production',
'server_mode' => $this->barobillService->isTestMode() ? 'test' : 'production',
] : null,
];
}, __('message.fetched'));
@@ -86,17 +86,21 @@ public function signup(Request $request)
}, __('message.saved'));
}
/**
* 바로빌 서비스 URL 조회 (공통)
*/
private function getServiceUrl(string $path): array
{
return ['url' => $this->barobillService->getBaseUrl().$path];
}
/**
* 은행 빠른조회 서비스 URL 조회
*/
public function bankServiceUrl(Request $request)
public function bankServiceUrl()
{
return ApiResponse::handle(function () {
$baseUrl = config('services.barobill.test_mode', true)
? 'https://testws.barobill.co.kr'
: 'https://ws.barobill.co.kr';
return ['url' => $baseUrl.'/Bank/BankAccountService'];
return $this->getServiceUrl('/BANKACCOUNT.asmx');
}, __('message.fetched'));
}
@@ -106,11 +110,7 @@ public function bankServiceUrl(Request $request)
public function accountLinkUrl()
{
return ApiResponse::handle(function () {
$baseUrl = config('services.barobill.test_mode', true)
? 'https://testws.barobill.co.kr'
: 'https://ws.barobill.co.kr';
return ['url' => $baseUrl.'/Bank/AccountLink'];
return $this->getServiceUrl('/BANKACCOUNT.asmx');
}, __('message.fetched'));
}
@@ -120,11 +120,7 @@ public function accountLinkUrl()
public function cardLinkUrl()
{
return ApiResponse::handle(function () {
$baseUrl = config('services.barobill.test_mode', true)
? 'https://testws.barobill.co.kr'
: 'https://ws.barobill.co.kr';
return ['url' => $baseUrl.'/Card/CardLink'];
return $this->getServiceUrl('/CARD.asmx');
}, __('message.fetched'));
}
@@ -134,11 +130,7 @@ public function cardLinkUrl()
public function certificateUrl()
{
return ApiResponse::handle(function () {
$baseUrl = config('services.barobill.test_mode', true)
? 'https://testws.barobill.co.kr'
: 'https://ws.barobill.co.kr';
return ['url' => $baseUrl.'/Certificate/Register'];
return $this->getServiceUrl('/CORPSTATE.asmx');
}, __('message.fetched'));
}
}