카카오페이 모바일 결제 추가
This commit is contained in:
@ -28,6 +28,7 @@ $s_cart_id = $tmp_cart_id;
|
||||
$order_action_url = G5_HTTPS_MSHOP_URL.'/orderformupdate.php';
|
||||
|
||||
require_once(G5_MSHOP_PATH.'/settle_'.$default['de_pg_service'].'.inc.php');
|
||||
require_once(G5_SHOP_PATH.'/settle_kakaopay.inc.php');
|
||||
|
||||
// 결제등록 요청시 사용할 입금마감일
|
||||
$ipgm_date = date("Ymd", (G5_SERVER_TIME + 86400 * 5));
|
||||
@ -268,6 +269,12 @@ require_once(G5_MSHOP_PATH.'/'.$default['de_pg_service'].'/orderform.1.php');
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if($is_kakaopay_use) {
|
||||
require_once(G5_SHOP_PATH.'/kakaopay/orderform.1.php');
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="sod_frm">
|
||||
<form name="forderform" method="post" action="<?php echo $order_action_url; ?>" autocomplete="off">
|
||||
<input type="hidden" name="od_price" value="<?php echo $tot_sell_price; ?>">
|
||||
@ -554,10 +561,17 @@ require_once(G5_MSHOP_PATH.'/'.$default['de_pg_service'].'/orderform.1.php');
|
||||
$escrow_title = "에스크로 ";
|
||||
}
|
||||
|
||||
if ($default['de_bank_use'] || $default['de_vbank_use'] || $default['de_iche_use'] || $default['de_card_use'] || $default['de_hp_use'] || $default['de_easy_pay_use']) {
|
||||
if ($is_kakaopay_use || $default['de_bank_use'] || $default['de_vbank_use'] || $default['de_iche_use'] || $default['de_card_use'] || $default['de_hp_use'] || $default['de_easy_pay_use']) {
|
||||
echo '<div id="sod_frm_paysel"><ul>';
|
||||
}
|
||||
|
||||
// 카카오페이
|
||||
if($is_kakaopay_use) {
|
||||
$multi_settle++;
|
||||
echo '<li><input type="radio" id="od_settle_kakaopay" name="od_settle_case" value="KAKAOPAY" '.$checked.'> <label for="od_settle_kakaopay">KAKAOPAY</label></li>'.PHP_EOL;
|
||||
$checked = '';
|
||||
}
|
||||
|
||||
// 무통장입금 사용
|
||||
if ($default['de_bank_use']) {
|
||||
$multi_settle++;
|
||||
@ -677,12 +691,22 @@ require_once(G5_MSHOP_PATH.'/'.$default['de_pg_service'].'/orderform.1.php');
|
||||
<?php
|
||||
// 결제대행사별 코드 include (결제대행사 정보 필드 및 주분버튼)
|
||||
require_once(G5_MSHOP_PATH.'/'.$default['de_pg_service'].'/orderform.2.php');
|
||||
|
||||
if($is_kakaopay_use) {
|
||||
require_once(G5_SHOP_PATH.'/kakaopay/orderform.2.php');
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="show_progress" style="display:none;">
|
||||
<img src="<?php echo G5_MOBILE_URL; ?>/shop/img/loading.gif" alt="">
|
||||
<span>주문완료 중입니다. 잠시만 기다려 주십시오.</span>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if($is_kakaopay_use) {
|
||||
require_once(G5_SHOP_PATH.'/kakaopay/orderform.3.php');
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
@ -935,7 +959,7 @@ $(function() {
|
||||
$("#show_pay_btn").css("display", "inline");
|
||||
});
|
||||
|
||||
$("#od_settle_iche,#od_settle_card,#od_settle_vbank,#od_settle_hp,#od_settle_easy_pay").bind("click", function() {
|
||||
$("#od_settle_iche,#od_settle_card,#od_settle_vbank,#od_settle_hp,#od_settle_easy_pay,#od_settle_kakaopay").bind("click", function() {
|
||||
$("#settle_bank").hide();
|
||||
$("#show_req_btn").css("display", "inline");
|
||||
$("#show_pay_btn").css("display", "none");
|
||||
@ -1174,6 +1198,12 @@ function pay_approval()
|
||||
f.good_mny.value = od_price + send_cost + send_cost2 - send_coupon - temp_point;
|
||||
}
|
||||
|
||||
// 카카오페이 지불
|
||||
if(settle_method == "KAKAOPAY") {
|
||||
getTxnId(pf);
|
||||
return false;
|
||||
}
|
||||
|
||||
<?php if($default['de_pg_service'] == 'kcp') { ?>
|
||||
f.buyr_name.value = pf.od_name.value;
|
||||
f.buyr_mail.value = pf.od_email.value;
|
||||
|
||||
@ -9,7 +9,7 @@ if(get_session('ss_direct'))
|
||||
$page_return_url .= '?sw_direct=1';
|
||||
|
||||
// 결제등록 완료 체크
|
||||
if($od_settle_case != '무통장') {
|
||||
if($od_settle_case != '무통장' && $od_settle_case != 'KAKAOPAY') {
|
||||
if($default['de_pg_service'] == 'kcp' && ($_POST['tran_cd'] == '' || $_POST['enc_info'] == '' || $_POST['enc_data'] == ''))
|
||||
alert('결제등록 요청 후 주문해 주십시오.', $page_return_url);
|
||||
|
||||
@ -418,22 +418,48 @@ else if ($od_settle_case == "간편결제")
|
||||
if($od_misu == 0)
|
||||
$od_status = '입금';
|
||||
}
|
||||
else if ($od_settle_case == "KAKAOPAY")
|
||||
{
|
||||
include G5_SHOP_PATH.'/kakaopay/kakaopay_result.php';
|
||||
|
||||
$od_tno = $tno;
|
||||
$od_app_no = $app_no;
|
||||
$od_receipt_price = $amount;
|
||||
$od_receipt_point = $i_temp_point;
|
||||
$od_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
|
||||
$od_bank_account = $card_name;
|
||||
$pg_price = $amount;
|
||||
$od_misu = $i_price - $od_receipt_price;
|
||||
if($od_misu == 0)
|
||||
$od_status = '입금';
|
||||
}
|
||||
else
|
||||
{
|
||||
die("od_settle_case Error!!!");
|
||||
}
|
||||
|
||||
$od_pg = $default['de_pg_service'];
|
||||
if($od_settle_case == 'KAKAOPAY')
|
||||
$od_pg = 'KAKAOPAY';
|
||||
|
||||
// 주문금액과 결제금액이 일치하는지 체크
|
||||
if($tno) {
|
||||
if((int)$order_price !== (int)$pg_price) {
|
||||
$cancel_msg = '결제금액 불일치';
|
||||
switch($default['de_pg_service']) {
|
||||
switch($od_pg) {
|
||||
case 'lg':
|
||||
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
|
||||
break;
|
||||
case 'inicis':
|
||||
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
|
||||
break;
|
||||
case 'KAKAOPAY':
|
||||
$_REQUEST['TID'] = $tno;
|
||||
$_REQUEST['Amt'] = $amount;
|
||||
$_REQUEST['CancelMsg'] = $cancel_msg;
|
||||
$_REQUEST['PartialCancelCode'] = 0;
|
||||
include G5_SHOP_PATH.'/kakaopay/kakaopay_cancel.php';
|
||||
break;
|
||||
default:
|
||||
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
|
||||
break;
|
||||
@ -465,7 +491,6 @@ if($default['de_tax_flag_use']) {
|
||||
$od_free_mny = (int)$_POST['comm_free_mny'];
|
||||
}
|
||||
|
||||
$od_pg = $default['de_pg_service'];
|
||||
$od_email = get_email_address($od_email);
|
||||
$od_name = clean_xss_tags($od_name);
|
||||
$od_tel = clean_xss_tags($od_tel);
|
||||
@ -547,13 +572,20 @@ $result = sql_query($sql, false);
|
||||
if(!$result) {
|
||||
if($tno) {
|
||||
$cancel_msg = '주문정보 입력 오류';
|
||||
switch($default['de_pg_service']) {
|
||||
switch($od_pg) {
|
||||
case 'lg':
|
||||
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
|
||||
break;
|
||||
case 'inicis':
|
||||
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
|
||||
break;
|
||||
case 'KAKAOPAY':
|
||||
$_REQUEST['TID'] = $tno;
|
||||
$_REQUEST['Amt'] = $amount;
|
||||
$_REQUEST['CancelMsg'] = $cancel_msg;
|
||||
$_REQUEST['PartialCancelCode'] = 0;
|
||||
include G5_SHOP_PATH.'/kakaopay/kakaopay_cancel.php';
|
||||
break;
|
||||
default:
|
||||
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
|
||||
break;
|
||||
@ -564,7 +596,7 @@ if(!$result) {
|
||||
$error = 'order';
|
||||
include G5_SHOP_PATH.'/ordererrormail.php';
|
||||
|
||||
die('<p>고객님의 주문 정보를 처리하는 중 오류가 발생해서 주문이 완료되지 않았습니다.</p><p>'.strtoupper($default['de_pg_service']).'를 이용한 전자결제(신용카드, 계좌이체, 가상계좌 등)은 자동 취소되었습니다.');
|
||||
die('<p>고객님의 주문 정보를 처리하는 중 오류가 발생해서 주문이 완료되지 않았습니다.</p><p>'.strtoupper($od_pg).'를 이용한 전자결제(신용카드, 계좌이체, 가상계좌 등)은 자동 취소되었습니다.');
|
||||
}
|
||||
|
||||
// 장바구니 상태변경
|
||||
@ -586,13 +618,20 @@ $result = sql_query($sql, false);
|
||||
if(!$result) {
|
||||
if($tno) {
|
||||
$cancel_msg = '주문상태 변경 오류';
|
||||
switch($default['de_pg_service']) {
|
||||
switch($od_pg) {
|
||||
case 'lg':
|
||||
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
|
||||
break;
|
||||
case 'inicis':
|
||||
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
|
||||
break;
|
||||
case 'KAKAOPAY':
|
||||
$_REQUEST['TID'] = $tno;
|
||||
$_REQUEST['Amt'] = $amount;
|
||||
$_REQUEST['CancelMsg'] = $cancel_msg;
|
||||
$_REQUEST['PartialCancelCode'] = 0;
|
||||
include G5_SHOP_PATH.'/kakaopay/kakaopay_cancel.php';
|
||||
break;
|
||||
default:
|
||||
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
|
||||
break;
|
||||
@ -606,7 +645,7 @@ if(!$result) {
|
||||
// 주문삭제
|
||||
sql_query(" delete from {$g5['g5_shop_order_table']} where od_id = '$od_id' ");
|
||||
|
||||
die('<p>고객님의 주문 정보를 처리하는 중 오류가 발생해서 주문이 완료되지 않았습니다.</p><p>'.strtoupper($default['de_pg_service']).'를 이용한 전자결제(신용카드, 계좌이체, 가상계좌 등)은 자동 취소되었습니다.');
|
||||
die('<p>고객님의 주문 정보를 처리하는 중 오류가 발생해서 주문이 완료되지 않았습니다.</p><p>'.strtoupper($od_pg).'를 이용한 전자결제(신용카드, 계좌이체, 가상계좌 등)은 자동 취소되었습니다.');
|
||||
}
|
||||
|
||||
// 회원이면서 포인트를 사용했다면 포인트 테이블에 사용을 추가
|
||||
|
||||
@ -240,7 +240,7 @@ if($od['od_pg'] == 'lg') {
|
||||
$disp_bank = true;
|
||||
$disp_receipt = false;
|
||||
$easy_pay_name = '';
|
||||
if($od['od_settle_case'] == '신용카드') {
|
||||
if($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == 'KAKAOPAY') {
|
||||
$app_no_subj = '승인번호';
|
||||
$app_no = $od['od_app_no'];
|
||||
$disp_bank = false;
|
||||
@ -379,6 +379,14 @@ if($od['od_pg'] == 'lg') {
|
||||
<a href="javascript:;" onclick="<?php echo $card_receipt_script; ?>">영수증 출력</a>
|
||||
<?php
|
||||
}
|
||||
|
||||
if($od['od_settle_case'] == 'KAKAOPAY')
|
||||
{
|
||||
$card_receipt_script = 'window.open(\'https://mms.cnspay.co.kr/trans/retrieveIssueLoader.do?TID='.$od['od_tno'].'&type=0\', \'popupIssue\', \'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=420,height=540\');';
|
||||
?>
|
||||
<a href="javascript:;" onclick="<?php echo $card_receipt_script; ?>">영수증 출력</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user