-
Notifications
You must be signed in to change notification settings - Fork 2
feat : 결제 관련 응답 수정 및 서비스 단 검증 조건 추가 #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Ji-minhyeok
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다 고생하셨습니다!
|
|
||
| boolean existsByLessonIdAndUserId(Long lessonId, Long userId); | ||
|
|
||
| Optional<LessonParticipant> findByLessonIdAndUserId(Long lessonId, Long userId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사용되는 부분을 추후에 공통 로직으로 빼야할지 고민해봐야겠군요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 추후에 리팩토링 진행해봐도 좋을 것 같습니다!
| return BaseResponse.ok("결제 취소 성공", payResult, HttpStatus.OK); | ||
| public ResponseEntity<BaseResponse<CancelPaymentResponseDto>> cancel( | ||
| @Valid @RequestBody CancelPaymentRequestDto request) { | ||
| return BaseResponse.ok("결제 취소 성공", paymentService.processCancel(request), HttpStatus.OK); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
더 깔끔한 응답 형태 반환인 것 같습니다! 참고해보겠습니다
🛠️ 작업 내용
데이터 처리 간 무결성을 위해 바꾸다 보니 커밋 양이 좀 많아졌습니다....
우선 결제 응답 간 paymentKey 제거(노출되면 안되기 때문에 orderId를 통해 삭제 진행)
서비스에서 결제 진행 간
우선 lessonParticipant에 데이터가 있어야 하고(수업 참여자만 결제 가능),
중복 결제가 되면 안되고
쿠폰 관련도 체크
서비스에서 결제 취소 간
날짜 검증(24시간 전에는 취소 안되도록)
취소 날짜 기간 한달전(minusMonth 메서드 있어서 30일에서 -> 한달로 다시 수정했습니다, figma에도 답글 남겨놨습니다) -> 100%
취소 날짜 일주일 전 50%,
취소 날짜 3일전 30%,
취소 시 lessonParticipant 데이터 hard delete
lesson 상태 변경 및 참여 가능 숫자 1증가
mock 데이터에 lessonParticipant 데이터도 추가하도록 수정했습니다.
✅ PR 유형
✅ Check List
🔗 관련 이슈
💬 기타 참고 사항
서비스에서 좀 더 분리가 가능한 부분(리팩토링)은 추후 이슈 파서 진행하겠습니다.
우선 결제 관련 구현은 전부 다 끝냈습니다.(api 명세에도 반영 완료 하였고 merge까지 된 경우에 다시 표시하겠습니다)