WebhookController
final class WebhookController (View source)
포트원 웹훅 수신 컨트롤러.
원문(raw body)으로 서명을 검증한 뒤 WebhookReceived 이벤트를 발송하고, 거래 웹훅이면 종류별 결제 이벤트(PaymentPaid·PaymentCancelled·PaymentPartiallyCancelled·PaymentFailed)를 이어서 발송한다. 취소 웹훅(Transaction.Cancelled·Transaction.PartialCancelled)이면 이벤트를 보내기 전에 PortOne을 조회해 로컬 결제 레코드의 취소 상태를 맞춘다. 조회가 실패하면 이벤트 없이 예외를 전파해 PortOne이 다시 보내게 한다. 성공 200(빈 응답), 검증 실패 400, Secret 미설정 500을 반환한다.
Methods
Response
__invoke(Request $request, PortOneWebhookVerifier $verifier, PaymentOperations $operations)
웹훅 요청을 검증하고 이벤트로 변환한다.
Details
Response
__invoke(Request $request, PortOneWebhookVerifier $verifier, PaymentOperations $operations)
웹훅 요청을 검증하고 이벤트로 변환한다.