Skip to content
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

배포를 위한 merge #24

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class ReservationService {
private final ParkingRepository parkingRepository;
private final VehicleRepository vehicleRepository;
private final MemberRepository memberRepository;
private final KakaoPayService kakaoPayService;

@Transactional
public ReservationResponse reserve(String memberId, ReservationRequest request) {
Expand All @@ -54,22 +53,11 @@ public ReservationResponse reserve(String memberId, ReservationRequest request)
.reservationDate(request.reservationDate())
.startTime(request.startTime())
.endTime(request.endTime())
.reservationStatus(ReservationStatus.WAITING)
.reservationStatus(ReservationStatus.ACCEPTED)
.build();

reservationRepository.save(reservation);

// 카카오페이 결제 성공 시 예약 상태 변경
PayReadyResponse response = kakaoPayService.ready(reservation, totalFee);
if(response != null) {
reservation.setReservationStatus(ReservationStatus.ACCEPTED);
}
else {
reservation.setReservationStatus(ReservationStatus.CANCELED);
}

reservationRepository.save(reservation);

return ReservationResponse.builder()
.id(reservation.getId())
.parkingId(reservation.getParkingId())
Expand Down
Loading