Skip to content

Commit

Permalink
NHN_KCP 애플페이 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Mar 23, 2023
1 parent 10b3a9c commit bfdc48b
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 21 deletions.
5 changes: 3 additions & 2 deletions adm/shop_admin/configform.php
Expand Up @@ -781,10 +781,11 @@
<tr class="pg_info_fld kcp_info_fld">
<th scope="row"><label for="de_kcp_easy_pays">NHN KCP 간편결제</label></th>
<td>
<?php echo help("체크시 NHN KCP 간편결제들을 활성화 합니다.\nNHN_KCP > 네이버페이, 카카오페이는 테스트결제가 되지 않습니다."); ?>
<?php echo help("체크시 NHN KCP 간편결제들을 활성화 합니다.\nNHN_KCP > 네이버페이, 카카오페이는 테스트결제가 되지 않습니다.\n애플페이는 IOS 기기에 모바일결제만 가능합니다."); ?>
<input type="checkbox" id="de_easy_nhnkcp_payco" name="de_easy_pays[]" value="nhnkcp_payco" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_payco') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_payco" disabled>PAYCO (페이코)</label><br>
<input type="checkbox" id="de_easy_nhnkcp_naverpay" name="de_easy_pays[]" value="nhnkcp_naverpay" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_naverpay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_naverpay">NAVERPAY (네이버페이)</label><br>
<input type="checkbox" id="de_easy_nhnkcp_kakaopay" name="de_easy_pays[]" value="nhnkcp_kakaopay" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_kakaopay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_kakaopay">KAKAOPAY (카카오페이)</label>
<input type="checkbox" id="de_easy_nhnkcp_kakaopay" name="de_easy_pays[]" value="nhnkcp_kakaopay" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_kakaopay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_kakaopay">KAKAOPAY (카카오페이)</label><br>
<input type="checkbox" id="de_easy_nhnkcp_applepay" name="de_easy_pays[]" value="nhnkcp_applepay" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_applepay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_applepay">APPLEPAY (애플페이)</label>
</td>
</tr>
<tr class="pg_info_fld kcp_info_fld">
Expand Down
2 changes: 1 addition & 1 deletion adm/shop_admin/orderlist.php
Expand Up @@ -222,7 +222,7 @@
<input type="radio" name="od_settle_case" value="신용카드" id="od_settle_case06" <?php echo get_checked($od_settle_case, '신용카드'); ?>>
<label for="od_settle_case06">신용카드</label>
<input type="radio" name="od_settle_case" value="간편결제" id="od_settle_case07" <?php echo get_checked($od_settle_case, '간편결제'); ?>>
<label for="od_settle_case07" data-tooltip-text="NHN_KCP 간편결제 : PAYCO, 네이버페이, 카카오페이(NHN_KCP) &#xa;LG유플러스 간편결제 : PAYNOW &#xa;KG 이니시스 간편결제 : KPAY, 삼성페이, LPAY, 카카오페이(KG이니시스)">PG간편결제</label>
<label for="od_settle_case07" data-tooltip-text="NHN_KCP 간편결제 : PAYCO, 네이버페이, 카카오페이(NHN_KCP), 애플페이(NHN_KCP) &#xa;LG유플러스 간편결제 : PAYNOW &#xa;KG 이니시스 간편결제 : KPAY, 삼성페이, LPAY, 카카오페이(KG이니시스)">PG간편결제</label>
<input type="radio" name="od_settle_case" value="KAKAOPAY" id="od_settle_case08" <?php echo get_checked($od_settle_case, 'KAKAOPAY'); ?>>
<label for="od_settle_case08">KAKAOPAY</label>
</div>
Expand Down
1 change: 1 addition & 0 deletions css/default_shop.css
Expand Up @@ -1148,6 +1148,7 @@ box-shadow: 1px 2px 2px #eee;}
.sod_frm_mobile #m_sod_frm_paysel .inicis_lpay{background:url(../img/lpay_logo.png) no-repeat;width:35px;height:12px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%}
.sod_frm_mobile #m_sod_frm_paysel .inicis_kakaopay{background:url(../img/kakao.png) no-repeat 50% 50% #f4dc34;border-radius:30px;height:22px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .kakaopay_icon{background:url(../img/kakao.png) no-repeat 50% 50% #f4dc34;border-radius:30px;height:22px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .applepay_icon{background:url(../img/ico-mobile-applepay.png) no-repeat 50% 50% #fff;border-radius:30px;height:23px;width:50px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .samsung_pay{margin-left:-23px;background:url(../img/samsungpay.png) no-repeat 24px 3px;height:25px;width:106px;display:inline-block;overflow:hidden;text-indent:-999px}
.sod_frm_mobile #sod_frm_pay{border-top:1px solid #f3f3f3}
.sod_frm_mobile #sod_frm_pay h2{margin:10px 0;font-size:1.25em}
Expand Down
11 changes: 6 additions & 5 deletions css/mobile_shop.css
Expand Up @@ -220,14 +220,15 @@ box-shadow: 0 0 6px rgba(0,0,0,0.2);}
#m_sod_frm_paysel h3{background:#fff;padding:15px 10px ;border:1px solid #e3e5e8;border-bottom:0}
#m_sod_frm_paysel ul {margin:0 0 ;background:#fff;padding:10px;border:1px solid #e3e5e8}
#m_sod_frm_paysel ul:after {display:block;visibility:hidden;clear:both;content:""}
#m_sod_frm_paysel li {float:left;padding:5px ;width:46%;height:25px}
#m_sod_frm_paysel li {float:left;padding:5px;width:46%;height:35px}
#m_sod_frm_paysel .KPAY{background:url('../img/kpay.png') no-repeat;width:37px;height:15px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%}
#m_sod_frm_paysel .PAYNOW{background:url('../img/paynow.png') no-repeat;width:46px;height:15px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%;}
#m_sod_frm_paysel .PAYCO{background:url('../img/payco.png') no-repeat 1px;width:46px;height:15px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%;}
#m_sod_frm_paysel .PAYCO{background:url('../img/payco.png') no-repeat 1px;width:50px;height:15px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%}
#m_sod_frm_paysel .inicis_lpay{background:url('../img/lpay_logo.png') no-repeat;width:35px;height:12px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%;}
#m_sod_frm_paysel .inicis_kakaopay{background:url('../img/kakao.png') no-repeat 50% 50% #ffeb00;border-radius:30px;height:22px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
#m_sod_frm_paysel .kakaopay_icon{background:url('../img/ico-mobile-kakaopay.png') no-repeat #fff;height:15px;width:43px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
#m_sod_frm_paysel .naverpay_icon{background:url('../img/ico-mobile-naverpay.png') no-repeat #fff;height:15px;width:40px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
#m_sod_frm_paysel .inicis_kakaopay{background:url('../img/kakao.png') no-repeat 50% 50% #ffeb00;border-radius:30px;height:26px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:36px auto}
#m_sod_frm_paysel .kakaopay_icon{background:url('../img/ico-mobile-kakaopay.png') no-repeat #fff;height:23px;width:63px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:45px auto;background-position: 10% 40%}
#m_sod_frm_paysel .naverpay_icon{background:url('../img/ico-mobile-naverpay.png') no-repeat #fff;height:23px;width:60px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:45px auto;background-position: 0% 30%}
#m_sod_frm_paysel .applepay_icon{background:url('../img/ico-mobile-applepay.png') no-repeat #fff;height:30px;width:60px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:43px auto}
#m_sod_frm_paysel .samsung_pay{margin-left:-23px;background:url('../img/samsungpay.png') no-repeat 24px 3px;height:25px;width:106px;display:inline-block;overflow:hidden;text-indent:-999px}

#sod_frm_pay{padding:10px;;border-top:1px solid #f3f3f3}
Expand Down
2 changes: 1 addition & 1 deletion extend/version.extend.php
Expand Up @@ -4,5 +4,5 @@
// 자바스크립트와 CSS 파일을 새로 다운로드 하도록 파일의 끝에 년월일 지정
// 예) https://도메인/css/default.css?ver=220620
// 예) https://도메인/js/common.js?ver=220620
define('G5_CSS_VER', '220620');
define('G5_CSS_VER', '2303229');
define('G5_JS_VER', '2210172');
Binary file added img/ico-mobile-applepay.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions lib/shop.lib.php
Expand Up @@ -2769,6 +2769,8 @@ function check_pay_name_replace($payname, $od=array(), $is_client=0){
return '네이버페이_NHNKCP'.$add_str;
} else if( isset($od['od_other_pay_type']) && ($od['od_other_pay_type'] === 'OT13' || $od['od_other_pay_type'] === 'NHNKCP_KAKAOMONEY') ){
return '카카오페이_NHNKCP'.$add_str;
} else if( isset($od['od_other_pay_type']) && $od['od_other_pay_type'] === 'OT21' ){
return '애플페이_NHNKCP'.$add_str;
}

return 'PAYCO'.$add_str;
Expand Down
1 change: 1 addition & 0 deletions mobile/shop/kcp/easypay_form.1.php
Expand Up @@ -29,6 +29,7 @@
<input type="hidden" name="naverpay_point_direct" value="Y"> <!-- 네이버페이 포인트 결제를 하려면 naverpay_point_direct 를 Y -->
<?php } ?>
<input type="hidden" name="kakaopay_direct" value="A" > <!-- KAKAOPAY 결제창 호출 -->
<input type="hidden" name="applepay_direct" value="A" > <!-- APPLEPAY 결제창 호출 -->
<!-- 주문번호 -->
<input type="hidden" name="ordr_idxx" value="<?php echo $od_id; ?>">
<!-- 인증수단(영문 소문자) * 반드시 대소문자 구분 -->
Expand Down
24 changes: 17 additions & 7 deletions mobile/shop/kcp/order_approval_form.php
Expand Up @@ -67,6 +67,7 @@
$payco_direct = isset($_POST["payco_direct"]) ? $_POST["payco_direct"] : ''; // PAYCO 결제창 호출
$naverpay_direct = isset($_POST["naverpay_direct"]) ? $_POST["naverpay_direct"] : ''; // NAVERPAY 결제창 호출
$kakaopay_direct = isset($_POST["kakaopay_direct"]) ? $_POST["kakaopay_direct"] : ''; // KAKAOPAY 결제창 호출
$applepay_direct = isset($_POST["applepay_direct"]) ? $_POST["applepay_direct"] : ''; // APPLEPAY 결제창 호출

/*
* 기타 파라메터 추가 부분 - Start -
Expand Down Expand Up @@ -157,17 +158,24 @@ function call_pay_form()
{

var v_frm = document.sm_form;

layer_cont_obj = document.getElementById("content");
layer_receipt_obj = document.getElementById("layer_receipt");

layer_cont_obj.style.display = "none";
layer_receipt_obj.style.display = "block";

v_frm.target = "frm_receipt";

// IOS 환경의 경우 iframe에서 네이버페이와 애플페이의 cors 문제가 일어나므로 iframe으로 열지 않는다.
var isIOS = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);

if (isIOS) {
v_frm.target = "";
}

// 네이버페이면 반드시 페이지전환 방식이어야 하며, 그 외에는 iframe 방식으로 한다.
if(typeof v_frm.naverpay_direct !== "undefined" && v_frm.naverpay_direct.value == "Y") {
// 네이버페이 또는 애플페이의 경우 반드시 페이지전환 방식이어야 하며, 그 외에는 iframe 방식으로 한다.
if((typeof v_frm.naverpay_direct !== "undefined" && v_frm.naverpay_direct.value == "Y") || (typeof v_frm.applepay_direct !== "undefined" && v_frm.applepay_direct.value == "Y")) {
v_frm.target = "";
}

Expand Down Expand Up @@ -267,18 +275,20 @@ function chk_pay()
?>

<?php if($payco_direct){ ?>
<input type="hidden" name="payco_direct" value="<?php echo $payco_direct; ?>"> <!-- PAYCO 결제창 호출 -->
<input type="hidden" name="payco_direct" value="<?php echo get_text($payco_direct); ?>"> <!-- PAYCO 결제창 호출 -->
<?php } ?>
<?php if($naverpay_direct){ ?>
<input type="hidden" name="naverpay_direct" value="<?php echo $naverpay_direct; ?>"> <!-- 네이버페이 결제창 호출 -->
<input type="hidden" name="naverpay_direct" value="<?php echo get_text($naverpay_direct); ?>"> <!-- 네이버페이 결제창 호출 -->
<?php if(isset($default['de_easy_pay_services']) && in_array('used_nhnkcp_naverpay_point', explode(',', $default['de_easy_pay_services'])) ){ // 네이버페이 포인트 결제 옵션 ?>
<input type="hidden" name="naverpay_point_direct" value="Y"> <!-- 네이버페이 포인트 결제를 하려면 naverpay_point_direct 를 Y -->
<?php } ?>
<?php } ?>
<?php if($applepay_direct === "Y"){ ?>
<input type="hidden" name="applepay_direct" value="<?php echo get_text($applepay_direct); ?>"> <!-- 애플페이 결제창 호출 -->
<?php } ?>
<?php if($kakaopay_direct){ ?>
<input type="hidden" name="kakaopay_direct" value="<?php echo $kakaopay_direct; ?>"> <!-- 카카오페이 결제창 호출 -->
<input type="hidden" name="kakaopay_direct" value="<?php echo get_text($kakaopay_direct); ?>"> <!-- 카카오페이 결제창 호출 -->
<?php } ?>

<!-- 필수 사항 -->

<!-- 요청 구분 -->
Expand Down
1 change: 1 addition & 0 deletions mobile/shop/kcp/orderform.1.php
Expand Up @@ -24,6 +24,7 @@
<input type="hidden" name="payco_direct" value=""> <!-- PAYCO 결제창 호출 -->
<input type="hidden" name="naverpay_direct" value="A" > <!-- NAVERPAY 결제창 호출 -->
<input type="hidden" name="kakaopay_direct" value="A" > <!-- KAKAOPAY 결제창 호출 -->
<input type="hidden" name="applepay_direct" value="A" > <!-- APPLEPAY 결제창 호출 -->
<!-- 주문번호 -->
<input type="hidden" name="ordr_idxx" value="<?php echo $od_id; ?>">
<!-- 인증수단(영문 소문자) * 반드시 대소문자 구분 -->
Expand Down
10 changes: 10 additions & 0 deletions mobile/shop/orderform.sub.php
Expand Up @@ -624,6 +624,9 @@
if( in_array('nhnkcp_kakaopay', $de_easy_pay_service_array) ){
$easypay_prints['nhnkcp_kakaopay'] = '<li><input type="radio" id="od_settle_nhnkcp_kakaopay" name="od_settle_case" data-pay="kakaopay" value="간편결제" > <label for="od_settle_nhnkcp_kakaopay" class="kakaopay_icon nhnkcp_kakaopay lb_icon" title="NHN_KCP - 카카오페이">카카오페이</label></li>';
}
if( in_array('nhnkcp_applepay', $de_easy_pay_service_array) && preg_match('~^(?:(?:(?:Mozilla/\d\.\d\s*\()+|Mobile\s*Safari\s*\d+\.\d+(\.\d+)?\s*)(?:iPhone(?:\s+Simulator)?|iPad|iPod);\s*(?:U;\s*)?(?:[a-z]+(?:-[a-z]+)?;\s*)?CPU\s*(?:iPhone\s*)?(?:OS\s*\d+_\d+(?:_\d+)?\s*)?(?:like|comme)\s*Mac\s*O?S?\s*X(?:;\s*[a-z]+(?:-[a-z]+)?)?\)\s*)?(?:AppleWebKit/\d+(?:\.\d+(?:\.\d+)?|\s*\+)?\s*)?(?:\(KHTML,\s*(?:like|comme)\s*Gecko\s*\)\s*)?(?:Version/\d+\.\d+(?:\.\d+)?\s*)?(?:Mobile/\w+\s*)?(?:Safari/\d+\.\d+(?:\.\d+)?.*)?$~', $_SERVER['HTTP_USER_AGENT']) ){
$easypay_prints['nhnkcp_applepay'] = '<li><input type="radio" id="od_settle_nhnkcp_applepay" name="od_settle_case" data-pay="applepay" value="간편결제" > <label for="od_settle_nhnkcp_applepay" class="applepay_icon nhnkcp_applepay lb_icon" title="NHN_KCP - 애플페이">애플페이</label></li>';
}
} else {
$easypay_prints[strtolower($pg_easy_pay_name)] = '<li><input type="radio" id="od_settle_easy_pay" name="od_settle_case" value="간편결제" '.$checked.'> <label for="od_settle_easy_pay" class="'.$pg_easy_pay_name.' lb_icon">'.$pg_easy_pay_name.'</label></li>';
}
Expand Down Expand Up @@ -1300,6 +1303,7 @@ function pay_approval()
if(typeof f.payco_direct !== "undefined") f.payco_direct.value = "";
if(typeof f.naverpay_direct !== "undefined") f.naverpay_direct.value = "A";
if(typeof f.kakaopay_direct !== "undefined") f.kakaopay_direct.value = "A";
if(typeof f.applepay_direct !== "undefined") f.applepay_direct.value = "A";
if(typeof f.ActionResult !== "undefined") f.ActionResult.value = "";
if(typeof f.pay_method !== "undefined") f.pay_method.value = "";

Expand All @@ -1312,13 +1316,19 @@ function pay_approval()
}
} else if(nhnkcp_easy_pay === "kakaopay"){
if(typeof f.kakaopay_direct !== "undefined") f.kakaopay_direct.value = "Y";
} else if(nhnkcp_easy_pay === "applepay"){
if(typeof f.applepay_direct !== "undefined") f.applepay_direct.value = "Y";
} else {
if(typeof f.payco_direct !== "undefined") f.payco_direct.value = "Y";
}

if(typeof f.ActionResult !== "undefined") f.ActionResult.value = "CARD"; // 대소문자 구분
if(typeof f.pay_method !== "undefined") f.pay_method.value = "card"; // 대소문자 구분

//if(nhnkcp_easy_pay === "applepay"){
// if(typeof f.ActionResult !== "undefined") f.ActionResult.value = "card";
// if(typeof f.pay_method !== "undefined") f.pay_method.value = "CARD";
//}
}

<?php } else if($default['de_pg_service'] == 'lg') { ?>
Expand Down
1 change: 1 addition & 0 deletions theme/basic/css/default_shop.css
Expand Up @@ -1165,6 +1165,7 @@ a.btn_frmline.is-long-text{height:auto;width:160px}
.sod_frm_mobile #m_sod_frm_paysel .inicis_lpay{background:url(../../../img/lpay_logo.png) no-repeat;width:35px;height:12px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%}
.sod_frm_mobile #m_sod_frm_paysel .inicis_kakaopay{background:url(../../../img/kakao.png) no-repeat 50% 50% #f4dc34;border-radius:30px;height:22px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .kakaopay_icon{background:url(../../../img/kakao.png) no-repeat 50% 50% #f4dc34;border-radius:30px;height:22px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .applepay_icon{background:url(../../../img/ico-mobile-applepay.png) no-repeat 50% 50% #fff;border-radius:30px;height:23px;width:50px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .naverpay_icon{background:url(../../../img/ico-default-naverpay.png) no-repeat 50% 50% #fff;border-radius:30px;height:22px;width:50px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .samsung_pay{margin-left:-23px;background:url(../../../img/samsungpay.png) no-repeat 24px 3px;height:25px;width:106px;display:inline-block;overflow:hidden;text-indent:-999px}
.sod_frm_mobile #sod_frm_pay{border-top:1px solid #f3f3f3}
Expand Down

0 comments on commit bfdc48b

Please sign in to comment.