fix: 결제 검증의 중복 외부 호출 제거 - #421
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✅ PR 설명
기존엔 verifyPayment가 Toss confirm으로 승인한 뒤, 같은 결제를 다시 GET /payments/{key}로 조회해 status와 금액을 재확인하는 이중 호출 구조였습니다.
그러나 confirm 응답 자체가 승인 사실의 신뢰 원천이므로 재조회는 지연을 2배로 만들고, 두 호출 사이 상태 변화와 두 번째 호출 실패로 승인됐으나 미완결 될 수 있는 위험만 키웁니다.
이에 confirm 응답의 totalAmount로 금액을 그 자리에서 검증하고 두 번째 GET 호출을 제거해서 승인 검증을 외부 왕복 1회로 단순화했습니다.
🏗 작업 내용
📸 테스트 결과 (선택)
🔗 관련 이슈 (선택)
🚨 참고 사항 (선택)