|
|
@@ -0,0 +1,121 @@
|
|
|
+<%------------------------------------------------------------------------------
|
|
|
+ FILE NAME : usafe_create.jsp(증권발급)
|
|
|
+ AUTHOR : dev@uclick.co.kr
|
|
|
+ DATE : 2006/03
|
|
|
+ http://www.usafe.co.kr
|
|
|
+ http://www.uclick.co.kr
|
|
|
+ Copyrightⓒ2006 Uclick All rights reserved.
|
|
|
+------------------------------------------------------------------------------%>
|
|
|
+
|
|
|
+<%@ page
|
|
|
+ language = "java"
|
|
|
+ contentType="text/html; charset=euc-kr"
|
|
|
+ import="java.util.*"
|
|
|
+ import="com.usafe.guarantee.InsuranceManager"
|
|
|
+ import="com.usafe.guarantee.InsuranceInfo"
|
|
|
+%>
|
|
|
+
|
|
|
+<%
|
|
|
+
|
|
|
+ String result = "";
|
|
|
+
|
|
|
+ InsuranceManager manager = new InsuranceManager("http://gateway.usafe.co.kr/esafe/guartrn.asp" , null ); // SERVICE
|
|
|
+// InsuranceManager manager = new InsuranceManager("https://gateway.usafe.co.kr/esafe/guartrn.asp" , null ); // 암호화 적용시
|
|
|
+
|
|
|
+ InsuranceInfo dInfo = new InsuranceInfo();
|
|
|
+
|
|
|
+ //////////////////////////////////////////////////////////////////////////////////////
|
|
|
+ // 테스트를 위해 코딩 start
|
|
|
+ String[] goodsNameArr = new String[3]; //상품명
|
|
|
+ String[] goodsPriceArr = new String[3]; //가격
|
|
|
+ String[] goodsQuantityArr = new String[3]; //상품수량
|
|
|
+
|
|
|
+ // goodsCount 수량에 맞춰 아래 필드 작성
|
|
|
+
|
|
|
+ goodsNameArr[0] = "goodsNameArr0";
|
|
|
+ goodsNameArr[1] = "goodsNameArr1";
|
|
|
+ goodsNameArr[2] = "goodsNameArr2";
|
|
|
+
|
|
|
+ goodsPriceArr[0] = "100";
|
|
|
+ goodsPriceArr[1] = "500";
|
|
|
+ goodsPriceArr[2] = "300";
|
|
|
+
|
|
|
+ goodsQuantityArr[0] = "1";
|
|
|
+ goodsQuantityArr[1] = "2";
|
|
|
+ goodsQuantityArr[2] = "3";
|
|
|
+
|
|
|
+ String gubun = "A0";
|
|
|
+ String mallId = "test00";
|
|
|
+ String oId = "20130404-0001";
|
|
|
+ String totalMoney = "2000";
|
|
|
+ String pId = "197501011"; // 생년월일(8) + 성별(1) : 남성1, 여성2
|
|
|
+ //----------- 주의!! 생년월일을 정수형으로 처리시 0이 삭제되어 1975111 처리 발송되면 오류 처리 됨. 반드시 자리수를 체크 요망-------------------
|
|
|
+
|
|
|
+ String payMethod = "MON";
|
|
|
+ String payInfo1 = "payInfo1";
|
|
|
+ String payInfo2 = "payInfo2";
|
|
|
+ String orderNm = "orderNm";
|
|
|
+ String orderHomeTel= "orderHomeTel";
|
|
|
+ String orderHpTel = "orderHpTel";
|
|
|
+ String orderZip = "123456";
|
|
|
+ String orderAddress= "서울시 중구 서소문동";
|
|
|
+ String orderEmail = "orderEmail";
|
|
|
+ String goodsCount = String.valueOf(goodsNameArr.length);
|
|
|
+ String acceptor = "acceptor";
|
|
|
+ String deliveryTel1 = "deliveryTel1";
|
|
|
+ String deliveryTel2 = "deliveryTel2";
|
|
|
+ String sign = "YYY";
|
|
|
+
|
|
|
+ // 테스트를 위해 코딩 end
|
|
|
+ ////////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+ dInfo.setGubun (gubun);
|
|
|
+ dInfo.setMallId (mallId);
|
|
|
+ dInfo.setOId (oId);
|
|
|
+ dInfo.setTotalMoney (totalMoney);
|
|
|
+ dInfo.setPId (pId);
|
|
|
+ dInfo.setPayMethod (payMethod);
|
|
|
+ dInfo.setPayInfo1 (payInfo1);
|
|
|
+ dInfo.setPayInfo2 (payInfo2);
|
|
|
+ dInfo.setOrderNm (orderNm);
|
|
|
+ dInfo.setOrderHomeTel (orderHomeTel);
|
|
|
+ dInfo.setOrderHpTel (orderHpTel);
|
|
|
+ dInfo.setOrderZip (orderZip);
|
|
|
+ dInfo.setOrderAddress(orderAddress);
|
|
|
+ dInfo.setOrderEmail (orderEmail);
|
|
|
+ dInfo.setGoodsCount (goodsCount);
|
|
|
+ dInfo.setAcceptor (acceptor);
|
|
|
+ dInfo.setDeliveryTel1 (deliveryTel1);
|
|
|
+ dInfo.setDeliveryTel2 (deliveryTel2);
|
|
|
+ dInfo.setGoodsNameArr (goodsNameArr);
|
|
|
+ dInfo.setGoodsPriceArr (goodsPriceArr);
|
|
|
+ dInfo.setGoodsQuantityArr(goodsQuantityArr);
|
|
|
+ dInfo.setSign(sign);
|
|
|
+
|
|
|
+ result = manager.contractInsurance(dInfo);
|
|
|
+
|
|
|
+ // result : 0|주문번호 , 성공시
|
|
|
+ // result : 1|Error Message , 실패시
|
|
|
+
|
|
|
+ String rtnResult[] = result.split("[\u007C]");
|
|
|
+
|
|
|
+ String result_code = rtnResult[0];
|
|
|
+ String result_msg = rtnResult[1];
|
|
|
+
|
|
|
+ out.println(result_code);
|
|
|
+ out.println("<br>");
|
|
|
+ out.println(result_msg);
|
|
|
+ out.println("<br>");
|
|
|
+
|
|
|
+ if (result_code.equals("0")){
|
|
|
+ out.println("성공");
|
|
|
+ // 성공로직 추가
|
|
|
+ }else if (result_code.equals("1")){
|
|
|
+ out.println("실패");
|
|
|
+ // 실패로직 추가
|
|
|
+ }else{
|
|
|
+ out.println("Exception Error");
|
|
|
+ // 예외 에러 처리
|
|
|
+ }
|
|
|
+
|
|
|
+%>
|