|
|
@@ -331,7 +331,24 @@ public class TsfOrderService {
|
|
|
}
|
|
|
|
|
|
if(TscConstants.PgGb.KCP.value().equals(param.getPgGb()) || TscConstants.PgGb.PAYCO.value().equals(param.getPgGb())) {
|
|
|
- result = coreKcpService.kcpPayRequest(param, request, response);
|
|
|
+ if(TscConstants.PayMeans.GIFTCARD.value().equals(param.getPayMeans())) {
|
|
|
+ // 상품권 100% 결제 (PG PASS)
|
|
|
+ result.setPayAmt(0);
|
|
|
+ result.setPgCpnAmt(0);
|
|
|
+ result.setNpayPntAmt(0);
|
|
|
+ result.setPayGb("O");
|
|
|
+ result.setCardPcableYn("Y");
|
|
|
+ result.setEscrowYn("N");
|
|
|
+ result.setUpdNo(param.getCustNo());
|
|
|
+ result.setRegNo(param.getCustNo());
|
|
|
+ result.setPayStat(TscConstants.PaymentStat.PAYMENT_COMPLETE.value());
|
|
|
+ result.setPgGb(TscConstants.PgGb.ISTYLE.value());
|
|
|
+ result.setOrdNo(param.getOrdrIdxx());
|
|
|
+ result.setPayMeans(param.getPayMeans());
|
|
|
+ } else {
|
|
|
+ // 일반 KCP 결제
|
|
|
+ result = coreKcpService.kcpPayRequest(param, request, response);
|
|
|
+ }
|
|
|
} else if (TscConstants.PgGb.KAKAO.value().equals(param.getPgGb())) {
|
|
|
result = coreKakaoPayService.approveKakaoPayment(param);
|
|
|
} else if (TscConstants.PgGb.NAVER.value().equals(param.getPgGb())) {
|
|
|
@@ -364,16 +381,22 @@ public class TsfOrderService {
|
|
|
// TB_PAYMENT 등록. 실패시 PG 환불.
|
|
|
if(coreOrderDao.insertPayment(result) < 1) {
|
|
|
if(TscConstants.PgGb.KCP.value().equals(param.getPgGb()) || TscConstants.PgGb.PAYCO.value().equals(param.getPgGb())) {
|
|
|
- coreKcpService.kcpCancel(result);
|
|
|
+ if(TscConstants.PayMeans.GIFTCARD.value().equals(param.getPayMeans())) {
|
|
|
+ // 상품권 100% 결제 (PG PASS)
|
|
|
+ result.setPayStat(TscConstants.PaymentStat.PAY_BEFORE_CANCEL.value());
|
|
|
+ coreOrderDao.insertPayment(result);
|
|
|
+ } else {
|
|
|
+ coreKcpService.kcpCancel(result);
|
|
|
+ }
|
|
|
} else if (TscConstants.PgGb.KAKAO.value().equals(param.getPgGb())) {
|
|
|
param.setLeftAmt(0);
|
|
|
coreKakaoPayService.kakaoPayRollBack(param);
|
|
|
} else if (TscConstants.PgGb.NAVER.value().equals(param.getPgGb())) {
|
|
|
param.setLeftAmt(0);
|
|
|
coreNaverPayService.naverPayRollBack(param);
|
|
|
- } else {
|
|
|
- throw new IllegalArgumentException("결제 정보 저장 실패. 새로고침 후 다시 시작해주세요.");
|
|
|
}
|
|
|
+
|
|
|
+ throw new IllegalArgumentException("결제 정보 저장 실패. 새로고침 후 다시 시작해주세요.");
|
|
|
}
|
|
|
} catch(Exception e) {
|
|
|
e.printStackTrace();
|