lg 모듈 현금영수증 작업 중
This commit is contained in:
239
shop/kcp/taxsave_form.php
Normal file
239
shop/kcp/taxsave_form.php
Normal file
@ -0,0 +1,239 @@
|
||||
<?php
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
?>
|
||||
|
||||
<!--
|
||||
/* ============================================================================== */
|
||||
/* = PAGE : 등록 요청 PAGE = */
|
||||
/* = -------------------------------------------------------------------------- = */
|
||||
/* = Copyright (c) 2007 KCP Inc. All Rights Reserverd. = */
|
||||
/* ============================================================================== */
|
||||
//-->
|
||||
|
||||
<script>
|
||||
// 현금영수증 MAIN FUNC
|
||||
function jsf__pay_cash( form )
|
||||
{
|
||||
jsf__show_progress(true);
|
||||
|
||||
if ( jsf__chk_cash( form ) == false )
|
||||
{
|
||||
jsf__show_progress(false);
|
||||
return;
|
||||
}
|
||||
|
||||
form.ordr_idxx.value = "<?php echo $od['od_id']; ?>";
|
||||
form.amt_tot.value = "<?php echo $amt_tot; ?>";
|
||||
form.amt_sup.value = "<?php echo $amt_sup; ?>";
|
||||
form.amt_svc.value = "<?php echo $amt_svc; ?>";
|
||||
form.amt_tax.value = "<?php echo $amt_tax; ?>";
|
||||
|
||||
form.submit();
|
||||
}
|
||||
|
||||
// 진행 바
|
||||
function jsf__show_progress( show )
|
||||
{
|
||||
if ( show == true )
|
||||
{
|
||||
window.show_pay_btn.style.display = "none";
|
||||
window.show_progress.style.display = "inline";
|
||||
}
|
||||
else
|
||||
{
|
||||
window.show_pay_btn.style.display = "inline";
|
||||
window.show_progress.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
// 포맷 체크
|
||||
function jsf__chk_cash( form )
|
||||
{
|
||||
if ( form.trad_time.value.length != 14 )
|
||||
{
|
||||
alert("원 거래 시각을 정확히 입력해 주시기 바랍니다.");
|
||||
form.trad_time.select();
|
||||
form.trad_time.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( form.corp_type.value == "1" )
|
||||
{
|
||||
if ( form.corp_tax_no.value.length != 10 )
|
||||
{
|
||||
alert("발행 사업자번호를 정확히 입력해 주시기 바랍니다.");
|
||||
form.corp_tax_no.select();
|
||||
form.corp_tax_no.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( form.tr_code[0].checked )
|
||||
{
|
||||
if ( form.id_info.value.length != 10 &&
|
||||
form.id_info.value.length != 11 &&
|
||||
form.id_info.value.length != 13 )
|
||||
{
|
||||
alert("주민번호 또는 휴대폰번호를 정확히 입력해 주시기 바랍니다.");
|
||||
form.id_info.select();
|
||||
form.id_info.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ( form.tr_code[1].checked )
|
||||
{
|
||||
if ( form.id_info.value.length != 10 )
|
||||
{
|
||||
alert("사업자번호를 정확히 입력해 주시기 바랍니다.");
|
||||
form.id_info.select();
|
||||
form.id_info.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function jsf__chk_tr_code( form )
|
||||
{
|
||||
var span_tr_code_0 = document.getElementById( "span_tr_code_0" );
|
||||
var span_tr_code_1 = document.getElementById( "span_tr_code_1" );
|
||||
|
||||
if ( form.tr_code[0].checked )
|
||||
{
|
||||
span_tr_code_0.style.display = "block";
|
||||
span_tr_code_1.style.display = "none";
|
||||
}
|
||||
else if (form.tr_code[1].checked )
|
||||
{
|
||||
span_tr_code_0.style.display = "none";
|
||||
span_tr_code_1.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="scash" class="new_win">
|
||||
<h1 id="win_title"><?php echo $g5['title']; ?></h1>
|
||||
|
||||
<section>
|
||||
<h2>주문정보</h2>
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_3">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">주문 번호</th>
|
||||
<td><?php echo $od['od_id']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">상품 정보</th>
|
||||
<td><?php echo $goods_name; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">주문자 이름</th>
|
||||
<td><?php echo $od['od_name']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">주문자 E-Mail</th>
|
||||
<td><?php echo $od['od_email']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">주문자 전화번호</th>
|
||||
<td><?php echo $od['od_tel']; ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>현금영수증 발급 정보</h2>
|
||||
|
||||
<form name="cash_form" action="<?php echo G5_SHOP_URL; ?>/kcp/pp_cli_hub.php" method="post">
|
||||
<input type="hidden" name="corp_type" value="0"> <!-- 사업자 구분 - 0:직접판매 , 1:입점몰판매 -->
|
||||
<input type="hidden" name="ordr_idxx">
|
||||
<input type="hidden" name="good_name" value="<?php echo addslashes($goods_name); ?>">
|
||||
<input type="hidden" name="buyr_name" value="<?php echo $od['od_name']; ?>">
|
||||
<input type="hidden" name="buyr_mail" value="<?php echo $od['od_email']; ?>">
|
||||
<input type="hidden" name="buyr_tel1" value="<?php echo $od['od_tel']; ?>">
|
||||
<input type="hidden" name="trad_time" value="<?php echo $trad_time; ?>">
|
||||
|
||||
<input type="hidden" name="amt_tot">
|
||||
<input type="hidden" name="amt_sup">
|
||||
<input type="hidden" name="amt_svc">
|
||||
<input type="hidden" name="amt_tax">
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_3">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">원 거래 시각</th>
|
||||
<td><?php echo $trad_time; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">발행 용도</th>
|
||||
<td>
|
||||
<input type="radio" name="tr_code" value="0" id="tr_code1" onClick="jsf__chk_tr_code( this.form )" checked>
|
||||
<label for="tr_code1">소득공제용</label>
|
||||
<input type="radio" name="tr_code" value="1" id="tr_code2" onClick="jsf__chk_tr_code( this.form )">
|
||||
<label for="tr_code2">지출증빙용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="id_info">
|
||||
<span id="span_tr_code_0" style="display:inline">주민(휴대폰)번호</span>
|
||||
<span id="span_tr_code_1" style="display:none">사업자번호</span>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="text" name="id_info" id="id_info" class="frm_input" size="16" maxlength="13"> ("-" 생략)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">거래금액 총합</th>
|
||||
<td><?php echo number_format($amt_tot); ?>원</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">공급가액</th>
|
||||
<td><?php echo number_format($amt_sup); ?>원<!-- ((거래금액 총합 * 10) / 11) --></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">봉사료</th>
|
||||
<td><?php echo number_format($amt_svc); ?>원</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">부가가치세</th>
|
||||
<td><?php echo number_format($amt_tax); ?>원<!-- 거래금액 총합 - 공급가액 - 봉사료 --></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="scash_apply">
|
||||
<span id="show_pay_btn">
|
||||
<button type="button" onclick="jsf__pay_cash( this.form )">등록요청</button>
|
||||
</span>
|
||||
<span id="show_progress" style="display:none">
|
||||
<b>등록 진행중입니다. 잠시만 기다려주십시오</b>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- 요청종류 승인(pay)/변경(mod) 요청시 사용 -->
|
||||
<input type="hidden" name="req_tx" value="pay">
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<p id="scash_copy">ⓒ Copyright 2007. KCP Inc. All Rights Reserved.</p>
|
||||
|
||||
</div>
|
||||
188
shop/lg/taxsave_form.php
Normal file
188
shop/lg/taxsave_form.php
Normal file
@ -0,0 +1,188 @@
|
||||
<?php
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
?>
|
||||
|
||||
<script>
|
||||
// 현금영수증 MAIN FUNC
|
||||
function jsf__pay_cash( form )
|
||||
{
|
||||
jsf__show_progress(true);
|
||||
|
||||
if ( jsf__chk_cash( form ) == false )
|
||||
{
|
||||
jsf__show_progress(false);
|
||||
return;
|
||||
}
|
||||
|
||||
form.submit();
|
||||
}
|
||||
|
||||
// 진행 바
|
||||
function jsf__show_progress( show )
|
||||
{
|
||||
if ( show == true )
|
||||
{
|
||||
window.show_pay_btn.style.display = "none";
|
||||
window.show_progress.style.display = "inline";
|
||||
}
|
||||
else
|
||||
{
|
||||
window.show_pay_btn.style.display = "inline";
|
||||
window.show_progress.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
// 포맷 체크
|
||||
function jsf__chk_cash( form )
|
||||
{
|
||||
if ( form.tr_code[0].checked )
|
||||
{
|
||||
if ( form.id_info.value.length != 10 &&
|
||||
form.id_info.value.length != 11 &&
|
||||
form.id_info.value.length != 13 )
|
||||
{
|
||||
alert("주민번호 또는 휴대폰번호를 정확히 입력해 주시기 바랍니다.");
|
||||
form.id_info.select();
|
||||
form.id_info.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ( form.tr_code[1].checked )
|
||||
{
|
||||
if ( form.id_info.value.length != 10 )
|
||||
{
|
||||
alert("사업자번호를 정확히 입력해 주시기 바랍니다.");
|
||||
form.id_info.select();
|
||||
form.id_info.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function jsf__chk_tr_code( form )
|
||||
{
|
||||
var span_tr_code_0 = document.getElementById( "span_tr_code_0" );
|
||||
var span_tr_code_1 = document.getElementById( "span_tr_code_1" );
|
||||
|
||||
if ( form.tr_code[0].checked )
|
||||
{
|
||||
span_tr_code_0.style.display = "block";
|
||||
span_tr_code_1.style.display = "none";
|
||||
}
|
||||
else if (form.tr_code[1].checked )
|
||||
{
|
||||
span_tr_code_0.style.display = "none";
|
||||
span_tr_code_1.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div id="scash" class="new_win">
|
||||
<h1 id="win_title"><?php echo $g5['title']; ?></h1>
|
||||
|
||||
<section>
|
||||
<h2>주문정보</h2>
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_3">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">주문 번호</th>
|
||||
<td><?php echo $od['od_id']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">상품 정보</th>
|
||||
<td><?php echo $goods_name; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">주문자 이름</th>
|
||||
<td><?php echo $od['od_name']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">주문자 E-Mail</th>
|
||||
<td><?php echo $od['od_email']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">주문자 전화번호</th>
|
||||
<td><?php echo $od['od_tel']; ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>현금영수증 발급 정보</h2>
|
||||
|
||||
<form method="post" id="LGD_PAYINFO" action="<?php echo G5_SHOP_URL; ?>/lg/taxsave_result.php">
|
||||
<input type="hidden" name="od_id" value="<?php echo $od_id; ?>">
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_3">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">원 거래 시각</th>
|
||||
<td><?php echo $trad_time; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">발행 용도</th>
|
||||
<td>
|
||||
<input type="radio" name="tr_code" value="1" id="tr_code1" onClick="jsf__chk_tr_code( this.form )" checked>
|
||||
<label for="tr_code1">소득공제용</label>
|
||||
<input type="radio" name="tr_code" value="2" id="tr_code2" onClick="jsf__chk_tr_code( this.form )">
|
||||
<label for="tr_code2">지출증빙용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="id_info">
|
||||
<span id="span_tr_code_0" style="display:inline">주민(휴대폰)번호</span>
|
||||
<span id="span_tr_code_1" style="display:none">사업자번호</span>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="text" name="id_info" id="id_info" class="frm_input" size="16" maxlength="13"> ("-" 생략)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">거래금액 총합</th>
|
||||
<td><?php echo number_format($amt_tot); ?>원</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">공급가액</th>
|
||||
<td><?php echo number_format($amt_sup); ?>원<!-- ((거래금액 총합 * 10) / 11) --></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">봉사료</th>
|
||||
<td><?php echo number_format($amt_svc); ?>원</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">부가가치세</th>
|
||||
<td><?php echo number_format($amt_tax); ?>원<!-- 거래금액 총합 - 공급가액 - 봉사료 --></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="scash_apply">
|
||||
<span id="show_pay_btn">
|
||||
<button type="button" onclick="jsf__pay_cash( this.form )">등록요청</button>
|
||||
</span>
|
||||
<span id="show_progress" style="display:none">
|
||||
<b>등록 진행중입니다. 잠시만 기다려주십시오</b>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
103
shop/lg/taxsave_result.php
Normal file
103
shop/lg/taxsave_result.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
require_once(G5_SHOP_PATH.'/settle_lg.inc.php');
|
||||
|
||||
$od = sql_fetch(" select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ");
|
||||
if (!$od)
|
||||
die('<p id="scash_empty">주문서가 존재하지 않습니다.</p>');
|
||||
|
||||
$goods = get_goods($od['od_id']);
|
||||
$goods_name = $goods['full_name'];
|
||||
$order_price = $od['od_receipt_price'] - $od['od_refund_price'];
|
||||
|
||||
switch($od['od_settle_case']) {
|
||||
case '가상계좌':
|
||||
$pay_type = 'SC0040';
|
||||
break;
|
||||
case '계좌이체':
|
||||
$pay_type = 'SC0030';
|
||||
break;
|
||||
case '무통장':
|
||||
$pay_type = 'SC0100';
|
||||
break;
|
||||
default:
|
||||
die('<p id="scash_empty">현금영수증은 무통장, 가상계좌, 계좌이체에 한해 발급요청이 가능합니다.</p>');
|
||||
break
|
||||
}
|
||||
|
||||
$LGD_METHOD = 'AUTH'; //메소드('AUTH':승인, 'CANCEL' 취소)
|
||||
$LGD_OID = $od['od_id']; //주문번호(상점정의 유니크한 주문번호를 입력하세요)
|
||||
$LGD_PAYTYPE = $pay_type; //결제수단 코드 (SC0030:계좌이체, SC0040:가상계좌, SC0100:무통장입금 단독)
|
||||
$LGD_AMOUNT = $order_price; //금액("," 를 제외한 금액을 입력하세요)
|
||||
$LGD_PRODUCTINFO = $goods_name; //상품명
|
||||
$LGD_TID = $od['od_tno']; //LG유플러스 거래번호
|
||||
$LGD_CUSTOM_MERTNAME = $default['de_admin_company_name']; //상점명
|
||||
$LGD_CUSTOM_BUSINESSNUM = $default['de_admin_company_saupja_no']; //사업자등록번호
|
||||
$LGD_CUSTOM_MERTPHONE = $default['de_admin_company_tel']; //상점 전화번호
|
||||
$LGD_CASHCARDNUM = $_POST['id_info']; //발급번호(주민등록번호,현금영수증카드번호,휴대폰번호 등등)
|
||||
$LGD_CASHRECEIPTUSE = $_POST['tr_code']; //현금영수증발급용도('1':소득공제, '2':지출증빙)
|
||||
|
||||
$xpay = new XPay($configPath, $CST_PLATFORM);
|
||||
|
||||
// Mert Key 설정
|
||||
$xpay->set_config_value('t'.$LGD_MID, $default['de_lg_mert_key']);
|
||||
$xpay->set_config_value($LGD_MID, $default['de_lg_mert_key']);
|
||||
|
||||
$xpay->Init_TX($LGD_MID);
|
||||
$xpay->Set("LGD_TXNAME", "CashReceipt");
|
||||
$xpay->Set("LGD_METHOD", $LGD_METHOD);
|
||||
$xpay->Set("LGD_PAYTYPE", $LGD_PAYTYPE);
|
||||
|
||||
if ($LGD_METHOD == "AUTH") { // 현금영수증 발급 요청
|
||||
$xpay->Set("LGD_OID", $LGD_OID);
|
||||
$xpay->Set("LGD_AMOUNT", $LGD_AMOUNT);
|
||||
$xpay->Set("LGD_CASHCARDNUM", $LGD_CASHCARDNUM);
|
||||
$xpay->Set("LGD_CUSTOM_MERTNAME", $LGD_CUSTOM_MERTNAME);
|
||||
$xpay->Set("LGD_CUSTOM_BUSINESSNUM", $LGD_CUSTOM_BUSINESSNUM);
|
||||
$xpay->Set("LGD_CUSTOM_MERTPHONE", $LGD_CUSTOM_MERTPHONE);
|
||||
$xpay->Set("LGD_CASHRECEIPTUSE", $LGD_CASHRECEIPTUSE);
|
||||
|
||||
if($od['od_tax_flag'] && $od['free_mny'] > ) {
|
||||
$xpay->Set("LGD_TAXFREEAMOUNT", $od['free_mny']); //비과세 금액
|
||||
}
|
||||
|
||||
if ($LGD_PAYTYPE == "SC0030"){ //기결제된 계좌이체건 현금영수증 발급요청시 필수
|
||||
$xpay->Set("LGD_TID", $LGD_TID);
|
||||
}
|
||||
else if ($LGD_PAYTYPE == "SC0040"){ //기결제된 가상계좌건 현금영수증 발급요청시 필수
|
||||
$xpay->Set("LGD_TID", $LGD_TID);
|
||||
$xpay->Set("LGD_SEQNO", $od['od_casseqno']);
|
||||
}
|
||||
else { //무통장입금 단독건 발급요청
|
||||
$xpay->Set("LGD_PRODUCTINFO", $LGD_PRODUCTINFO);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. 현금영수증 발급/취소 요청 결과처리
|
||||
*
|
||||
* 결과 리턴 파라미터는 연동메뉴얼을 참고하시기 바랍니다.
|
||||
*/
|
||||
if ($xpay->TX()) {
|
||||
//1)현금영수증 발급/취소결과 화면처리(성공,실패 결과 처리를 하시기 바랍니다.)
|
||||
echo "현금영수증 발급/취소 요청처리가 완료되었습니다. <br>";
|
||||
echo "TX Response_code = " . $xpay->Response_Code() . "<br>";
|
||||
echo "TX Response_msg = " . $xpay->Response_Msg() . "<p>";
|
||||
|
||||
echo "결과코드 : " . $xpay->Response("LGD_RESPCODE",0) . "<br>";
|
||||
echo "결과메세지 : " . $xpay->Response("LGD_RESPMSG",0) . "<br>";
|
||||
echo "거래번호 : " . $xpay->Response("LGD_TID",0) . "<p>";
|
||||
|
||||
$keys = $xpay->Response_Names();
|
||||
foreach($keys as $name) {
|
||||
echo $name . " = " . $xpay->Response($name, 0) . "<br>";
|
||||
}
|
||||
|
||||
}else {
|
||||
//2)API 요청 실패 화면처리
|
||||
echo "현금영수증 발급/취소 요청처리가 실패되었습니다. <br>";
|
||||
echo "TX Response_code = " . $xpay->Response_Code() . "<br>";
|
||||
echo "TX Response_msg = " . $xpay->Response_Msg() . "<p>";
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user