feat(ecommerce): 현금영수증 발급 회차를 훅 페이로드로 제공
토스페이먼츠는 동일 orderId 로 재발급을 요청하면 중복으로 거부한다.
계획서 §B-8 은 "{order_number}-cr{seq}" 형태의 회차 접미를 요구하는데,
기존 발급 훅 페이로드에는 order_number 원본만 있어 리스너가 회차를 알 수 없었다.
회차는 코어가 센다. 프로바이더 리스너가 이력 테이블 구조를 알 필요가 없고,
향후 팝빌·바로빌 등 다른 발급사도 같은 숫자를 그대로 쓸 수 있다.
프로바이더 종속 문자열 조립은 리스너 내부에만 둔다.
실패한 발급도 회차를 소모한다 — 프로바이더에 요청이 도달한 뒤 응답만 실패한
경우 같은 식별자를 재사용하면 중복 거부되기 때문이다. 취소 이력은 소모하지 않는다.
This commit is contained in:
1 parent
af1da5fe0b
commit
cd82fe3fb4
5 files changed
+94
No files matched your search
@@ -94,4 +94,15 @@ class OrderCashReceiptRepository implements OrderCashReceiptRepositoryInterface
|
||||
->orderByDesc('id')
|
||||
->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function countIssues(Order $order): int
|
||||
{
|
||||
return $this->model->newQuery()
|
||||
->where('order_id', $order->id)
|
||||
->where('transaction_type', CashReceiptTransactionType::ISSUE->value)
|
||||
->count();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user