|
@@ -18,6 +18,7 @@ import com.style24.core.biz.service.TscKakaoPayService;
|
|
|
import com.style24.core.biz.service.TscKcpService;
|
|
import com.style24.core.biz.service.TscKcpService;
|
|
|
import com.style24.core.biz.service.TscNaverPayService;
|
|
import com.style24.core.biz.service.TscNaverPayService;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
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.biz.dao.TsfOrderDao;
|
|
|
import com.style24.front.support.security.session.TsfSession;
|
|
import com.style24.front.support.security.session.TsfSession;
|
|
|
import com.style24.persistence.domain.Coupon;
|
|
import com.style24.persistence.domain.Coupon;
|
|
@@ -255,6 +256,11 @@ public class TsfOrderService {
|
|
|
public Payment orderPgPayResult(Payment param, HttpServletRequest request, HttpServletResponse response) {
|
|
public Payment orderPgPayResult(Payment param, HttpServletRequest request, HttpServletResponse response) {
|
|
|
Payment result = new Payment();
|
|
Payment result = new Payment();
|
|
|
|
|
|
|
|
|
|
+ if(TscConstants.FrontGb.MOB.value().equals(TsfSession.getFrontGb()) && StringUtils.isEmpty(param.getPgGb())) {
|
|
|
|
|
+ param.setPgGb(TscConstants.PgGb.KCP.value());
|
|
|
|
|
+ param.setPayMeans(TscConstants.PayMeans.CREDIT_CARD.value());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
if(StringUtils.isEmpty(param.getPgGb())) {
|
|
if(StringUtils.isEmpty(param.getPgGb())) {
|
|
|
throw new IllegalArgumentException("결제수단을 선택해주세요.");
|
|
throw new IllegalArgumentException("결제수단을 선택해주세요.");
|
|
@@ -270,13 +276,17 @@ public class TsfOrderService {
|
|
|
throw new IllegalArgumentException("결제 수단이 잘못 입력되었습니다. 새로고침 후 다시 시도해주세요.");
|
|
throw new IllegalArgumentException("결제 수단이 잘못 입력되었습니다. 새로고침 후 다시 시도해주세요.");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 결제 수단이 없는 경우(KAKAO, NAVER) CARD로 세팅
|
|
|
|
|
+ if(StringUtils.isEmpty(param.getPayMeans())) {
|
|
|
|
|
+ result.setPayMeans(TscConstants.PayMeans.CREDIT_CARD.value());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
result.setPaySq(param.getPaySq());
|
|
result.setPaySq(param.getPaySq());
|
|
|
result.setUpdNo(param.getCustNo());
|
|
result.setUpdNo(param.getCustNo());
|
|
|
result.setRegNo(param.getCustNo());
|
|
result.setRegNo(param.getCustNo());
|
|
|
result.setPayGb("O");
|
|
result.setPayGb("O");
|
|
|
|
|
|
|
|
if(coreOrderDao.insertPayment(result) < 1) {
|
|
if(coreOrderDao.insertPayment(result) < 1) {
|
|
|
- // TODO 전체 취소 로직 추가
|
|
|
|
|
if(TscConstants.PgGb.KCP.value().equals(param.getPgGb()) || TscConstants.PgGb.PAYCO.value().equals(param.getPgGb())) {
|
|
if(TscConstants.PgGb.KCP.value().equals(param.getPgGb()) || TscConstants.PgGb.PAYCO.value().equals(param.getPgGb())) {
|
|
|
coreKcpService.kcpPayRollBack(result, request);
|
|
coreKcpService.kcpPayRollBack(result, request);
|
|
|
} else if (TscConstants.PgGb.KAKAO.value().equals(param.getPgGb())) {
|
|
} else if (TscConstants.PgGb.KAKAO.value().equals(param.getPgGb())) {
|
|
@@ -287,6 +297,8 @@ public class TsfOrderService {
|
|
|
throw new IllegalArgumentException("결제 정보 저장 실패. 새로고침 후 다시 시작해주세요.");
|
|
throw new IllegalArgumentException("결제 정보 저장 실패. 새로고침 후 다시 시작해주세요.");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ coreKcpService.kcpPayRollBack(result, request);
|
|
|
} catch(Exception e) {
|
|
} catch(Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
throw new IllegalArgumentException(e.getMessage());
|
|
throw new IllegalArgumentException(e.getMessage());
|