<%@ page contentType="text/html; charset=utf-8"%>
<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.security.MessageDigest" %>
<%@ page import="org.apache.commons.codec.binary.Hex" %>
<%
/*
*******************************************************
* <결제요청 파라미터>
* 결제시 Form 에 보내는 결제요청 파라미터입니다.
* 샘플페이지에서는 기본(필수) 파라미터만 예시되어 있으며,
* 추가 가능한 옵션 파라미터는 연동메뉴얼을 참고하세요.
*******************************************************
*/
String merchantKey = "EYzu8jGGMfqaDEp76gSckuvnaHHu+bC4opsSN6lHv3b2lurNYkVXrZ7Z1AoqQnXI3eLuaUFyoRNC6FkrzVjceg=="; // 상점키
String merchantID = "nicepay00m"; // 상점아이디
String goodsName = "나이스페이"; // 결제상품명
String price = "1004"; // 결제상품금액
String buyerName = "나이스"; // 구매자명
String buyerTel = "01000000000"; // 구매자연락처
String buyerEmail = "happy@day.co.kr"; // 구매자메일주소
String moid = "mnoid1234567890"; // 상품주문번호
String returnURL = "http://localhost:8080/nicepay3.0_utf-8/payResult_utf.jsp"; // 결과페이지(절대경로) - 모바일 결제창 전용
/*
*******************************************************
* <해쉬암호화> (수정하지 마세요)
* SHA-256 해쉬암호화는 거래 위변조를 막기위한 방법입니다.
*******************************************************
*/
DataEncrypt sha256Enc = new DataEncrypt();
String ediDate = getyyyyMMddHHmmss();
String signData = sha256Enc.encrypt(ediDate + merchantID + price + merchantKey);
%>
<!DOCTYPE html>
<html>
<head>
<title>NICEPAY PAY REQUEST(UTF-8)</title>
<meta charset="utf-8">
<style>
html,body {height: 100%;}
form {overflow: hidden;}
</style>
<!-- 아래 js는 PC 결제창 전용 js입니다.(모바일 결제창 사용시 필요 없음) -->
<script src="https://web.nicepay.co.kr/v3/webstd/js/nicepay-3.0.js" type="text/javascript"></script>
<script type="text/javascript">
//결제창 최초 요청시 실행됩니다.
function nicepayStart(){
if(checkPlatform(window.navigator.userAgent) == "mobile"){//모바일 결제창 진입
document.payForm.action = "https://web.nicepay.co.kr/v3/v3Payment.jsp";
document.payForm.acceptCharset="euc-kr";
document.payForm.submit();
}else{//PC 결제창 진입
goPay(document.payForm);
}
}
//[PC 결제창 전용]결제 최종 요청시 실행됩니다. <<'nicepaySubmit()' 이름 수정 불가능>>
function nicepaySubmit(){
document.payForm.submit();
}
//[PC 결제창 전용]결제창 종료 함수 <<'nicepayClose()' 이름 수정 불가능>>
function nicepayClose(){
alert("결제가 취소 되었습니다");
}
//pc, mobile 구분(가이드를 위한 샘플 함수입니다.)
function checkPlatform(ua) {
if(ua === undefined) {
ua = window.navigator.userAgent;
}
ua = ua.toLowerCase();
var platform = {};
var matched = {};
var userPlatform = "pc";
var platform_match = /(ipad)/.exec(ua) || /(ipod)/.exec(ua)
|| /(windows phone)/.exec(ua) || /(iphone)/.exec(ua)
|| /(kindle)/.exec(ua) || /(silk)/.exec(ua) || /(android)/.exec(ua)
|| /(win)/.exec(ua) || /(mac)/.exec(ua) || /(linux)/.exec(ua)
|| /(cros)/.exec(ua) || /(playbook)/.exec(ua)
|| /(bb)/.exec(ua) || /(blackberry)/.exec(ua)
|| [];
matched.platform = platform_match[0] || "";
if(matched.platform) {
platform[matched.platform] = true;
}
if(platform.android || platform.bb || platform.blackberry
|| platform.ipad || platform.iphone
|| platform.ipod || platform.kindle
|| platform.playbook || platform.silk
|| platform["windows phone"]) {
userPlatform = "mobile";
}
if(platform.cros || platform.mac || platform.linux || platform.win) {
userPlatform = "pc";
}
return userPlatform;
}
</script>
</head>
<body>
<form name="payForm" method="post" action="payResult_utf.jsp" accept-charset="euc-kr">
<table>
<tr>
<th><span>결제 수단</span></th>
<td><input type="text" name="PayMethod" value=""></td>
</tr>
<tr>
<th><span>결제 상품명</span></th>
<td><input type="text" name="GoodsName" value="<%=goodsName%>"></td>
</tr>
<tr>
<th><span>결제 상품금액</span></th>
<td><input type="text" name="Amt" value="<%=price%>"></td>
</tr>
<tr>
<th><span>상점 아이디</span></th>
<td><input type="text" name="MID" value="<%=merchantID%>"></td>
</tr>
<tr>
<th><span>상품 주문번호</span></th>
<td><input type="text" name="Moid" value="<%=moid%>"></td>
</tr>
<tr>
<th><span>구매자명</span></th>
<td><input type="text" name="BuyerName" value="<%=buyerName%>"></td>
</tr>
<tr>
<th>구매자명 이메일</th>
<td><input type="text" name="BuyerEmail" value="<%=buyerEmail%>"></td>
</tr>
<tr>
<th><span>구매자 연락처</span></th>
<td><input type="text" name="BuyerTel" value="<%=buyerTel%>"></td>
</tr>
<tr>
<th><span>인증완료 결과처리 URL<!-- (모바일 결제창 전용)PC 결제창 사용시 필요 없음 --></span></th>
<td><input type="text" name="ReturnURL" value="<%=returnURL%>"></td>
</tr>
<tr>
<th>가상계좌입금만료일(YYYYMMDD)</th>
<td><input type="text" name="VbankExpDate" value=""></td>
</tr>
<!-- 옵션 -->
<input type="hidden" name="GoodsCl" value="1"/> <!-- 상품구분(실물(1),컨텐츠(0)) -->
<input type="hidden" name="TransType" value="0"/> <!-- 일반(0)/에스크로(1) -->
<input type="hidden" name="CharSet" value="utf-8"/> <!-- 응답 파라미터 인코딩 방식 -->
<input type="hidden" name="ReqReserved" value=""/> <!-- 상점 예약필드 -->
<!-- 변경 불가능 -->
<input type="hidden" name="EdiDate" value="<%=ediDate%>"/> <!-- 전문 생성일시 -->
<input type="hidden" name="SignData" value="<%=signData%>"/> <!-- 해쉬값 -->
</table>
<a href="#" class="btn_blue" onClick="nicepayStart();">요 청</a>
</form>
</body>
</html>
<%!
public final synchronized String getyyyyMMddHHmmss(){
SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss");
return yyyyMMddHHmmss.format(new Date());
}
// SHA-256 형식으로 암호화
public class DataEncrypt{
MessageDigest md;
String strSRCData = "";
String strENCData = "";
String strOUTData = "";
public DataEncrypt(){ }
public String encrypt(String strData){
String passACL = null;
MessageDigest md = null;
try{
md = MessageDigest.getInstance("SHA-256");
md.reset();
md.update(strData.getBytes());
byte[] raw = md.digest();
passACL = encodeHex(raw);
}catch(Exception e){
System.out.print("암호화 에러" + e.toString());
}
return passACL;
}
public String encodeHex(byte [] b){
char [] c = Hex.encodeHex(b);
return new String(c);
}
}
%>
<?php
header("Content-Type:text/html; charset=utf-8;");
/*
*******************************************************
* <결제요청 파라미터>
* 결제시 Form 에 보내는 결제요청 파라미터입니다.
* 샘플페이지에서는 기본(필수) 파라미터만 예시되어 있으며,
* 추가 가능한 옵션 파라미터는 연동메뉴얼을 참고하세요.
*******************************************************
*/
$merchantKey = "EYzu8jGGMfqaDEp76gSckuvnaHHu+bC4opsSN6lHv3b2lurNYkVXrZ7Z1AoqQnXI3eLuaUFyoRNC6FkrzVjceg=="; // 상점키
$MID = "nicepay00m"; // 상점아이디
$goodsName = "나이스페이"; // 결제상품명
$price = "1004"; // 결제상품금액
$buyerName = "나이스"; // 구매자명
$buyerTel = "01000000000"; // 구매자연락처
$buyerEmail = "happy@day.co.kr"; // 구매자메일주소
$moid = "mnoid1234567890"; // 상품주문번호
$returnURL = "http://localhost:8080/payResult.php"; // 결과페이지(절대경로) - 모바일 결제창 전용
/*
*******************************************************
* <해쉬암호화> (수정하지 마세요)
* SHA-256 해쉬암호화는 거래 위변조를 막기위한 방법입니다.
*******************************************************
*/
$ediDate = date("YmdHis");
$signData = bin2hex(hash('sha256', $ediDate.$MID.$price.$merchantKey, true));
?>
<!DOCTYPE html>
<html>
<head>
<title>NICEPAY PAY REQUEST(EUC-KR)</title>
<meta charset="utf-8">
<style>
html,body {height: 100%;}
form {overflow: hidden;}
</style>
<!-- 아래 js는 PC 결제창 전용 js입니다.(모바일 결제창 사용시 필요 없음) -->
<script src="https://web.nicepay.co.kr/v3/webstd/js/nicepay-3.0.js" type="text/javascript"></script>
<script type="text/javascript">
//결제창 최초 요청시 실행됩니다.
function nicepayStart(){
if(checkPlatform(window.navigator.userAgent) == "mobile"){//모바일 결제창 진입
document.payForm.action = "https://web.nicepay.co.kr/v3/v3Payment.jsp";
document.payForm.acceptCharset="euc-kr";
document.payForm.submit();
}else{//PC 결제창 진입
goPay(document.payForm);
}
}
//[PC 결제창 전용]결제 최종 요청시 실행됩니다. <<'nicepaySubmit()' 이름 수정 불가능>>
function nicepaySubmit(){
document.payForm.submit();
}
//[PC 결제창 전용]결제창 종료 함수 <<'nicepayClose()' 이름 수정 불가능>>
function nicepayClose(){
alert("결제가 취소 되었습니다");
}
//pc, mobile 구분(가이드를 위한 샘플 함수입니다.)
function checkPlatform(ua) {
if(ua === undefined) {
ua = window.navigator.userAgent;
}
ua = ua.toLowerCase();
var platform = {};
var matched = {};
var userPlatform = "pc";
var platform_match = /(ipad)/.exec(ua) || /(ipod)/.exec(ua)
|| /(windows phone)/.exec(ua) || /(iphone)/.exec(ua)
|| /(kindle)/.exec(ua) || /(silk)/.exec(ua) || /(android)/.exec(ua)
|| /(win)/.exec(ua) || /(mac)/.exec(ua) || /(linux)/.exec(ua)
|| /(cros)/.exec(ua) || /(playbook)/.exec(ua)
|| /(bb)/.exec(ua) || /(blackberry)/.exec(ua)
|| [];
matched.platform = platform_match[0] || "";
if(matched.platform) {
platform[matched.platform] = true;
}
if(platform.android || platform.bb || platform.blackberry
|| platform.ipad || platform.iphone
|| platform.ipod || platform.kindle
|| platform.playbook || platform.silk
|| platform["windows phone"]) {
userPlatform = "mobile";
}
if(platform.cros || platform.mac || platform.linux || platform.win) {
userPlatform = "pc";
}
return userPlatform;
}
</script>
</head>
<body>
<form name="payForm" method="post" action="payResult_utf.php" accept-charset="euc-kr">
<table>
<tr>
<th>결제 수단</th>
<td><input type="text" name="PayMethod" value=""></td>
</tr>
<tr>
<th>결제 상품명</th>
<td><input type="text" name="GoodsName" value="<?php echo($goodsName)?>"></td>
</tr>
<tr>
<th>결제 상품금액</th>
<td><input type="text" name="Amt" value="<?php echo($price)?>"></td>
</tr>
<tr>
<th>상점 아이디</th>
<td><input type="text" name="MID" value="<?php echo($MID)?>"></td>
</tr>
<tr>
<th>상품 주문번호</th>
<td><input type="text" name="Moid" value="<?php echo($moid)?>"></td>
</tr>
<tr>
<th>구매자명</th>
<td><input type="text" name="BuyerName" value="<?php echo($buyerName)?>"></td>
</tr>
<tr>
<th>구매자명 이메일</th>
<td><input type="text" name="BuyerEmail" value="<?php echo($buyerEmail)?>"></td>
</tr>
<tr>
<th>구매자 연락처</th>
<td><input type="text" name="BuyerTel" value="<?php echo($buyerTel)?>"></td>
</tr>
<tr>
<th>인증완료 결과처리 URL<!-- (모바일 결제창 전용)PC 결제창 사용시 필요 없음 --></th>
<td><input type="text" name="ReturnURL" value="<?php echo($returnURL)?>"></td>
</tr>
<tr>
<th>가상계좌입금만료일(YYYYMMDD)</th>
<td><input type="text" name="VbankExpDate" value=""></td>
</tr>
<!-- 옵션 -->
<input type="hidden" name="GoodsCl" value="1"/> <!-- 상품구분(실물(1),컨텐츠(0)) -->
<input type="hidden" name="TransType" value="0"/> <!-- 일반(0)/에스크로(1) -->
<input type="hidden" name="CharSet" value="utf-8"/> <!-- 응답 파라미터 인코딩 방식 -->
<input type="hidden" name="ReqReserved" value=""/> <!-- 상점 예약필드 -->
<!-- 변경 불가능 -->
<input type="hidden" name="EdiDate" value="<?php echo($ediDate)?>"/> <!-- 전문 생성일시 -->
<input type="hidden" name="SignData" value="<?php echo($signData)?>"/> <!-- 해쉬값 -->
</table>
<a href="#" class="btn_blue" onClick="nicepayStart();">요 청</a>
</form>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" Src="payRequest.aspx.cs" Inherits="payRequest" %>
<!DOCTYPE html>
<html>
<head>
<title>NICEPAY PAY REQUEST(UTF-8)</title>
<meta charset="utf-8">
<!-- 아래 js는 PC 결제창 전용 js입니다.(모바일 결제창 사용시 필요 없음) -->
<script src="https://web.nicepay.co.kr/v3/webstd/js/nicepay-3.0.js" type="text/javascript"></script>
<script type="text/javascript">
//결제창 최초 요청시 실행됩니다.
function nicepayStart(){
document.getElementById("vExp").value = getTomorrow();
if(checkPlatform(window.navigator.userAgent) == "mobile"){//모바일 결제창 진입
document.payForm.action = "https://web.nicepay.co.kr/v3/v3Payment.jsp";
document.payForm.acceptCharset="euc-kr";
document.payForm.submit();
}else{//PC 결제창 진입
goPay(document.payForm);
}
}
//[PC 결제창 전용]결제 최종 요청시 실행됩니다. <<'nicepaySubmit()' 이름 수정 불가능>>
function nicepaySubmit(){
document.payForm.submit();
}
//[PC 결제창 전용]결제창 종료 함수 <<'nicepayClose()' 이름 수정 불가능>>
function nicepayClose(){
alert("결제가 취소 되었습니다");
}
//pc, mobile 구분(가이드를 위한 샘플 함수입니다.)
function checkPlatform(ua) {
if(ua === undefined) {
ua = window.navigator.userAgent;
}
ua = ua.toLowerCase();
var platform = {};
var matched = {};
var userPlatform = "pc";
var platform_match = /(ipad)/.exec(ua) || /(ipod)/.exec(ua)
|| /(windows phone)/.exec(ua) || /(iphone)/.exec(ua)
|| /(kindle)/.exec(ua) || /(silk)/.exec(ua) || /(android)/.exec(ua)
|| /(win)/.exec(ua) || /(mac)/.exec(ua) || /(linux)/.exec(ua)
|| /(cros)/.exec(ua) || /(playbook)/.exec(ua)
|| /(bb)/.exec(ua) || /(blackberry)/.exec(ua)
|| [];
matched.platform = platform_match[0] || "";
if(matched.platform) {
platform[matched.platform] = true;
}
if(platform.android || platform.bb || platform.blackberry
|| platform.ipad || platform.iphone
|| platform.ipod || platform.kindle
|| platform.playbook || platform.silk
|| platform["windows phone"]) {
userPlatform = "mobile";
}
if(platform.cros || platform.mac || platform.linux || platform.win) {
userPlatform = "pc";
}
return userPlatform;
}
//가상계좌입금만료일 설정 (today +1)
function getTomorrow(){
var today = new Date();
var yyyy = today.getFullYear().toString();
var mm = (today.getMonth()+1).toString();
var dd = (today.getDate()+1).toString();
if(mm.length < 2){mm = '0' + mm;}
if(dd.length < 2){dd = '0' + dd;}
return (yyyy + mm + dd);
}
</script>
<style>
html,body {height: 100%;}
form {overflow: hidden;}
</style>
</head>
<body>
<form name="payForm" method="post" action="payResult.aspx" accept-charset="euc-kr">
<table>
<tr>
<th><span>결제 수단</span></th>
<td><input type="text" name="PayMethod" value=""></td>
</tr>
<tr>
<th><span>결제 상품명</span></th>
<td><input type="text" name="GoodsName" value="<%=goodsName%>"></td>
</tr>
<tr>
<th><span>결제 상품금액</span></th>
<td><input type="text" name="Amt" value="<%=price%>"></td>
</tr>
<tr>
<th><span>상점 아이디</span></th>
<td><input type="text" name="MID" value="<%=merchantID%>"></td>
</tr>
<tr>
<th><span>상품 주문번호</span></th>
<td><input type="text" name="Moid" value="<%=moid%>"></td>
</tr>
<tr>
<th><span>구매자명</span></th>
<td><input type="text" name="BuyerName" value="<%=buyerName%>"></td>
</tr>
<tr>
<th><span>구매자 연락처</span></th>
<td><input type="text" name="BuyerTel" value="<%=buyerTel%>"></td>
</tr>
<tr>
<th><span>인증완료 결과처리 URL<!-- (모바일 결제창 전용)PC 결제창 사용시 필요 없음 --></span></th>
<td><input type="text" name="ReturnURL" value="<%=returnURL%>"></td>
</tr>
<!-- 옵션 -->
<input type="hidden" name="VbankExpDate" id="vExp"/> <!-- 가상계좌입금만료일 -->
<input type="hidden" name="BuyerEmail" value="<%=buyerEmail%>"/> <!-- 구매자 이메일 -->
<input type="hidden" name="GoodsCl" value="1"/> <!-- 상품구분(실물(1),컨텐츠(0)) -->
<input type="hidden" name="TransType" value="0"/> <!-- 일반(0)/에스크로(1) -->
<input type="hidden" name="CharSet" value="utf-8"/> <!-- 응답 파라미터 인코딩 방식 -->
<input type="hidden" name="ReqReserved" value=""/> <!-- 상점 예약필드 -->
<!-- 변경 불가능 -->
<input type="hidden" name="EdiDate" value="<%=ediDate%>"/> <!-- 전문 생성일시 -->
<input type="hidden" name="SignData" value="<%=signData%>"/> <!-- 해쉬값 -->
</table>
<a href="#" class="btn_blue" onClick="nicepayStart();">요 청</a>
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>NICEPAY PAY REQUEST(UTF-8)</title>
<meta charset="utf-8">
<style>
html,body {height: 100%;}
form {overflow: hidden;}
</style>
<!-- PC payment window only (not required for mobile payment window)-->
<script src="https://web.nicepay.co.kr/v3/webstd/js/nicepay-3.0.js" type="text/javascript"></script>
<script type="text/javascript">
//It is executed when call payment window.
function nicepayStart(){
if(checkPlatform(window.navigator.userAgent) == "mobile"){
document.payForm.action = "https://web.nicepay.co.kr/v3/v3Payment.jsp";
document.payForm.acceptCharset="euc-kr";
document.payForm.submit();
}else{
goPay(document.payForm);
}
}
//[PC Only]When pc payment window is closed, nicepay-3.0.js call back nicepaySubmit() function <<'nicepaySubmit()' DO NOT CHANGE>>
function nicepaySubmit(){
document.payForm.submit();
}
//[PC Only]payment window close function <<'nicepayClose()' DO NOT CHANGE>>
function nicepayClose(){
alert("결제가 취소 되었습니다");
}
//pc, mobile chack script (sample code)
function checkPlatform(ua) {
if(ua === undefined) {
ua = window.navigator.userAgent;
}
ua = ua.toLowerCase();
var platform = {};
var matched = {};
var userPlatform = "pc";
var platform_match = /(ipad)/.exec(ua) || /(ipod)/.exec(ua)
|| /(windows phone)/.exec(ua) || /(iphone)/.exec(ua)
|| /(kindle)/.exec(ua) || /(silk)/.exec(ua) || /(android)/.exec(ua)
|| /(win)/.exec(ua) || /(mac)/.exec(ua) || /(linux)/.exec(ua)
|| /(cros)/.exec(ua) || /(playbook)/.exec(ua)
|| /(bb)/.exec(ua) || /(blackberry)/.exec(ua)
|| [];
matched.platform = platform_match[0] || "";
if(matched.platform) {
platform[matched.platform] = true;
}
if(platform.android || platform.bb || platform.blackberry
|| platform.ipad || platform.iphone
|| platform.ipod || platform.kindle
|| platform.playbook || platform.silk
|| platform["windows phone"]) {
userPlatform = "mobile";
}
if(platform.cros || platform.mac || platform.linux || platform.win) {
userPlatform = "pc";
}
return userPlatform;
}
</script>
</head>
<body>
<form name="payForm" method="post" action="/authReq" accept-charset="euc-kr">
<table>
<tr>
<th>PayMethod</th>
<td><input type="text" name="PayMethod" value=""></td>
</tr>
<tr>
<th>GoodsName</th>
<td><input type="text" name="GoodsName" value="{{GoodsName}}"></td>
</tr>
<tr>
<th>Amt</th>
<td><input type="text" name="Amt" value="{{Amt}}"></td>
</tr>
<tr>
<th>MID</th>
<td><input type="text" name="MID" value="{{MID}}"></td>
</tr>
<tr>
<th>Moid</th>
<td><input type="text" name="Moid" value="{{Moid}}"></td>
</tr>
<tr>
<th>BuyerName</th>
<td><input type="text" name="BuyerName" value="{{BuyerName}}"></td>
</tr>
<tr>
<th>BuyerEmail</th>
<td><input type="text" name="BuyerEmail" value="{{BuyerEmail}}"></td>
</tr>
<tr>
<th>BuyerTel</th>
<td><input type="text" name="BuyerTel" value="{{BuyerTel}}"></td>
</tr>
<tr>
<th>ReturnURL [Mobile only]</th>
<td><input type="text" name="ReturnURL" value="{{ReturnURL}}"></td>
</tr>
<tr>
<th>Virtual Account Expiration Date(YYYYMMDD)</th>
<td><input type="text" name="VbankExpDate" value=""></td>
</tr>
<input type="hidden" name="NpLang" value="KO"/> <!-- EN:English, CN:Chinese, KO:Korean -->
<input type="hidden" name="GoodsCl" value="1"/> <!-- products(1), contents(0)) -->
<input type="hidden" name="TransType" value="0"/> <!-- USE escrow false(0)/true(1) -->
<input type="hidden" name="CharSet" value="utf-8"/> <!-- Return CharSet -->
<input type="hidden" name="ReqReserved" value=""/> <!-- mall custom field -->
<!-- DO NOT CHANGE -->
<input type="hidden" name="EdiDate" value="{{EdiDate}}"/> <!-- YYYYMMDDHHMISS -->
<input type="hidden" name="SignData" value="{{signData}}"/> <!-- signData -->
</table>
<a href="#" class="btn_blue" onClick="nicepayStart();">REQUEST</a>
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>NICEPAY PAY REQUEST(UTF-8)</title>
<meta charset="utf-8">
<style>
html,body {height: 100%;}
form {overflow: hidden;}
</style>
<!-- PC payment window only (not required for mobile payment window)-->
<script src="https://web.nicepay.co.kr/v3/webstd/js/nicepay-3.0.js" type="text/javascript"></script>
<script type="text/javascript">
//It is executed when call payment window.
function nicepayStart(){
if(checkPlatform(window.navigator.userAgent) == "mobile"){
document.payForm.action = "https://web.nicepay.co.kr/v3/v3Payment.jsp";
document.payForm.acceptCharset="euc-kr";
document.payForm.submit();
}else{
goPay(document.payForm);
}
}
//[PC Only]When pc payment window is closed, nicepay-3.0.js call back nicepaySubmit() function <<'nicepaySubmit()' DO NOT CHANGE>>
function nicepaySubmit(){
document.payForm.submit();
}
//[PC Only]payment window close function <<'nicepayClose()' DO NOT CHANGE>>
function nicepayClose(){
alert("결제가 취소 되었습니다");
}
//pc, mobile chack script (sample code)
function checkPlatform(ua) {
if(ua === undefined) {
ua = window.navigator.userAgent;
}
ua = ua.toLowerCase();
var platform = {};
var matched = {};
var userPlatform = "pc";
var platform_match = /(ipad)/.exec(ua) || /(ipod)/.exec(ua)
|| /(windows phone)/.exec(ua) || /(iphone)/.exec(ua)
|| /(kindle)/.exec(ua) || /(silk)/.exec(ua) || /(android)/.exec(ua)
|| /(win)/.exec(ua) || /(mac)/.exec(ua) || /(linux)/.exec(ua)
|| /(cros)/.exec(ua) || /(playbook)/.exec(ua)
|| /(bb)/.exec(ua) || /(blackberry)/.exec(ua)
|| [];
matched.platform = platform_match[0] || "";
if(matched.platform) {
platform[matched.platform] = true;
}
if(platform.android || platform.bb || platform.blackberry
|| platform.ipad || platform.iphone
|| platform.ipod || platform.kindle
|| platform.playbook || platform.silk
|| platform["windows phone"]) {
userPlatform = "mobile";
}
if(platform.cros || platform.mac || platform.linux || platform.win) {
userPlatform = "pc";
}
return userPlatform;
}
</script>
</head>
<body>
<form name="payForm" method="post" action="/authReq" accept-charset="euc-kr">
<table>
<tr>
<th>PayMethod</th>
<td><input type="text" name="PayMethod" value=""></td>
</tr>
<tr>
<th>GoodsName</th>
<td><input type="text" name="GoodsName" value="<%=goodsName%>"></td>
</tr>
<tr>
<th>Amt</th>
<td><input type="text" name="Amt" value="<%=amt%>"></td>
</tr>
<tr>
<th>MID</th>
<td><input type="text" name="MID" value="<%=merchantID%>"></td>
</tr>
<tr>
<th>Moid</th>
<td><input type="text" name="Moid" value="<%=moid%>"></td>
</tr>
<tr>
<th>BuyerName</th>
<td><input type="text" name="BuyerName" value="<%=buyerName%>"></td>
</tr>
<tr>
<th>BuyerEmail</th>
<td><input type="text" name="BuyerEmail" value="<%=buyerEmail%>"></td>
</tr>
<tr>
<th>BuyerTel</th>
<td><input type="text" name="BuyerTel" value="<%=buyerTel%>"></td>
</tr>
<tr>
<th>ReturnURL [Mobile only]</th>
<td><input type="text" name="ReturnURL" value="<%=returnURL%>"></td>
</tr>
<tr>
<th>Virtual Account Expiration Date(YYYYMMDD)</th>
<td><input type="text" name="VbankExpDate" value=""></td>
</tr>
<input type="hidden" name="NpLang" value="KO"/> <!-- EN:English, CN:Chinese, KO:Korean -->
<input type="hidden" name="GoodsCl" value="1"/> <!-- products(1), contents(0)) -->
<input type="hidden" name="TransType" value="0"/> <!-- USE escrow false(0)/true(1) -->
<input type="hidden" name="CharSet" value="utf-8"/> <!-- Return CharSet -->
<input type="hidden" name="ReqReserved" value=""/> <!-- mall custom field -->
<!-- DO NOT CHANGE -->
<input type="hidden" name="EdiDate" value="<%=ediDate%>"/> <!-- YYYYMMDDHHMISS -->
<input type="hidden" name="SignData" value="<%=signData%>"/> <!-- signData -->
</table>
<a href="#" class="btn_blue" onClick="nicepayStart();">REQUEST</a>
</form>
</body>
</html>