trait InteractsWithPortOneWebhooks (View source)

서명된 PortOne 웹훅을 패키지 웹훅 경로(portone.webhook)로 보내는 테스트 도우미.

Laravel 테스트 케이스에서 use 한다. 설정된 portone.webhook_secret으로 서명하므로 실제 웹훅과 같이 검증·이벤트 발송·취소 동기화를 거친다.

$this->postPortOneWebhook('Transaction.Cancelled', $paymentId)->assertOk();

Methods

TestResponse
postPortOneWebhook(string $type, string $paymentId, array $data = [])

서명된 웹훅을 패키지 웹훅 경로로 보낸다.

Details

protected TestResponse postPortOneWebhook(string $type, string $paymentId, array $data = [])

서명된 웹훅을 패키지 웹훅 경로로 보낸다.

Parameters

string $type

웹훅 종류(예: Transaction.Paid, Transaction.Cancelled)

string $paymentId

PortOne 결제 식별자

array $data

data에 더할 값(예: transactionId, cancellationId)

Return Value

TestResponse

웹훅 경로의 응답

Exceptions

ConfigurationException