|
|
@@ -17,11 +17,14 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.thymeleaf.util.StringUtils;
|
|
|
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
+import com.style24.core.biz.service.TscKakaoPayService;
|
|
|
import com.style24.core.biz.service.TscKcpService;
|
|
|
+import com.style24.core.biz.service.TscNaverPayService;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.core.support.session.TscSession;
|
|
|
import com.style24.front.biz.dao.TsfOrderDao;
|
|
|
import com.style24.front.support.security.session.TsfSession;
|
|
|
+import com.style24.persistence.domain.KakaoPay;
|
|
|
import com.style24.persistence.domain.Order;
|
|
|
import com.style24.persistence.domain.Payment;
|
|
|
|
|
|
@@ -42,6 +45,12 @@ public class TsfOrderService {
|
|
|
|
|
|
@Autowired
|
|
|
private TscKcpService coreKcpService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TscKakaoPayService coreKakaoPayService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TscNaverPayService coreNaverPayService;
|
|
|
|
|
|
/**
|
|
|
* 마이페이지 검색 기간 영역 설정
|
|
|
@@ -237,7 +246,7 @@ public class TsfOrderService {
|
|
|
if(TscConstants.PgGb.KCP.value().equals(param.getPgGb()) || TscConstants.PgGb.PAYCO.value().equals(param.getPgGb())) {
|
|
|
result = coreKcpService.kcpPayRequest(param, request, response);
|
|
|
} else if (TscConstants.PgGb.KAKAO.value().equals(param.getPgGb())) {
|
|
|
- result = null;
|
|
|
+ result = coreKakaoPayService.approveKakaoPayment(param);
|
|
|
} else if (TscConstants.PgGb.NAVER.value().equals(param.getPgGb())) {
|
|
|
result = null;
|
|
|
} else {
|
|
|
@@ -250,9 +259,15 @@ public class TsfOrderService {
|
|
|
|
|
|
if(updatePaymentForOrderFinished(result) < 1) {
|
|
|
// TODO 전체 취소 로직 추가
|
|
|
- coreKcpService.kcpPayRollBack(result, request);
|
|
|
-
|
|
|
- throw new IllegalArgumentException("결제 정보 저장 실패. 새로고침 후 다시 시작해주세요.");
|
|
|
+ if(TscConstants.PgGb.KCP.value().equals(param.getPgGb()) || TscConstants.PgGb.PAYCO.value().equals(param.getPgGb())) {
|
|
|
+ coreKcpService.kcpPayRollBack(result, request);
|
|
|
+ } else if (TscConstants.PgGb.KAKAO.value().equals(param.getPgGb())) {
|
|
|
+ coreKakaoPayService.cancelKakaoPayment(param);
|
|
|
+ } else if (TscConstants.PgGb.NAVER.value().equals(param.getPgGb())) {
|
|
|
+ result = null;
|
|
|
+ } else {
|
|
|
+ throw new IllegalArgumentException("결제 정보 저장 실패. 새로고침 후 다시 시작해주세요.");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
coreKcpService.kcpPayRollBack(result, request);
|
|
|
@@ -335,11 +350,10 @@ public class TsfOrderService {
|
|
|
public Payment setPgDataInfo(Order order) {
|
|
|
Payment payment = new Payment();
|
|
|
if(TscConstants.PgGb.KAKAO.value().equals(order.getPgGb())) { // 카카오페이
|
|
|
- // TODO 카카오페이 데이터 세팅
|
|
|
- payment = null;
|
|
|
+ KakaoPay kakaoPay = coreKakaoPayService.kakaoPaymentReady(order);
|
|
|
+ payment = coreKakaoPayService.setKakaoOrderData(kakaoPay, order);
|
|
|
} else if(TscConstants.PgGb.NAVER.value().equals(order.getPgGb())) { // 네이버페이
|
|
|
- // TODO 네이버페이 데이터 세팅
|
|
|
- payment = null;
|
|
|
+ payment = coreNaverPayService.setNaverOrderData(order);
|
|
|
} else if(TscConstants.PgGb.KCP.value().equals(order.getPgGb()) || TscConstants.PgGb.PAYCO.value().equals(order.getPgGb())){ // KCP, PAYCO
|
|
|
payment = coreKcpService.setKcpOrderData(order);
|
|
|
} else {
|