feat: [barobill] 바로빌 연동 관리 API 7개 엔드포인트 구현
- SOAP 기반 BarobillSoapService 생성 (MNG 코드 포팅) - BarobillMember, BarobillConfig 모델 생성 - BarobillController 7개 메서드 (login, signup, status, URL 조회) - FormRequest 검증 클래스 3개 생성 - 라우트 등록 (POST /barobill/login, /signup, GET /status 등) - i18n 메시지 키 추가 (ko/en) - config/services.php에 barobill 설정 추가
This commit is contained in:
73
app/Http/Controllers/Api/V1/BarobillController.php
Normal file
73
app/Http/Controllers/Api/V1/BarobillController.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\V1;
|
||||
|
||||
use App\Helpers\ApiResponse;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Barobill\BankServiceUrlRequest;
|
||||
use App\Http\Requests\Barobill\BarobillLoginRequest;
|
||||
use App\Http\Requests\Barobill\BarobillSignupRequest;
|
||||
use App\Services\Barobill\BarobillSoapService;
|
||||
|
||||
class BarobillController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private BarobillSoapService $barobillSoapService
|
||||
) {}
|
||||
|
||||
public function login(BarobillLoginRequest $request)
|
||||
{
|
||||
return ApiResponse::handle(
|
||||
fn () => $this->barobillSoapService->registerLogin($request->validated()),
|
||||
__('message.barobill.login_success')
|
||||
);
|
||||
}
|
||||
|
||||
public function signup(BarobillSignupRequest $request)
|
||||
{
|
||||
return ApiResponse::handle(
|
||||
fn () => $this->barobillSoapService->registerSignup($request->validated()),
|
||||
__('message.barobill.signup_success')
|
||||
);
|
||||
}
|
||||
|
||||
public function bankServiceUrl(BankServiceUrlRequest $request)
|
||||
{
|
||||
return ApiResponse::handle(
|
||||
fn () => $this->barobillSoapService->getBankServiceRedirectUrl($request->validated()),
|
||||
__('message.fetched')
|
||||
);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return ApiResponse::handle(
|
||||
fn () => $this->barobillSoapService->getIntegrationStatus(),
|
||||
__('message.fetched')
|
||||
);
|
||||
}
|
||||
|
||||
public function accountLinkUrl()
|
||||
{
|
||||
return ApiResponse::handle(
|
||||
fn () => $this->barobillSoapService->getAccountLinkRedirectUrl(),
|
||||
__('message.fetched')
|
||||
);
|
||||
}
|
||||
|
||||
public function cardLinkUrl()
|
||||
{
|
||||
return ApiResponse::handle(
|
||||
fn () => $this->barobillSoapService->getCardLinkRedirectUrl(),
|
||||
__('message.fetched')
|
||||
);
|
||||
}
|
||||
|
||||
public function certificateUrl()
|
||||
{
|
||||
return ApiResponse::handle(
|
||||
fn () => $this->barobillSoapService->getCertificateRedirectUrl(),
|
||||
__('message.fetched')
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user