Skip to content

fix : TossPayments 클라이언트 예외 처리 개선#955

Merged
hye-inA merged 1 commit into
developfrom
claude/review-payment-tests-Sto0y
Mar 26, 2026
Merged

fix : TossPayments 클라이언트 예외 처리 개선#955
hye-inA merged 1 commit into
developfrom
claude/review-payment-tests-Sto0y

Conversation

@hye-inA

@hye-inA hye-inA commented Mar 26, 2026

Copy link
Copy Markdown
Collaborator

개요

작업 / 변경 내용

  • Gateway Security 설정 강화

    • Order, Payment 서비스의 gateway-security를 기본값으로 활성화 (enabled: true)
    • 모든 설정값을 환경변수로 외부화하여 유연성 증대
    • 새로운 gateway-auth-enabled 옵션 추가
    • 서비스별 보안이 필요한 경로(required-paths)와 선택적 사용자 컨텍스트 경로(optional-user-context-paths) 정의
      • Order: /api/v1/orders/*/cancel, /api/v1/orders/*/refund 필수 인증
      • Payment: /api/v1/payments/confirm 필수 인증
  • TossPayments 클라이언트 예외 처리 개선

    • confirm(), cancel(), query() 메서드에 일반 Exception 핸들링 추가
    • 네트워크 연결 오류 등 WebClientResponseException이 아닌 예외에 대한 로깅 및 처리
    • 모든 예외를 TossPaymentsApiException으로 통일하여 일관된 에러 처리

테스트 / 체크리스트

  • 로컬에서 빌드 확인 (./gradlew build)
  • 관련 테스트 작성 또는 확인
  • 스키마/마이그레이션 변경 시 팀원 공유

참고사항

  • Gateway security 기본값 변경으로 인해 배포 환경에서 APP_GATEWAY_SECURITY_ENABLED 환경변수 설정 확인 필요
  • TossPayments API 호출 시 네트워크 오류에 대한 더 안정적인 에러 처리 가능

https://claude.ai/code/session_01Lco3ZbTBRzVDcrUKM9BvHH

…ssPayments error handling

Payment and order services had gateway-security disabled (default: false),
causing @CurrentUserId to fail with IllegalStateException when AuthContext
was null. This was the root cause of the SYS-001 (500) error on
POST /api/v1/payments/confirm.

Changes:
- Enable gateway-security in payment-service (required-paths: /api/v1/payments/confirm)
- Enable gateway-security in order-service (required-paths: cancel/refund)
- Add catch-all exception handling in TossPaymentsWebClient to prevent
  unhandled connection errors from bypassing PaymentFailureHandler

https://claude.ai/code/session_01TLQ2fbwXGA2vAuit2itqde
@hye-inA hye-inA changed the title Enable gateway security and improve TossPayments error handling fix : TossPayments 클라이언트 예외 처리 개선 Mar 26, 2026
@hye-inA hye-inA merged commit 9b13ba0 into develop Mar 26, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants