Merge branch 'master' of http://yongjoon.cho@vcs.iten.co.kr:9999/hylee/kcc_adr_advc_git
@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import org.springframework.web.servlet.support.RequestContextUtils;
|
||||
|
||||
import com.fasterxml.jackson.core.io.JsonStringEncoder;
|
||||
import com.inicis.std.util.SignatureUtil;
|
||||
@ -50,6 +51,8 @@ import kcc.kccadr.adjRppl.service.AdjRpplService;
|
||||
import kcc.kccadr.adjRppl.service.AdjRpplVO;
|
||||
import kcc.kccadr.adjclsmgr.service.AdjClsMgrService;
|
||||
import kcc.kccadr.adjclsmgr.service.AdjClsMgrVO;
|
||||
import kcc.kccadr.adjst.service.PayService;
|
||||
import kcc.kccadr.adjst.service.PayVO;
|
||||
import kcc.kccadr.advc.service.AdrHstryMgrService;
|
||||
import kcc.kccadr.advc.service.AdrHstryMgrVO;
|
||||
import kcc.kccadr.advcRecord.service.AdrRecordReadingService;
|
||||
@ -126,6 +129,9 @@ public class AdjstReqStatusController {
|
||||
|
||||
@Resource(name = "adjRpplService")
|
||||
private AdjRpplService adjRpplService;
|
||||
|
||||
@Resource(name="PayService")
|
||||
private PayService payService;
|
||||
|
||||
@Value("#{globalSettings['Globals.pay.mid']}")
|
||||
private String global_mid;
|
||||
@ -520,7 +526,7 @@ public class AdjstReqStatusController {
|
||||
|
||||
// 대국민 조정사건 기록열람 신청 목록
|
||||
@RequestMapping(value = "/web/kccadr/accdnt/ai/docIssReqList.do")
|
||||
public String docIssReqList(@ModelAttribute("adrRecordReadingVO") AdrRecordReadingVO adrRecordReadingVO, ModelMap model) throws Exception {
|
||||
public String docIssReqList(@ModelAttribute("adrRecordReadingVO") AdrRecordReadingVO adrRecordReadingVO, ModelMap model, HttpServletRequest request) throws Exception {
|
||||
String auth = EgovUserDetailsHelper.isAuthenticated() ? null : EgovUserDetailsHelper.getAuthenticatedUser().toString();
|
||||
LoginVO loginVO = "anonymousUser".equals(auth) ? new LoginVO() : (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
@ -591,6 +597,17 @@ public class AdjstReqStatusController {
|
||||
/* 기타 */
|
||||
String siteDomain = global_siteDomain; //가맹점 도메인 입력
|
||||
|
||||
//서버정보 받아오기
|
||||
String scheme = request.getScheme();
|
||||
String serverName = request.getServerName();
|
||||
String serverPort = String.valueOf(request.getServerPort());
|
||||
if(!"".equals(serverPort)) serverPort = ":" + serverPort;
|
||||
|
||||
String requestUrl = scheme + "://" + serverName + serverPort;
|
||||
|
||||
//고객사 임의데이터 ("요청URL" + "§" + "pk")
|
||||
String merchantData = requestUrl + "/web/kccadr/accdnt/ai/doclssReqProcess.do" + "§";
|
||||
|
||||
model.addAttribute("mid", mid);
|
||||
model.addAttribute("signKey", signKey);
|
||||
model.addAttribute("mKey", mKey);
|
||||
@ -599,6 +616,7 @@ public class AdjstReqStatusController {
|
||||
model.addAttribute("price", price);
|
||||
model.addAttribute("signature", signature);
|
||||
model.addAttribute("siteDomain", siteDomain);
|
||||
model.addAttribute("merchantData", merchantData);
|
||||
|
||||
// ======================결제 끝===================
|
||||
|
||||
@ -682,7 +700,57 @@ public class AdjstReqStatusController {
|
||||
|
||||
return "redirect:/web/kccadr/accdnt/ai/docIssReqList.do";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@RequestMapping("/web/kccadr/accdnt/ai/doclssReqProcess.do")
|
||||
public String doclssReqProcess(HttpServletRequest request, RedirectAttributes rttr) throws Exception {
|
||||
|
||||
Map<String, ?> flashMap =RequestContextUtils.getInputFlashMap(request);
|
||||
|
||||
String pk = "";
|
||||
|
||||
/*
|
||||
* netCancleTorF
|
||||
* true = 정상결제
|
||||
* false = 정상결제 후 망취소
|
||||
*
|
||||
* */
|
||||
|
||||
String netCancleTorF = "true";
|
||||
|
||||
if(flashMap != null) {
|
||||
|
||||
pk = (String)flashMap.get("pk");
|
||||
netCancleTorF = (String)flashMap.get("netCancleTorF");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 1. netCancleTorF를 통해 망취소여부를 체크한다.
|
||||
* 2. 전닯받은 pk로 adr_pay select 후 resultcode가 0000인지 여부체크
|
||||
* 3. 0000이라면 'asctn_table' 컬럼의 테이블의 asctn_table_pk1 또는 pk2를 통해 해당 테이블에 후 처리
|
||||
*
|
||||
* */
|
||||
//1.
|
||||
if(Boolean.valueOf(netCancleTorF)) {
|
||||
//2.
|
||||
PayVO payVO = payService.selectPayForPk(pk);
|
||||
if("0000".equals(payVO.getResultcode())) {
|
||||
//3.
|
||||
adrRecordReadingService.updatePrcsnStatCd(payVO);
|
||||
}else {
|
||||
//fail
|
||||
rttr.addFlashAttribute("result", "fail");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return "redirect:/web/kccadr/accdnt/ai/docIssReqList.do";
|
||||
}
|
||||
|
||||
/**
|
||||
* 기일통지서 상세 TODO daenge 기일통지서 오즈리포팅 처리
|
||||
|
||||
@ -30,4 +30,6 @@ public interface PayService {
|
||||
// 결제 결과 insert(map - 결제모듈 결과, tableNm - 사용테이블, tablePk1 - 사용테이블 pk1, tablePk2 - 사용테이블 pk2)
|
||||
public int insertPayLog(Map<String,String> map, String tableNm, String tablePk1, String tablePk2, String userId) throws Exception;
|
||||
|
||||
// 결제 결과 확인
|
||||
public PayVO selectPayForPk(String pram) throws Exception;
|
||||
}
|
||||
|
||||
@ -46,6 +46,7 @@ public class PayVO extends ComDefaultVO implements Serializable {
|
||||
private String frstRegisterId = "" ; //등록자
|
||||
private String lastUpdtPnttm = "" ; //수정일시
|
||||
private String lastUpdusrId = "" ; //수정자
|
||||
private String merchantData = ""; //고객사 임의데이터
|
||||
|
||||
|
||||
public String getPaySeq() {
|
||||
@ -264,6 +265,13 @@ public class PayVO extends ComDefaultVO implements Serializable {
|
||||
public void setLastUpdusrId(String lastUpdusrId) {
|
||||
this.lastUpdusrId = lastUpdusrId;
|
||||
}
|
||||
public String getMerchantData() {
|
||||
return merchantData;
|
||||
}
|
||||
public void setMerchantData(String merchantData) {
|
||||
this.merchantData = merchantData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -11,5 +11,8 @@ public class PayDAO extends EgovAbstractDAO {
|
||||
public int insertPayLog(PayVO payVO) throws Exception {
|
||||
return (int) update("payDAO.insertPayLog", payVO);
|
||||
}
|
||||
|
||||
|
||||
public PayVO selectPayForPk(String pram) throws Exception {
|
||||
return (PayVO) select("payDAO.selectPayForPk", pram);
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,5 +79,12 @@ public class PayServiceImpl extends EgovAbstractServiceImpl implements PayServi
|
||||
|
||||
return payDAO.insertPayLog(payVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PayVO selectPayForPk(String pram) throws Exception {
|
||||
return payDAO.selectPayForPk(pram);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.inicis.std.util.SignatureUtil;
|
||||
|
||||
@ -151,7 +152,9 @@ public class InipayWebController {
|
||||
*
|
||||
* */
|
||||
@RequestMapping("/web/kccadr/inipay/INIstdpayPcReturn.do")
|
||||
public String INIstdpayPcReturn(HttpServletRequest request, ModelMap model
|
||||
public String INIstdpayPcReturn(HttpServletRequest request
|
||||
, ModelMap model
|
||||
, RedirectAttributes rttr
|
||||
) throws Exception {
|
||||
|
||||
HttpSession test = request.getSession();
|
||||
@ -173,6 +176,18 @@ public class InipayWebController {
|
||||
* */
|
||||
Map<String,String> map = payUtill.payProcessing(request, model);
|
||||
|
||||
|
||||
//고객사 임의데이터 (요청URL + "§" + pk)
|
||||
String merchantData = map.get("merchantData");
|
||||
|
||||
String[] s_merchantData = merchantData.split("§");
|
||||
|
||||
String url = s_merchantData[0];
|
||||
String pk = s_merchantData[1];
|
||||
|
||||
rttr.addFlashAttribute("pk", pk);
|
||||
rttr.addFlashAttribute("netCancleTorF", map.get("netCancleTorF"));
|
||||
|
||||
/*
|
||||
* 결제 결과
|
||||
* 파라미터 :
|
||||
@ -188,14 +203,15 @@ public class InipayWebController {
|
||||
payService.insertPayLog(
|
||||
map,
|
||||
"adr_record_reading",
|
||||
"record_reading_seq",
|
||||
pk,
|
||||
"adr_seq",
|
||||
loginVO.getUniqId()
|
||||
);
|
||||
|
||||
//성공여부
|
||||
model.addAttribute("netCancleTorF", map.get("netCancleTorF"));
|
||||
|
||||
|
||||
return "/web/kccadr/inipay/INIstdpay_pc_return";
|
||||
return "redirect:" + url;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -2,6 +2,8 @@ package kcc.kccadr.advcRecord.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import kcc.kccadr.adjst.service.PayVO;
|
||||
|
||||
public interface AdrRecordReadingService {
|
||||
|
||||
String insert4Func(
|
||||
@ -36,4 +38,6 @@ public interface AdrRecordReadingService {
|
||||
//L page
|
||||
List<AdrRecordReadingVO> selectPagingList(AdrRecordReadingVO adrHstryMgrVO) throws Exception;
|
||||
|
||||
// 결제완료 처리
|
||||
int updatePrcsnStatCd(PayVO payVO) throws Exception;
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
|
||||
import kcc.kccadr.adjst.service.PayVO;
|
||||
import kcc.kccadr.advc.service.AdrHstryMgrVO;
|
||||
import kcc.kccadr.advcRecord.service.AdrRecordReadingVO;
|
||||
|
||||
@ -186,4 +187,9 @@ public class AdrRecordReadingDAO extends EgovAbstractDAO {
|
||||
List<AdrRecordReadingVO> tlist = (List<AdrRecordReadingVO>) list("AdrRecordReadingDAO.selectPagingList", adrHstryMgrVO);
|
||||
return tlist;
|
||||
}
|
||||
|
||||
public int updatePrcsnStatCd(PayVO payVO) throws Exception {
|
||||
return update("adrRecordReadingDAO.updatePrcsnStatCd", payVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -8,6 +8,10 @@ import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import kcc.com.cmm.LoginVO;
|
||||
import kcc.com.utl.fcc.service.EgovStringUtil;
|
||||
import kcc.kccadr.adjst.service.PayVO;
|
||||
import kcc.kccadr.advcRecord.service.AdrRecordReadingService;
|
||||
import kcc.kccadr.advcRecord.service.AdrRecordReadingVO;
|
||||
|
||||
@ -100,4 +104,15 @@ public class AdrRecordReadingServiceImpl implements AdrRecordReadingService {
|
||||
return adrRecordReadingDAO.selectPagingList(adrRecordReadingVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePrcsnStatCd(PayVO payVO) throws Exception {
|
||||
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated() ? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser() : null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getUniqId());
|
||||
|
||||
payVO.setLastUpdusrId(userId);
|
||||
|
||||
return adrRecordReadingDAO.updatePrcsnStatCd(payVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -110,6 +110,7 @@ public class PayUtill {
|
||||
|
||||
resultMap = ParseUtil.parseStringToMap(test); //문자열을 MAP형식으로 파싱
|
||||
|
||||
resultMap.put("merchantData", merchantData);
|
||||
|
||||
// 수신결과를 파싱후 resultCode가 "0000"이면 승인성공 이외 실패
|
||||
|
||||
@ -150,7 +151,9 @@ public class PayUtill {
|
||||
resultMap.put("resultCode", paramMap.get("resultCode"));
|
||||
resultMap.put("resultMsg", paramMap.get("resultMsg"));
|
||||
}
|
||||
|
||||
|
||||
resultMap.put("netCancleTorF", netCancleTorF.toString());
|
||||
|
||||
model.addAttribute("resultMap", resultMap);
|
||||
|
||||
resultMap = keyConvStyleClient(resultMap);
|
||||
|
||||
@ -213,5 +213,48 @@
|
||||
|
||||
</update>
|
||||
|
||||
<select id="payDAO.selectPayForPk" parameterClass="String" resultClass="PayVO">
|
||||
|
||||
SELECT a.pay_seq AS paySeq,
|
||||
a.asctn_table AS asctnTable,
|
||||
a.asctn_table_pk1 AS asctnTablePk1,
|
||||
a.asctn_table_pk2 AS asctnTablePk2,
|
||||
a.resultcode AS resultcode,
|
||||
a.resultmsg AS resultmsg,
|
||||
a.tid AS tid,
|
||||
a.moid AS moid,
|
||||
a.totprice AS totprice,
|
||||
a.goodname AS goodname,
|
||||
a.paymethod AS paymethod,
|
||||
a.appldate AS appldate,
|
||||
a.appltime AS appltime,
|
||||
a.eventcode AS eventcode,
|
||||
a.buyername AS buyername,
|
||||
a.buyertel AS buyertel,
|
||||
a.buyeremail AS buyeremail,
|
||||
a.custemail AS custemail,
|
||||
a.applnum AS applnum,
|
||||
a.card_num AS cardNum,
|
||||
a.card_interest AS cardInterest,
|
||||
a.card_quota AS cardQuota,
|
||||
a.card_code AS cardCode,
|
||||
a.card_corpflag AS cardCorpflag,
|
||||
a.card_checkflag AS cardCheckflag,
|
||||
a.card_prtccode AS cardPrtccode,
|
||||
a.card_bankcode AS cardBankcode,
|
||||
a.card_srccode AS cardSrccode,
|
||||
a.card_point AS cardPoint,
|
||||
a.card_usepoint AS cardUsepoint,
|
||||
a.currency AS currency,
|
||||
a.orgprice AS orgprice,
|
||||
a.frst_regist_pnttm AS frstRegistPnttm,
|
||||
a.frst_register_id AS frstRegisterId,
|
||||
a.last_updt_pnttm AS lastUpdtPnttm,
|
||||
a.last_updusr_id AS lastUpdusrId
|
||||
FROM adr_pay a
|
||||
WHERE a.asctn_table_pk1 = #asctnTablePk1#
|
||||
ORDER BY a.frst_regist_pnttm DESC LIMIT 1
|
||||
|
||||
</select>
|
||||
|
||||
</sqlMap>
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
<!-- 조정사건이력관리 테이블 -->
|
||||
<sqlMap namespace="AdrRecordReading">
|
||||
<typeAlias alias="egovMap" type="egovframework.rte.psl.dataaccess.util.EgovMap"/>
|
||||
<typeAlias alias="AdrRecordReadingVO" type="kcc.kccadr.advcRecord.service.AdrRecordReadingVO"/>
|
||||
|
||||
<typeAlias alias="AdrRecordReadingVO" type="kcc.kccadr.advcRecord.service.AdrRecordReadingVO"/>
|
||||
<typeAlias alias="PayVO" type="kcc.kccadr.adjst.service.PayVO"/>
|
||||
|
||||
<!-- 공통 테이블 명 -->
|
||||
<sql id="AdrRecordReadingDAO.table_name">
|
||||
@ -210,4 +210,15 @@
|
||||
LIMIT #recordCountPerPage# OFFSET #firstIndex#
|
||||
|
||||
</select>
|
||||
|
||||
<update id="adrRecordReadingDAO.updatePrcsnStatCd" parameterClass="PayVO">
|
||||
|
||||
UPDATE adr_record_reading
|
||||
SET prcsn_stat_cd = '20',
|
||||
prcsn_pnttm = NOW(),
|
||||
last_updt_pnttm = NOW(),
|
||||
last_updusr_id = #lastUpdusrId#
|
||||
WHERE record_reading_seq = #asctnTablePk1#
|
||||
|
||||
</update>
|
||||
</sqlMap>
|
||||
|
||||
@ -240,10 +240,11 @@
|
||||
<a href="#" onclick="fn_adjstReq_preview('<c:out value="${info.adrSeq}" />'); return false;">${list.adrDocTy}</a>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<%-- <a href="#">${list.adrDocTy}</a> --%>
|
||||
<a href="<c:url value='/cmm/fms/FileDown.do?atchFileId=${list.atchFileId}&&fileSn=${list.fileSn}'/>" title="첨부파일 다운로드" targe="_blank">
|
||||
<%-- <a href="<c:url value='/cmm/fms/FileDown.do?atchFileId=${list.atchFileId}&&fileSn=${list.fileSn}'/>" title="첨부파일 다운로드" targe="_blank">
|
||||
<c:out value="${list.adrDocTy}"></c:out>
|
||||
</a>
|
||||
</a> --%>
|
||||
<!-- pdf 뷰어로 일단 보여주기_이준호_221109 -->
|
||||
<a href="http://192.168.0.176:8085/streamdocs/view/sd;streamdocsId=oeVmgWE9e_IUJP_bTHVkhtjmWBCUBmNwkxGenGKMF4U"><c:out value="${list.adrDocTy}"/></a>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
|
||||
@ -33,7 +33,8 @@
|
||||
<!--운영 JS> <script language="javascript" type="text/javascript" src="https://stdpay.inicis.com/stdjs/INIStdPay.js" charset="UTF-8"></script> -->
|
||||
|
||||
<script type="text/javascript">
|
||||
function paybtn() {
|
||||
function paybtn(pk) {
|
||||
$('#merchantData').val($('#merchantData').val() + pk);
|
||||
INIStdPay.pay('SendPayForm_id');
|
||||
}
|
||||
</script>
|
||||
@ -100,21 +101,22 @@
|
||||
|
||||
<form name="" id="SendPayForm_id" method="post" class="mt-5">
|
||||
<input type="hidden" name="version" value="1.0">
|
||||
<input type="text" name="gopaymethod" value="Card">
|
||||
<input type="text" name="mid" value="<c:out value='${mid}'/>">
|
||||
<input type="text" name="oid" value="<c:out value='${orderNumber}'/>">
|
||||
<input type="text" name="price" value="<c:out value='${price}'/>">
|
||||
<input type="text" name="timestamp" value="<c:out value='${timestamp}'/>">
|
||||
<input type="hidden" name="gopaymethod" value="Card">
|
||||
<input type="hidden" name="mid" value="<c:out value='${mid}'/>">
|
||||
<input type="hidden" name="oid" value="<c:out value='${orderNumber}'/>">
|
||||
<input type="hidden" name="price" value="<c:out value='${price}'/>">
|
||||
<input type="hidden" name="timestamp" value="<c:out value='${timestamp}'/>">
|
||||
<input type="hidden" name="signature" value="<c:out value='${signature}'/>">
|
||||
<input type="hidden" name="mKey" value="<c:out value='${mKey}'/>">
|
||||
<input type="hidden" name="currency" value="WON">
|
||||
<input type="text" name="goodname" value="테스트상품">
|
||||
<input type="text" name="buyername" value="테스터">
|
||||
<input type="text" name="buyertel" value="01012345678">
|
||||
<input type="text" name="buyeremail" value="test@test.com">
|
||||
<input type="hidden" name="goodname" value="테스트상품">
|
||||
<input type="hidden" name="buyername" value="테스터">
|
||||
<input type="hidden" name="buyertel" value="01012345678">
|
||||
<input type="hidden" name="buyeremail" value="test@test.com">
|
||||
<input type="hidden" name="returnUrl" value="http://119.193.215.98:8087/web/kccadr/inipay/INIstdpayPcReturn.do">
|
||||
<input type="hidden" name="closeUrl" value="http://119.193.215.98:8087/web/kccadr/inipay/INIstdpayClose.do">
|
||||
<input type="text" name="acceptmethod" value="HPP(1):below1000:va_receipt:SKIN(#6666FF)">
|
||||
<input type="hidden" name="acceptmethod" value="HPP(1):below1000:va_receipt:SKIN(#6666FF)">
|
||||
<input type="hidden" name="merchantData" id="merchantData" value="${merchantData}"/>
|
||||
</form>
|
||||
|
||||
<form:form id="listForm" name="listForm" commandName="adrRecordReadingVO" onsubmit="return false;" method="post">
|
||||
@ -223,7 +225,7 @@
|
||||
<p>
|
||||
<c:choose>
|
||||
<c:when test="${list.prcsnStatCd eq '10'}">
|
||||
<button type="button" class="btnType10" onclick="paybtn()">수수료결제</button>
|
||||
<button type="button" class="btnType10" onclick="paybtn('<c:out value="${list.recordReadingSeq}" />')">수수료결제</button>
|
||||
<button type="button" class="btnType10" onclick="fncDeleteReq('<c:out value="${list.recordReadingSeq}" />');">삭제</button>
|
||||
</c:when>
|
||||
<c:when test="${list.prcsnStatCd eq '20'}">
|
||||
|
||||
@ -1,132 +1,5 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%-- <%@ page import="com.inicis.std.util.ParseUtil"%>
|
||||
<%@ page import="com.inicis.std.util.SignatureUtil"%>
|
||||
<%@ page import="com.inicis.std.util.HttpUtil"%>
|
||||
<%@ page import="java.util.*"%> --%>
|
||||
<%-- <%
|
||||
|
||||
Map<String, String> resultMap = new HashMap<String, String>();
|
||||
|
||||
try{
|
||||
|
||||
//#############################
|
||||
// 인증결과 파라미터 일괄 수신
|
||||
//#############################
|
||||
request.setCharacterEncoding("UTF-8");
|
||||
|
||||
Map<String,String> paramMap = new Hashtable<String,String>();
|
||||
|
||||
Enumeration elems = request.getParameterNames();
|
||||
|
||||
String temp = "";
|
||||
|
||||
while(elems.hasMoreElements())
|
||||
{
|
||||
temp = (String) elems.nextElement();
|
||||
paramMap.put(temp, request.getParameter(temp));
|
||||
}
|
||||
|
||||
System.out.println("paramMap : "+ paramMap.toString());
|
||||
|
||||
|
||||
if("0000".equals(paramMap.get("resultCode"))){
|
||||
|
||||
System.out.println("####인증성공/승인요청####");
|
||||
|
||||
//############################################
|
||||
// 1.전문 필드 값 설정(***가맹점 개발수정***)
|
||||
//############################################
|
||||
|
||||
String mid = paramMap.get("mid");
|
||||
String timestamp= SignatureUtil.getTimestamp();
|
||||
String charset = "UTF-8";
|
||||
String format = "JSON";
|
||||
String authToken= paramMap.get("authToken");
|
||||
String authUrl = paramMap.get("authUrl");
|
||||
String netCancel= paramMap.get("netCancelUrl");
|
||||
String merchantData = paramMap.get("merchantData");
|
||||
|
||||
//#####################
|
||||
// 2.signature 생성
|
||||
//#####################
|
||||
Map<String, String> signParam = new HashMap<String, String>();
|
||||
|
||||
signParam.put("authToken", authToken); // 필수
|
||||
signParam.put("timestamp", timestamp); // 필수
|
||||
|
||||
// signature 데이터 생성 (모듈에서 자동으로 signParam을 알파벳 순으로 정렬후 NVP 방식으로 나열해 hash)
|
||||
String signature = SignatureUtil.makeSignature(signParam);
|
||||
|
||||
|
||||
//#####################
|
||||
// 3.API 요청 전문 생성
|
||||
//#####################
|
||||
Map<String, String> authMap = new Hashtable<String, String>();
|
||||
|
||||
authMap.put("mid" ,mid); // 필수
|
||||
authMap.put("authToken" ,authToken); // 필수
|
||||
authMap.put("signature" ,signature); // 필수
|
||||
authMap.put("timestamp" ,timestamp); // 필수
|
||||
authMap.put("charset" ,charset); // default=UTF-8
|
||||
authMap.put("format" ,format); // default=XML
|
||||
|
||||
|
||||
HttpUtil httpUtil = new HttpUtil();
|
||||
|
||||
try{
|
||||
//#####################
|
||||
// 4.API 통신 시작
|
||||
//#####################
|
||||
|
||||
String authResultString = "";
|
||||
|
||||
authResultString = httpUtil.processHTTP(authMap, authUrl);
|
||||
|
||||
//############################################################
|
||||
//5.API 통신결과 처리(***가맹점 개발수정***)
|
||||
//############################################################
|
||||
|
||||
String test = authResultString.replace(",", "&").replace(":", "=").replace("\"", "").replace(" ","").replace("\n", "").replace("}", "").replace("{", "");
|
||||
|
||||
|
||||
resultMap = ParseUtil.parseStringToMap(test); //문자열을 MAP형식으로 파싱
|
||||
|
||||
|
||||
// 수신결과를 파싱후 resultCode가 "0000"이면 승인성공 이외 실패
|
||||
|
||||
//throw new Exception("강제 Exception");
|
||||
} catch (Exception ex) {
|
||||
|
||||
//####################################
|
||||
// 실패시 처리(***가맹점 개발수정***)
|
||||
//####################################
|
||||
|
||||
//---- db 저장 실패시 등 예외처리----//
|
||||
System.out.println(ex);
|
||||
|
||||
//#####################
|
||||
// 망취소 API
|
||||
//#####################
|
||||
String netcancelResultString = httpUtil.processHTTP(authMap, netCancel); // 망취소 요청 API url(고정, 임의 세팅 금지)
|
||||
|
||||
out.println("## 망취소 API 결과 ##");
|
||||
|
||||
// 취소 결과 확인
|
||||
out.println("<p>"+netcancelResultString.replaceAll("<", "<").replaceAll(">", ">")+"</p>");
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
resultMap.put("resultCode", paramMap.get("resultCode"));
|
||||
resultMap.put("resultMsg", paramMap.get("resultMsg"));
|
||||
}
|
||||
|
||||
}catch(Exception e){
|
||||
|
||||
System.out.println(e);
|
||||
}
|
||||
%> --%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |