모바일 삼성페이를 다른 PG서비스와 함께 쓸수 있도록 처리

This commit is contained in:
thisgun
2016-12-12 13:33:44 +09:00
parent d855668afd
commit 6589e225a1
12 changed files with 376 additions and 153 deletions

View File

@ -0,0 +1,3 @@
<?php
include_once('../../common.php');
?>

View File

@ -0,0 +1,10 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
//삼성페이 사용시에만 해당함
if( ! $default['de_samsung_pay_use'] || ('inicis' == $default['de_pg_service']) ){ //PG가 이니시스인 경우 아래 내용 사용 안함
return;
}
include_once(G5_MSHOP_PATH.'/settle_inicis.inc.php');
?>

View File

@ -0,0 +1,72 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//삼성페이 사용시에만 해당함
if( ! $default['de_samsung_pay_use'] || ('inicis' == $default['de_pg_service']) ){ //PG가 이니시스인 경우 아래 내용 사용 안함
return;
}
?>
<script>
jQuery(function($){
$( document ).ready(function() {
var pf = document.forderform;
$(pf).on("form_sumbit_order_samsungpay", samsungpay_form_submit);
function samsungpay_form_submit(){
var $form = $(this),
pf = $form[0],
samsungpayform = document.samsungpay_form;
var paymethod = "";
var width = 330;
var height = 480;
var xpos = (screen.width - width) / 2;
var ypos = (screen.width - height) / 2;
var position = "top=" + ypos + ",left=" + xpos;
var features = position + ", width=320, height=440";
var p_reserved = samsungpayform.DEF_RESERVED.value;
samsungpayform.P_RESERVED.value = p_reserved;
paymethod = "wcard";
samsungpayform.P_RESERVED.value = samsungpayform.P_RESERVED.value.replace("&useescrow=Y", "")+"&d_samsungpay=Y";
samsungpayform.P_AMT.value = samsungpayform.good_mny.value;
samsungpayform.P_UNAME.value = pf.od_name.value;
samsungpayform.P_MOBILE.value = pf.od_hp.value;
samsungpayform.P_EMAIL.value = pf.od_email.value;
<?php if($default['de_tax_flag_use']) { ?>
samsungpayform.P_TAX.value = pf.comm_vat_mny.value;
samsungpayform.P_TAXFREE = pf.comm_free_mny.value;
<?php } ?>
samsungpayform.P_RETURN_URL.value = "<?php echo $return_url.$od_id; ?>";
samsungpayform.action = "https://mobile.inicis.com/smart/" + paymethod + "/";
// 주문 정보 임시저장
var order_data = $(pf).serialize();
var save_result = "";
$.ajax({
type: "POST",
data: order_data,
url: g5_url+"/shop/ajax.orderdatasave.php",
cache: false,
async: false,
success: function(data) {
save_result = data;
}
});
if(save_result) {
alert(save_result);
return;
}
samsungpayform.submit();
return false;
}
});
});
</script>

View File

@ -0,0 +1,34 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
//삼성페이 사용시에만 해당함
if( ! $default['de_samsung_pay_use'] || ('inicis' == $default['de_pg_service']) ){ //PG가 이니시스인 경우 아래 내용 사용 안함
return;
}
?>
<form name="samsungpay_form" id="samsungpay_form" method="POST" action="" accept-charset="euc-kr">
<input type="hidden" name="P_OID" value="<?php echo $od_id; ?>">
<input type="hidden" name="P_GOODS" value="<?php echo $goods; ?>">
<input type="hidden" name="P_AMT" value="<?php echo $tot_price; ?>">
<input type="hidden" name="P_UNAME" value="">
<input type="hidden" name="P_MOBILE" value="">
<input type="hidden" name="P_EMAIL" value="">
<input type="hidden" name="P_MID" value="<?php echo $default['de_inicis_mid']; ?>">
<input type="hidden" name="P_NEXT_URL" value="<?php echo $next_url; ?>">
<input type="hidden" name="P_NOTI_URL" value="<?php echo $noti_url; ?>">
<input type="hidden" name="P_RETURN_URL" value="">
<input type="hidden" name="P_HPP_METHOD" value="2">
<input type="hidden" name="P_RESERVED" value="bank_receipt=N&twotrs_isp=Y&block_isp=Y<?php echo $useescrow; ?>">
<input type="hidden" name="DEF_RESERVED" value="bank_receipt=N&twotrs_isp=Y&block_isp=Y<?php echo $useescrow; ?>">
<input type="hidden" name="P_NOTI" value="<?php echo $od_id; ?>">
<input type="hidden" name="P_QUOTABASE" value="01:02:03:04:05:06:07:08:09:10:11:12"> <!-- 할부기간 설정 01은 일시불 -->
<input type="hidden" name="P_SKIP_TERMS" value="Y">
<input type="hidden" name="good_mny" value="<?php echo $tot_price; ?>" >
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="P_TAX" value="">
<input type="hidden" name="P_TAXFREE" value="">
<?php } ?>
</form>

View File

@ -0,0 +1,22 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
//삼성페이 사용시에만 해당함
if( ! $default['de_samsung_pay_use'] || ('inicis' == $default['de_pg_service']) ){ //PG가 이니시스인 경우 아래 내용 사용 안함
return;
}
?>
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
<input type="hidden" name="res_cd" value=""> <!-- 결과 코드 -->
<input type="hidden" name="P_HASH" value="">
<input type="hidden" name="P_TYPE" value="">
<input type="hidden" name="P_UNAME" value="">
<input type="hidden" name="P_AUTH_DT" value="">
<input type="hidden" name="P_AUTH_NO" value="">
<input type="hidden" name="P_HPP_CORP" value="">
<input type="hidden" name="P_APPL_NUM" value="">
<input type="hidden" name="P_VACT_NUM" value="">
<input type="hidden" name="P_VACT_NAME" value="">
<input type="hidden" name="P_VACT_BANK" value="">
<input type="hidden" name="P_CARD_ISSUER" value="">

View File

@ -0,0 +1,3 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>