|
|
@@ -12,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.env.Environment;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.web.context.request.RequestContextHolder;
|
|
|
+import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
import com.kcp.J_PP_CLI_N;
|
|
|
@@ -348,8 +350,10 @@ public class TsfOrderService {
|
|
|
if(TscConstants.PgGb.KCP.value().equals(param.getPgGb()) || TscConstants.PgGb.PAYCO.value().equals(param.getPgGb())) {
|
|
|
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("결제 정보 저장 실패. 새로고침 후 다시 시작해주세요.");
|
|
|
@@ -626,7 +630,8 @@ public class TsfOrderService {
|
|
|
*/
|
|
|
public GiftCard kcpCashReceiptsRequest(GiftCard param) {
|
|
|
GiftCard result = new GiftCard();
|
|
|
- String cust_ip = TsfSession.getInfo().getIpAddr();
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
|
|
|
+ String cust_ip = request.getRemoteAddr();
|
|
|
String reqTx = "pay"; // 현금영수증 신청
|
|
|
String txCd = "07010000"; // 현금영수증 등록 요청
|
|
|
String ordPhnno = "";
|
|
|
@@ -635,7 +640,7 @@ public class TsfOrderService {
|
|
|
}
|
|
|
|
|
|
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( "", 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 rcpt_data_set = c_PayPlus.mf_add_set( "rcpt_data" ) ;
|
|
|
@@ -643,15 +648,15 @@ public class TsfOrderService {
|
|
|
int corp_data_set = c_PayPlus.mf_add_set( "corp_data" ) ;
|
|
|
|
|
|
// 현금영수증 정보
|
|
|
- c_PayPlus.mf_set_us( rcpt_data_set, "user_type", "PG01") ;
|
|
|
+ c_PayPlus.mf_set_us( rcpt_data_set, "user_type", "PGNW") ;
|
|
|
c_PayPlus.mf_set_us( rcpt_data_set, "trad_time", param.getTradeTime()) ;
|
|
|
c_PayPlus.mf_set_us( rcpt_data_set, "tr_code" , "0") ; // 0 : 소득공제용(개인), 1 : 지출증빙용(기업)
|
|
|
c_PayPlus.mf_set_us( rcpt_data_set, "id_info" , ordPhnno) ; // 발급 대상이 개인인 경우에는 주민번호, 휴대폰번호,현금영수증 카드를 세팅하며, 기업인 경우에는 대상 사업자 번호를 입력. 자진발급으로 등록 시, “0100001234” 으로 입력.
|
|
|
c_PayPlus.mf_set_us( rcpt_data_set, "amt_tot" , param.getUsGfcdAmt() + "") ; // 현금영수증 금액 (공급가액 + 부가가치세 + 봉사료)
|
|
|
- //c_PayPlus.mf_set_us( rcpt_data_set, "amt_sup" , amt_sup ) ; // 공급가액
|
|
|
- //c_PayPlus.mf_set_us( rcpt_data_set, "amt_svc" , amt_svc ) ; // 봉사료
|
|
|
- //c_PayPlus.mf_set_us( rcpt_data_set, "amt_tax" , amt_tax ) ; // 부가가치세 (공급가액의 10%)
|
|
|
- c_PayPlus.mf_set_us( rcpt_data_set, "pay_type" , "PAXX") ; // 무슨 값인지 알 수 없음.
|
|
|
+ c_PayPlus.mf_set_us( rcpt_data_set, "amt_sup" , (param.getUsGfcdAmt() - ((int)(param.getUsGfcdAmt() / 11))) + "") ; // 공급가액
|
|
|
+ c_PayPlus.mf_set_us( rcpt_data_set, "amt_svc" , "0") ; // 봉사료
|
|
|
+ c_PayPlus.mf_set_us( rcpt_data_set, "amt_tax" , ((int)(param.getUsGfcdAmt() / 11)) + "") ; // 부가가치세 (공급가액의 10%)
|
|
|
+ c_PayPlus.mf_set_us( rcpt_data_set, "pay_type" , "PAXX") ;
|
|
|
|
|
|
// 주문 정보
|
|
|
c_PayPlus.mf_set_us( ordr_data_set, "ordr_idxx", param.getOrdNo() + "") ; // 주문번호
|
|
|
@@ -659,13 +664,12 @@ public class TsfOrderService {
|
|
|
c_PayPlus.mf_set_us( ordr_data_set, "buyr_name", param.getOrdNm());
|
|
|
c_PayPlus.mf_set_us( ordr_data_set, "buyr_tel1", ordPhnno);
|
|
|
c_PayPlus.mf_set_us( ordr_data_set, "buyr_mail", param.getOrdEmail());
|
|
|
- // c_PayPlus.mf_set_us( ordr_data_set, "comment" , comment); // 비고 (ex - 여유 파라미터)
|
|
|
|
|
|
// 가맹점 정보
|
|
|
c_PayPlus.mf_set_us( corp_data_set, "corp_type", "0"); // 사업장 구분 (직접 판매 : 0, 입점몰 판매 : 1)
|
|
|
|
|
|
// 실행
|
|
|
- c_PayPlus.mf_do_tx(env.getProperty("pg.kcp.site.cd"), "", txCd, cust_ip, param.getOrdNo() + "", env.getProperty("pg.kcp.log.dir"), "0");
|
|
|
+ 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");
|
|
|
|
|
|
// 결과
|
|
|
result.setResultCd(c_PayPlus.m_res_cd);
|
|
|
@@ -677,9 +681,11 @@ public class TsfOrderService {
|
|
|
result.setAuthNo(c_PayPlus.mf_get_res("receipt_no"));
|
|
|
|
|
|
// 성공시 TB_GIFTCARD_RECEIPT INSERT
|
|
|
+ orderDao.createGiftcartReceipt(result);
|
|
|
}
|
|
|
|
|
|
// 성공이든 실패이든 로그성 데이터 TB_GIFTCARD_RECEIPT_API INSERT
|
|
|
+ coreOrderDao.createGiftcartReceiptApi(result);
|
|
|
|
|
|
return result;
|
|
|
}
|