영카트 그누보드적용 중 네이버페이의 가맹점반품주소지 설정을 어떻게 해야할까요
답변 1개 / 댓글 1개
상품 교환/환불에 대해 진행할때 발생되어지는 반품상품 수령주소를 xml로 추가 기입하여 반영한후 보내달라는 요청내용입니다.
/shop/naverpay/naverpay_item.php 파일에 해당 반품관련 주소 정보를 기입 추가 반영해 주셔야 합니다.
<returnInfo> <!-- 상품별 반품 주소 -->
<zipcode>13591</zipcode><!-- 우편번호 -->
<address1>경기도 성남시 분당구 서현동</address1> <!-- 기본 주소. 동(읍/면/리)까지 입력 ->
<address2>266-1 분당퍼스트타워 13층</address2> <!-- 상세 주소. 번지 및 아파트 동호수까지 입력 -->
<sellername>NBP판매자</sellername> <!-- 수령인 이름 -->
<contact1>1566-3388</contact1> <!-- 연락처1 -->
<contact2></contact2> <!-- 연락처2. 이 값은 생략할 수 있다. -->
</returnInfo>
위 값이 반품 정보 추가할 xml 정보 입니다.
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.
<?php
include_once('./_common.php');
include_once(G5_LIB_PATH.'/naverpay.lib.php');
$query = $_SERVER['QUERY_STRING'];
$vars = array();
foreach(explode('&', $query) as $pair) {
list($key, $value) = explode('=', $pair);
$key = urldecode($key);
$value = preg_replace("/[^A-Za-z0-9\-_]/", "", urldecode($value));
$vars[$key][] = $value;
}
$itemIds = $vars['ITEM_ID'];
if (count($itemIds) < 1) {
exit('ITEM_ID 는 필수입니다.');
}
header('Content-Type: application/xml;charset=utf-8');
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<response>
<?php
foreach($itemIds as $it_id) {
$sql = " select * from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";
$it = sql_fetch($sql);
if(!$it['it_id'])
continue;
$id = $it['it_id'];
$name = $it['it_name'];
$description = $it['it_basic'];
$price = get_price($it);
$image = get_naverpay_item_image_url($it_id);
$quantity = get_naverpay_item_stock($it_id);
$ca_name = '';
$ca_name2 = '';
$ca_name3 = '';
$returnInfo = get_naverpay_return_info($it['it_seller']);
$option = get_naverpay_item_option($it_id, $it['it_option_subject']);
if($it['ca_id']) {
$cat = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '{$it['ca_id']}' ");
$ca_name = $cat['ca_name'];
}
if($it['ca_id2']) {
$cat = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '{$it['ca_id2']}' ");
$ca_name2 = $cat['ca_name'];
}
if($it['ca_id3']) {
$cat = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '{$it['ca_id3']}' ");
$ca_name3 = $cat['ca_name'];
}
?>
<item id="<?php echo $id; ?>">
<?php if($it['ec_mall_pid']) { ?>
<name><![CDATA[<?php echo $it['ec_mall_pid']; ?>]]></name>
<?php } ?>
<name><![CDATA[<?php echo $name; ?>]]></name>
<url><?php echo G5_SHOP_URL.'/item.php?it_id='.$it_id; ?></url>
<description><![CDATA[<?php echo $description; ?>]]></description>
<image><?php echo $image; ?></image>
<thumb><?php echo $image; ?></thumb>
<price><?php echo $price; ?></price>
<quantity><?php echo $quantity; ?></quantity>
<category>
<first id="MJ01"><![CDATA[<?php echo $ca_name; ?>]]></first>
<second id="ML01"><![CDATA[<?php echo $ca_name2; ?>]]></second>
<third id="MN01"><![CDATA[<?php echo $ca_name3; ?>]]></third>
</category>
<returnInfo> <!-- 상품별 반품 주소 -->
<zipcode>54620</zipcode><!-- 우편번호 -->
<address1>전라북도 익산시 인북로</address1> <!-- 기본 주소. 동(읍/면/리)까지 입력 ->
<address2>225-2, 4층</address2> <!-- 상세 주소. 번지 및 아파트 동호수까지 입력 -->
<sellername>유한회사 이티컴파니</sellername> <!-- 수령인 이름 -->
<contact1>063-917-5215</contact1> <!-- 연락처1 -->
</returnInfo>
<?php echo $option; ?>
<?php echo $returnInfo; ?>
</item>
<?php
}
echo('</response>');
?>