|
@@ -16,6 +16,7 @@ import com.kcp.J_PP_CLI_N;
|
|
|
import com.style24.core.biz.dao.TscOrderDao;
|
|
import com.style24.core.biz.dao.TscOrderDao;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.persistence.domain.CustAccount;
|
|
import com.style24.persistence.domain.CustAccount;
|
|
|
|
|
+import com.style24.persistence.domain.GiftCard;
|
|
|
import com.style24.persistence.domain.Order;
|
|
import com.style24.persistence.domain.Order;
|
|
|
import com.style24.persistence.domain.Payment;
|
|
import com.style24.persistence.domain.Payment;
|
|
|
|
|
|
|
@@ -415,4 +416,78 @@ public class TscKcpService {
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * KCP 현금영수증 취소 신청 API
|
|
|
|
|
+ * param.setModType("STSQ"); // 요청 구분 (STSQ : 조회, STSC : 전체취소, STPC : 부분취소) >> 조회는 사용 안함 > result 안받음. 사용시 result 추가활것.
|
|
|
|
|
+ * param.setTradeNo("20210423066396"); // 현금영수증 거래번호 (TB_GIFTCARD_RECEIPT.TRADE_NO)
|
|
|
|
|
+ * param.setTradeTime("20210422200347"); // 결제시각 : YYYYMMDDHH24MISS 형식
|
|
|
|
|
+ * param.setOrdNo(100); // 주문번호
|
|
|
|
|
+ *
|
|
|
|
|
+ * * 부분취소시 추가 금액
|
|
|
|
|
+ * param.setRmGfcdAmt(10000); // 잔여금액 (부분취소 이전에 남은 금액)
|
|
|
|
|
+ * param.setUsGfcdAmt(3000); // 부분취소 요청 금액
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param GiftCard
|
|
|
|
|
+ * @author xodud1202
|
|
|
|
|
+ * @since 2021. 04. 23
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
|
|
+ public GiftCard kcpCashReceiptCancel(GiftCard param) {
|
|
|
|
|
+ GiftCard result = new GiftCard();
|
|
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
|
|
|
|
|
+ String cust_ip = request.getRemoteAddr();
|
|
|
|
|
+ String reqTx = "mod"; // 현금영수증 취소 or 조회 요청
|
|
|
|
|
+ String txCd = "07030000"; // 현금영수증 조회 요청
|
|
|
|
|
+
|
|
|
|
|
+ J_PP_CLI_N c_PayPlus = new J_PP_CLI_N();
|
|
|
|
|
+ c_PayPlus.mf_init( "", env.getProperty("pg.kcp.gw.url"), env.getProperty("pg.kcp.gw.port"), Integer.parseInt(env.getProperty("pg.kcp.tx.mode")), env.getProperty("pg.kcp.log.dir"));
|
|
|
|
|
+ c_PayPlus.mf_init_set();
|
|
|
|
|
+
|
|
|
|
|
+ int mod_data_set_no ;
|
|
|
|
|
+
|
|
|
|
|
+ mod_data_set_no = c_PayPlus.mf_add_set( "mod_data" ) ;
|
|
|
|
|
+
|
|
|
|
|
+ // 요청 구분
|
|
|
|
|
+ if("STSQ".equals(param.getModType())) {
|
|
|
|
|
+ txCd = "07030000" ; // 조회 요청
|
|
|
|
|
+ } else {
|
|
|
|
|
+ txCd = "07020000" ; // 취소 요청
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 부분 취소
|
|
|
|
|
+ if("STPC".equals(param.getModType())) {
|
|
|
|
|
+ c_PayPlus.mf_set_us( mod_data_set_no, "mod_mny" , String.valueOf(param.getUsGfcdAmt())); // 부분취소 요청 금액
|
|
|
|
|
+ c_PayPlus.mf_set_us( mod_data_set_no, "rem_mny" , String.valueOf(param.getRmGfcdAmt())); // 잔여금액 (부분취소 이전에 남은 금액)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ c_PayPlus.mf_set_us( mod_data_set_no, "mod_type" , param.getModType()) ;
|
|
|
|
|
+ c_PayPlus.mf_set_us( mod_data_set_no, "mod_value" , param.getTradeNo()) ;
|
|
|
|
|
+ c_PayPlus.mf_set_us( mod_data_set_no, "mod_gubn" , "MG01" ) ;
|
|
|
|
|
+ c_PayPlus.mf_set_us( mod_data_set_no, "trad_time" , param.getTradeTime()) ;
|
|
|
|
|
+
|
|
|
|
|
+ // 실행
|
|
|
|
|
+ c_PayPlus.mf_do_tx(env.getProperty("pg.kcp.site.cd"), "", txCd, cust_ip, String.valueOf(param.getOrdNo()), env.getProperty("pg.kcp.log.level"), "0");
|
|
|
|
|
+
|
|
|
|
|
+ log.info("CHECK CASH MOD RESULT ::::: {}", c_PayPlus.getRecvObj().toString());
|
|
|
|
|
+
|
|
|
|
|
+ // 결과
|
|
|
|
|
+ result.setResultCd(c_PayPlus.m_res_cd);
|
|
|
|
|
+ result.setResultMsg(c_PayPlus.m_res_msg);
|
|
|
|
|
+ result.setOrdNo(param.getOrdNo());
|
|
|
|
|
+ result.setUsGfcdAmt(-param.getUsGfcdAmt());
|
|
|
|
|
+ if(!"STSQ".equals(param.getModType())) {
|
|
|
|
|
+ if ("0000".equals(result.getResultCd())) {
|
|
|
|
|
+ result.setTradeNo(c_PayPlus.mf_get_res("cash_no"));
|
|
|
|
|
+ result.setAuthNo(c_PayPlus.mf_get_res("receipt_no"));
|
|
|
|
|
+
|
|
|
|
|
+ // 성공시 TB_GIFTCARD_RECEIPT AMT UPDATE
|
|
|
|
|
+ orderDao.updateGiftCardReceipt(result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 성공이든 실패이든 로그성 데이터 TB_GIFTCARD_RECEIPT_API INSERT
|
|
|
|
|
+ orderDao.createGiftcartReceiptApi(result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|