Skip to content

Commit

Permalink
modify: #178 PaymentProviderType - 타입 일치하지 않는 부분 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
woody35545 committed May 15, 2024
1 parent 31910ef commit 3c4e1f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ public void confirmOrder(OrderConfirmRequest request) {
PaymentCreationRequest.builder()
.orderId(request.getOrderId())
.totalAmount(totalPrice)
.providerType(request.getPaymentProviderType())
.providerPaymentKey(paymentConfirmResponse.getPaymentKey())
.providerOrderId(paymentConfirmResponse.getOrderId())
.providerPaymentStatus(paymentConfirmResponse.getStatus().toString())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.t3t.bookstoreapi.payment.repository;

import com.t3t.bookstoreapi.payment.constant.PaymentProviderType;
import com.t3t.bookstoreapi.payment.model.entity.PaymentProvider;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;

public interface PaymentProviderRepository extends JpaRepository<PaymentProvider, Long>{
Optional<PaymentProvider> findByName(String providerName);
Optional<PaymentProvider> findByName(PaymentProviderType providerName);
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public PaymentConfirmResponse confirmPayment(PaymentConfirmRequest paymentReques
@Override
public PaymentDto createPayment(PaymentCreationRequest request) {

PaymentProvider paymentProvider = paymentProviderRepository.findByName(PaymentProviderType.TOSS.toString())
PaymentProvider paymentProvider = paymentProviderRepository.findByName(PaymentProviderType.TOSS)
.orElseThrow(() -> new PaymentProviderNotFoundForNameException(PaymentProviderType.TOSS.toString()));

Order order = orderRepository.findById(request.getOrderId())
Expand Down

0 comments on commit 3c4e1f2

Please sign in to comment.