Skip to content

Conversation

@Ogu1208
Copy link
Contributor

@Ogu1208 Ogu1208 commented Jan 3, 2026

관련 Issue (필수)

주요 변경 사항 (필수)

  • TossPaymentClient에 결제 취소 API 호출 메서드 추가
  • 부분 취소 지원을 위한 DTO 구현 (TossPaymentCancelRequest, TossPaymentCancelResponse, TossCancelDetail)
  • 멱등키(Idempotency-Key) 헤더 적용 (재시도/배치 실패 복구 대비)

리뷰어 참고 사항

  • 부분 취소를 여러 번 하면 TossPaymentCancelResponse.cancels 배열에 취소 내역이 누적됨
    (각 취소 거래마다 거래를 구분하는 transactionKey를 가짐)
  • 멱등키는 현재 매 요청마다 새로 생성 중. 재시도 로직 필요 시 같은 키를 재사용해야 함
image
  • TossPaymentCancelRequest의 @JsonInclude(NON_NULL)은 전액 취소 시 cancelAmount 필드를 JSON에서 제외하기 위함

추가 정보

토스 결제 취소 API 문서

토스 멱등키 관련 API 문서

PR 작성 체크리스트 (필수)

  • 제목이 Issue와 동일함을 확인했습니다.
  • 리뷰어를 지정했습니다.
  • 프로젝트를 연결했습니다.

Copy link
Contributor

@chanwonlee chanwonlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

결제 취소 관련 RestClient 구현 코드 확인했습니다!
PR 설명 자세하게 작성해 주시고 토스 API 문서 링크까지 함께 첨부해 주셔서 코드 분석하고 공부하는 데 큰 도움이 되었습니다!
고생하셨습니다 👍👍

Copy link
Contributor

@Jimin730 Jimin730 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

늦게 확인해서 죄송합니다 😭
구현해주신 부분 모두 확인했습니다!
해당 로직 관련 자료도 첨부해주셔서 따로 공부하면서 코드 확인하기 좋았던 것 같아요 감사합니다 👍
고생하셨습니다!!

@Ogu1208 Ogu1208 force-pushed the feature/87-toss-cancel-client branch from 365356d to 878ebf8 Compare January 6, 2026 07:53
@Ogu1208 Ogu1208 merged commit 0e213d6 into develop Jan 6, 2026
3 checks passed
@Ogu1208 Ogu1208 deleted the feature/87-toss-cancel-client branch January 6, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEATURE] Toss 결체 취소(부분 환불 포함) RestClient 구현

4 participants