kcp 결제 모듈 변경 중

This commit is contained in:
chicpro
2013-03-25 18:51:55 +09:00
parent 56b54fa424
commit d1a355008a
10 changed files with 908 additions and 547 deletions

View File

@ -104,6 +104,18 @@ if(!sql_query(" select 1 from {$g4['uniqid_table']} limit 1 ", false)) {
) ", false);
}
// uq_id 필드추가
$sql = " select uq_id from {$g4['yc4_cart_table']} limit 1 ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" ALTER TABLE `{$g4['yc4_cart_table']}` ADD `uq_id` BIGINT(20) unsigned NOT NULL AFTER `ct_id` ", false);
sql_query(" ALTER TABLE `{$g4['yc4_order_table']}` ADD `uq_id` BIGINT(20) unsigned NOT NULL AFTER `od_id` ", false);
sql_query(" ALTER TABLE `{$g4['yc4_card_history_table']}` ADD `uq_id` BIGINT(20) unsigned NOT NULL AFTER `od_id` ", false);
sql_query(" ALTER TABLE `{$g4['yc4_order_table']}` MODIFY COLUMN od_id BIGINT(20) unsigned NOT NULL ", false);
sql_query(" ALTER TABLE `{$g4['yc4_cart_table']}` ADD INDEX uq_id (uq_id) ", false);
sql_query(" ALTER TABLE `{$g4['yc4_order_table']}` ADD UNIQUE uq_id (uq_id) ", false);
}
//==============================================================================
// 쇼핑몰 필수 실행코드 모음 끝
//==============================================================================

View File

@ -16,16 +16,6 @@ else {
}
}
// uq_id 필드추가
$sql = " select uq_id from {$g4['yc4_cart_table']} limit 1 ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" ALTER TABLE `{$g4['yc4_cart_table']}` ADD `uq_id` BIGINT(20) unsigned NOT NULL AFTER `ct_id` ", false);
sql_query(" ALTER TABLE `{$g4['yc4_order_table']}` ADD `uq_id` BIGINT(20) unsigned NOT NULL AFTER `od_id` ", false);
sql_query(" ALTER TABLE `{$g4['yc4_cart_table']}` ADD INDEX uq_id (uq_id) ", false);
sql_query(" ALTER TABLE `{$g4['yc4_order_table']}` ADD UNIQUE uq_id (uq_id) ", false);
}
// 브라우저에서 쿠키를 허용하지 않은 경우라고 볼 수 있음.
if (!$tmp_uq_id)
{

BIN
shop/kcp/bin/pp_cli Executable file

Binary file not shown.

View File

@ -15,13 +15,13 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
/* = 환경 설정 = */
/* = -------------------------------------------------------------------------- = */
$g_conf_home_dir = dirname($_SERVER['DOCUMENT_ROOT'] . $_SERVER['PHP_SELF']) . '/kcp/';
$g_conf_home_dir = G4_SHOP_PATH.'/kcp';
$g_conf_key_dir = '';
$g_conf_log_dir = '';
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
{
$g_conf_key_dir = dirname($_SERVER['DOCUMENT_ROOT'] . $_SERVER['PHP_SELF']) . '/kcp/bin/pub.key';
$g_conf_log_dir = dirname($_SERVER['DOCUMENT_ROOT'] . $_SERVER['PHP_SELF']) . '/kcp/log';
$g_conf_key_dir = G4_SHOP_PATH.'/kcp/bin/pub.key';
$g_conf_log_dir = G4_SHOP_PATH.'/kcp/log';
}
$g_conf_site_cd = $_POST['site_cd'];
@ -134,280 +134,232 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
/* ============================================================================== */
/* ============================================================================== */
/* = 02. 인스턴스 생성 및 초기화 = */
/* = -------------------------------------------------------------------------- = */
/* = 결제에 필요한 인스턴스를 생성하고 초기화 합니다. = */
/* = -------------------------------------------------------------------------- = */
$c_PayPlus = new C_PP_CLI;
/* ============================================================================== */
/* = 02. 인스턴스 생성 및 초기화 = */
/* = -------------------------------------------------------------------------- = */
/* = 결제에 필요한 인스턴스를 생성하고 초기화 합니다. = */
/* = -------------------------------------------------------------------------- = */
$c_PayPlus = new C_PP_CLI;
$c_PayPlus->mf_clear();
/* ------------------------------------------------------------------------------ */
/* = 02. 인스턴스 생성 및 초기화 END = */
/* ============================================================================== */
$c_PayPlus->mf_clear();
/* ------------------------------------------------------------------------------ */
/* = 02. 인스턴스 생성 및 초기화 END = */
/* ============================================================================== */
/* ============================================================================== */
/* = 03. 처리 요청 정보 설정 = */
/* = -------------------------------------------------------------------------- = */
/* ============================================================================== */
/* = 03. 처리 요청 정보 설정 = */
/* = -------------------------------------------------------------------------- = */
/* = -------------------------------------------------------------------------- = */
/* = 03-1. 승인 요청 = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
/* = -------------------------------------------------------------------------- = */
/* = 03-1. 승인 요청 = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
{
/* 1004원은 실제로 업체에서 결제하셔야 될 원 금액을 넣어주셔야 합니다. 결제금액 유효성 검증 */
$c_PayPlus->mf_set_ordr_data( "ordr_mony", $good_mny );
$c_PayPlus->mf_set_encx_data( $_POST[ "enc_data" ], $_POST[ "enc_info" ] );
}
/* = -------------------------------------------------------------------------- = */
/* = 03-2. 취소/매입 요청 = */
/* = -------------------------------------------------------------------------- = */
else if ( $req_tx == "mod" )
{
$tran_cd = "00200000";
$c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호
$c_PayPlus->mf_set_modx_data( "mod_type", $mod_type ); // 원거래 변경 요청 종류
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip ); // 변경 요청자 IP
$c_PayPlus->mf_set_modx_data( "mod_desc", $mod_desc ); // 변경 사유
}
/* = -------------------------------------------------------------------------- = */
/* = 03-3. 에스크로 상태변경 요청 = */
/* = -------------------------------------------------------------------------- = */
else if ($req_tx = "mod_escrow")
{
$tran_cd = "00200000";
$c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호
$c_PayPlus->mf_set_modx_data( "mod_type", $mod_type ); // 원거래 변경 요청 종류
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip ); // 변경 요청자 IP
$c_PayPlus->mf_set_modx_data( "mod_desc", $mod_desc ); // 변경 사유
if ($mod_type == "STE1") // 상태변경 타입이 [배송요청]인 경우
{
/* 1004원은 실제로 업체에서 결제하셔야 될 원 금액을 넣어주셔야 합니다. 결제금액 유효성 검증 */
$c_PayPlus->mf_set_ordr_data( "ordr_mony", $good_mny );
$c_PayPlus->mf_set_encx_data( $_POST[ "enc_data" ], $_POST[ "enc_info" ] );
$c_PayPlus->mf_set_modx_data( "deli_numb", $_POST[ "deli_numb" ] ); // 운송장 번호
$c_PayPlus->mf_set_modx_data( "deli_corp", $_POST[ "deli_corp" ] ); // 택배 업체명
}
/* = -------------------------------------------------------------------------- = */
/* = 03-2. 취소/매입 요청 = */
/* = -------------------------------------------------------------------------- = */
else if ( $req_tx == "mod" )
else if ($mod_type == "STE2" || $mod_type == "STE4") // 상태변경 타입이 [즉시취소] 또는 [취소]인 계좌이체, 가상계좌의 경우
{
$tran_cd = "00200000";
$c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호
$c_PayPlus->mf_set_modx_data( "mod_type", $mod_type ); // 원거래 변경 요청 종류
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip ); // 변경 요청자 IP
$c_PayPlus->mf_set_modx_data( "mod_desc", $mod_desc ); // 변경 사유
}
/* = -------------------------------------------------------------------------- = */
/* = 03-3. 에스크로 상태변경 요청 = */
/* = -------------------------------------------------------------------------- = */
else if ($req_tx = "mod_escrow")
{
$tran_cd = "00200000";
$c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호
$c_PayPlus->mf_set_modx_data( "mod_type", $mod_type ); // 원거래 변경 요청 종류
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip ); // 변경 요청자 IP
$c_PayPlus->mf_set_modx_data( "mod_desc", $mod_desc ); // 변경 사유
if ($mod_type == "STE1") // 상태변경 타입이 [배송요청]인 경우
if ($vcnt_yn == "Y")
{
$c_PayPlus->mf_set_modx_data( "deli_numb", $_POST[ "deli_numb" ] ); // 운송장 번호
$c_PayPlus->mf_set_modx_data( "deli_corp", $_POST[ "deli_corp" ] ); // 택배 업체
}
else if ($mod_type == "STE2" || $mod_type == "STE4") // 상태변경 타입이 [즉시취소] 또는 [취소]인 계좌이체, 가상계좌의 경우
{
if ($vcnt_yn == "Y")
{
$c_PayPlus->mf_set_modx_data( "refund_account", $_POST[ "refund_account" ] ); // 환불수취계좌번호
$c_PayPlus->mf_set_modx_data( "refund_nm", $_POST[ "refund_nm" ] ); // 환불수취계좌주명
$c_PayPlus->mf_set_modx_data( "bank_code", $_POST[ "bank_code" ] ); // 환불수취은행코드
}
$c_PayPlus->mf_set_modx_data( "refund_account", $_POST[ "refund_account" ] ); // 환불수취계좌번호
$c_PayPlus->mf_set_modx_data( "refund_nm", $_POST[ "refund_nm" ] ); // 환불수취계좌주
$c_PayPlus->mf_set_modx_data( "bank_code", $_POST[ "bank_code" ] ); // 환불수취은행코드
}
}
/* = -------------------------------------------------------------------------- = */
/* = 03-3. 에스크로 상태변경 요청 END = */
/* = -------------------------------------------------------------------------- = */
}
/* = -------------------------------------------------------------------------- = */
/* = 03-3. 에스크로 상태변경 요청 END = */
/* = -------------------------------------------------------------------------- = */
/* ------------------------------------------------------------------------------ */
/* = 03. 처리 요청 정보 설정 END = */
/* ============================================================================== */
/* ------------------------------------------------------------------------------ */
/* = 03. 처리 요청 정보 설정 END = */
/* ============================================================================== */
/* ============================================================================== */
/* = 04. 실행 = */
/* = -------------------------------------------------------------------------- = */
if ( $tran_cd != "" )
/* ============================================================================== */
/* = 04. 실행 = */
/* = -------------------------------------------------------------------------- = */
if ( $tran_cd != "" )
{
$c_PayPlus->mf_do_tx( $trace_no, $g_conf_home_dir, $g_conf_site_cd, "", $tran_cd, "",
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib", $ordr_idxx,
$cust_ip, "3" , 0, 0, $g_conf_key_dir, $g_conf_log_dir); // 응답 전문 처리
$res_cd = $c_PayPlus->m_res_cd; // 결과 코드
$res_msg = $c_PayPlus->m_res_msg; // 결과 메시지
/* $res_en_msg = $c_PayPlus->mf_get_res_data( "res_en_msg" ); // 결과 영문 메세지 */
}
else
{
$c_PayPlus->m_res_cd = "9562";
$c_PayPlus->m_res_msg = "연동 오류|Payplus Plugin이 설치되지 않았거나 tran_cd값이 설정되지 않았습니다.";
}
if ($res_cd != '0000')
{
$res_msg = iconv("euc-kr", "utf-8", $res_msg);
echo "<script>
var openwin = window.open( './kcp/proc_win.php', 'proc_win', '' );
openwin.close();
</script>";
alert("$res_cd : $res_msg");
exit;
}
/* = -------------------------------------------------------------------------- = */
/* = 04. 실행 END = */
/* ============================================================================== */
/* ============================================================================== */
/* = 05. 승인 결과 값 추출 = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
{
if( $res_cd == "0000" )
{
$c_PayPlus->mf_do_tx( $trace_no, $g_conf_home_dir, $g_conf_site_cd, "", $tran_cd, "",
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib", $ordr_idxx,
$cust_ip, "3" , 0, 0, $g_conf_key_dir, $g_conf_log_dir); // 응답 전문 처리
$tno = $c_PayPlus->mf_get_res_data( "tno" ); // KCP 거래 고유 번호
$amount = $c_PayPlus->mf_get_res_data( "amount" ); // KCP 실제 거래 금액
$pnt_issue = $c_PayPlus->mf_get_res_data( "pnt_issue" ); // 결제 포인트사 코드
$res_cd = $c_PayPlus->m_res_cd; // 결과 코드
$res_msg = $c_PayPlus->m_res_msg; // 결과 메시지
/* $res_en_msg = $c_PayPlus->mf_get_res_data( "res_en_msg" ); // 결과 영문 메세지 */
}
else
{
$c_PayPlus->m_res_cd = "9562";
$c_PayPlus->m_res_msg = "연동 오류|Payplus Plugin이 설치되지 않았거나 tran_cd값이 설정되지 않았습니다.";
}
if ($res_cd != '0000')
{
$res_msg = iconv("euc-kr", "utf-8", $res_msg);
echo "<script>
var openwin = window.open( './kcp/proc_win.php', 'proc_win', '' );
openwin.close();
</script>";
alert("$res_cd : $res_msg");
exit;
}
/* = -------------------------------------------------------------------------- = */
/* = 04. 실행 END = */
/* ============================================================================== */
/* ============================================================================== */
/* = 05. 승인 결과 값 추출 = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
{
if( $res_cd == "0000" )
/* = -------------------------------------------------------------------------- = */
/* = 05-1. 신용카드 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "100000000000" )
{
$tno = $c_PayPlus->mf_get_res_data( "tno" ); // KCP 거래 고유 번호
$amount = $c_PayPlus->mf_get_res_data( "amount" ); // KCP 실제 거래 금액
$pnt_issue = $c_PayPlus->mf_get_res_data( "pnt_issue" ); // 결제 포인트사 코드
$card_cd = $c_PayPlus->mf_get_res_data( "card_cd" ); // 카드사 코드
$card_name = $c_PayPlus->mf_get_res_data( "card_name" ); // 카드 종류
$app_time = $c_PayPlus->mf_get_res_data( "app_time" ); // 승인 시간
$app_no = $c_PayPlus->mf_get_res_data( "app_no" ); // 승인 번호
$noinf = $c_PayPlus->mf_get_res_data( "noinf" ); // 무이자 여부 ( 'Y' : 무이자 )
$quota = $c_PayPlus->mf_get_res_data( "quota" ); // 할부 개월 수
$partcanc_yn = $c_PayPlus->mf_get_res_data( "partcanc_yn" ); // 부분취소 가능유무
$card_bin_type_01 = $c_PayPlus->mf_get_res_data( "card_bin_type_01" ); // 카드구분1
$card_bin_type_02 = $c_PayPlus->mf_get_res_data( "card_bin_type_02" ); // 카드구분2
/* = -------------------------------------------------------------------------- = */
/* = 05-1. 신용카드 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "100000000000" )
/* = -------------------------------------------------------------- = */
/* = 05-1.1. 복합결제(포인트+신용카드) 승인 결과 처리 = */
/* = -------------------------------------------------------------- = */
if ( $pnt_issue == "SCSK" || $pnt_issue == "SCWB" )
{
$card_cd = $c_PayPlus->mf_get_res_data( "card_cd" ); // 카드사 코드
$card_name = $c_PayPlus->mf_get_res_data( "card_name" ); // 카드 종류
$app_time = $c_PayPlus->mf_get_res_data( "app_time" ); // 승인 시간
$app_no = $c_PayPlus->mf_get_res_data( "app_no" ); // 승인 번호
$noinf = $c_PayPlus->mf_get_res_data( "noinf" ); // 무이자 여부 ( 'Y' : 무이자 )
$quota = $c_PayPlus->mf_get_res_data( "quota" ); // 할부 개월 수
$partcanc_yn = $c_PayPlus->mf_get_res_data( "partcanc_yn" ); // 부분취소 가능유무
$card_bin_type_01 = $c_PayPlus->mf_get_res_data( "card_bin_type_01" ); // 카드구분1
$card_bin_type_02 = $c_PayPlus->mf_get_res_data( "card_bin_type_02" ); // 카드구분2
/* = -------------------------------------------------------------- = */
/* = 05-1.1. 복합결제(포인트+신용카드) 승인 결과 처리 = */
/* = -------------------------------------------------------------- = */
if ( $pnt_issue == "SCSK" || $pnt_issue == "SCWB" )
{
$pt_idno = $c_PayPlus->mf_get_res_data ( "pt_idno" ); // 결제 및 인증 아이디
$pnt_amount = $c_PayPlus->mf_get_res_data ( "pnt_amount" ); // 적립금액 or 사용금액
$pnt_app_time = $c_PayPlus->mf_get_res_data ( "pnt_app_time" ); // 승인시간
$pnt_app_no = $c_PayPlus->mf_get_res_data ( "pnt_app_no" ); // 승인번호
$add_pnt = $c_PayPlus->mf_get_res_data ( "add_pnt" ); // 발생 포인트
$use_pnt = $c_PayPlus->mf_get_res_data ( "use_pnt" ); // 사용가능 포인트
$rsv_pnt = $c_PayPlus->mf_get_res_data ( "rsv_pnt" ); // 총 누적 포인트
$total_amount = $amount + $pnt_amount; // 복합결제시 총 거래금액
}
$pt_idno = $c_PayPlus->mf_get_res_data ( "pt_idno" ); // 결제 및 인증 아이디
$pnt_amount = $c_PayPlus->mf_get_res_data ( "pnt_amount" ); // 적립금액 or 사용금액
$pnt_app_time = $c_PayPlus->mf_get_res_data ( "pnt_app_time" ); // 승인시간
$pnt_app_no = $c_PayPlus->mf_get_res_data ( "pnt_app_no" ); // 승인번호
$add_pnt = $c_PayPlus->mf_get_res_data ( "add_pnt" ); // 발생 포인트
$use_pnt = $c_PayPlus->mf_get_res_data ( "use_pnt" ); // 사용가능 포인트
$rsv_pnt = $c_PayPlus->mf_get_res_data ( "rsv_pnt" ); // 총 누적 포인트
$total_amount = $amount + $pnt_amount; // 복합결제시 총 거래금액
}
}
/* = -------------------------------------------------------------------------- = */
/* = 05-2. 계좌이체 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "010000000000" )
{
$app_time = $c_PayPlus->mf_get_res_data( "app_time" ); // 승인 시간
$bank_name = $c_PayPlus->mf_get_res_data( "bank_name" ); // 은행명
$bank_code = $c_PayPlus->mf_get_res_data( "bank_code" ); // 은행코드
}
/* = -------------------------------------------------------------------------- = */
/* = 05-3. 가상계좌 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "001000000000" )
{
$bankname = $c_PayPlus->mf_get_res_data( "bankname" ); // 입금할 은행 이름
$depositor = $c_PayPlus->mf_get_res_data( "depositor" ); // 입금할 계좌 예금주
$account = $c_PayPlus->mf_get_res_data( "account" ); // 입금할 계좌 번호
$va_date = $c_PayPlus->mf_get_res_data( "va_date" ); // 가상계좌 입금마감시간
}
/* = -------------------------------------------------------------------------- = */
/* = 05-4. 포인트 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "000100000000" )
{
$pt_idno = $c_PayPlus->mf_get_res_data( "pt_idno" ); // 결제 및 인증 아이디
$pnt_amount = $c_PayPlus->mf_get_res_data( "pnt_amount" ); // 적립금액 or 사용금액
$pnt_app_time = $c_PayPlus->mf_get_res_data( "pnt_app_time" ); // 승인시간
$pnt_app_no = $c_PayPlus->mf_get_res_data( "pnt_app_no" ); // 승인번호
$add_pnt = $c_PayPlus->mf_get_res_data( "add_pnt" ); // 발생 포인트
$use_pnt = $c_PayPlus->mf_get_res_data( "use_pnt" ); // 사용가능 포인트
$rsv_pnt = $c_PayPlus->mf_get_res_data( "rsv_pnt" ); // 적립 포인트
}
/* = -------------------------------------------------------------------------- = */
/* = 05-5. 휴대폰 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "000010000000" )
{
$app_time = $c_PayPlus->mf_get_res_data( "hp_app_time" ); // 승인 시간
$commid = $c_PayPlus->mf_get_res_data( "commid" ); // 통신사 코드
$mobile_no = $c_PayPlus->mf_get_res_data( "mobile_no" ); // 휴대폰 번호
}
/* = -------------------------------------------------------------------------- = */
/* = 05-6. 상품권 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "000000001000" )
{
$app_time = $c_PayPlus->mf_get_res_data( "tk_app_time" ); // 승인 시간
$tk_van_code = $c_PayPlus->mf_get_res_data( "tk_van_code" ); // 발급사 코드
$tk_app_no = $c_PayPlus->mf_get_res_data( "tk_app_no" ); // 승인 번호
}
/* = -------------------------------------------------------------------------- = */
/* = 05-7. 현금영수증 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
$cash_yn = $c_PayPlus->mf_get_res_data( "cash_yn" ); // 현금영수증 등록여부
$cash_authno = $c_PayPlus->mf_get_res_data( "cash_authno" ); // 현금 영수증 승인 번호
$cash_tr_code = $c_PayPlus->mf_get_res_data( "cash_tr_code" ); // 현금영수증 등록구분
/* = -------------------------------------------------------------------------- = */
/* = 05-8. 에스크로 여부 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
$escw_yn = $c_PayPlus->mf_get_res_data( "escw_yn" ); // 에스크로 여부
}
}
/* = -------------------------------------------------------------------------- = */
/* = 05. 승인 결과 처리 END = */
/* ============================================================================== */
/* ============================================================================== */
/* = 06. 승인 및 실패 결과 DB처리 = */
/* = -------------------------------------------------------------------------- = */
/* = 결과를 업체 자체적으로 DB처리 작업하시는 부분입니다. = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
{
if( $res_cd == "0000" )
/* = -------------------------------------------------------------------------- = */
/* = 05-2. 계좌이체 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "010000000000" )
{
// 06-1-1. 신용카드
if ( $use_pay_method == "100000000000" )
{
// 06-1-1-1. 복합결제(신용카드 + 포인트)
if ( $pnt_issue == "SCSK" || $pnt_issue == "SCWB" )
{
}
}
// 06-1-2. 계좌이체
if ( $use_pay_method == "010000000000" )
{
}
// 06-1-3. 가상계좌
if ( $use_pay_method == "001000000000" )
{
}
// 06-1-4. 포인트
if ( $use_pay_method == "000100000000" )
{
}
// 06-1-5. 휴대폰
if ( $use_pay_method == "000010000000" )
{
}
// 06-1-6. 상품권
if ( $use_pay_method == "000000001000" )
{
}
}
$app_time = $c_PayPlus->mf_get_res_data( "app_time" ); // 승인 시간
$bank_name = $c_PayPlus->mf_get_res_data( "bank_name" ); // 은행명
$bank_code = $c_PayPlus->mf_get_res_data( "bank_code" ); // 은행코드
}
/* = -------------------------------------------------------------------------- = */
/* = 06. 승인 및 실패 결과 DB처리 = */
/* ============================================================================== */
else if ( $res_cd != "0000" )
{
}
}
/* = -------------------------------------------------------------------------- = */
/* = 05-3. 가상계좌 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "001000000000" )
{
$bankname = $c_PayPlus->mf_get_res_data( "bankname" ); // 입금할 은행 이름
$depositor = $c_PayPlus->mf_get_res_data( "depositor" ); // 입금할 계좌 예금주
$account = $c_PayPlus->mf_get_res_data( "account" ); // 입금할 계좌 번호
$va_date = $c_PayPlus->mf_get_res_data( "va_date" ); // 가상계좌 입금마감시간
}
/* = -------------------------------------------------------------------------- = */
/* = 05-4. 포인트 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "000100000000" )
{
$pt_idno = $c_PayPlus->mf_get_res_data( "pt_idno" ); // 결제 및 인증 아이디
$pnt_amount = $c_PayPlus->mf_get_res_data( "pnt_amount" ); // 적립금액 or 사용금액
$pnt_app_time = $c_PayPlus->mf_get_res_data( "pnt_app_time" ); // 승인시간
$pnt_app_no = $c_PayPlus->mf_get_res_data( "pnt_app_no" ); // 승인번호
$add_pnt = $c_PayPlus->mf_get_res_data( "add_pnt" ); // 발생 포인트
$use_pnt = $c_PayPlus->mf_get_res_data( "use_pnt" ); // 사용가능 포인트
$rsv_pnt = $c_PayPlus->mf_get_res_data( "rsv_pnt" ); // 적립 포인트
}
/* = -------------------------------------------------------------------------- = */
/* = 05-5. 휴대폰 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "000010000000" )
{
$app_time = $c_PayPlus->mf_get_res_data( "hp_app_time" ); // 승인 시간
$commid = $c_PayPlus->mf_get_res_data( "commid" ); // 통신사 코드
$mobile_no = $c_PayPlus->mf_get_res_data( "mobile_no" ); // 휴대폰 번호
}
/* = -------------------------------------------------------------------------- = */
/* = 05-6. 상품권 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "000000001000" )
{
$app_time = $c_PayPlus->mf_get_res_data( "tk_app_time" ); // 승인 시간
$tk_van_code = $c_PayPlus->mf_get_res_data( "tk_van_code" ); // 발급사 코드
$tk_app_no = $c_PayPlus->mf_get_res_data( "tk_app_no" ); // 승인 번호
}
/* = -------------------------------------------------------------------------- = */
/* = 05-7. 현금영수증 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
$cash_yn = $c_PayPlus->mf_get_res_data( "cash_yn" ); // 현금영수증 등록여부
$cash_authno = $c_PayPlus->mf_get_res_data( "cash_authno" ); // 현금 영수증 승인 번호
$cash_tr_code = $c_PayPlus->mf_get_res_data( "cash_tr_code" ); // 현금영수증 등록구분
/* = -------------------------------------------------------------------------- = */
/* = 05-8. 에스크로 여부 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
$escw_yn = $c_PayPlus->mf_get_res_data( "escw_yn" ); // 에스크로 여부
}
}
/* = -------------------------------------------------------------------------- = */
/* = 05. 승인 결과 처리 END = */
/* ============================================================================== */
?>

View File

@ -0,0 +1,73 @@
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
/* ============================================================================== */
/* = 07. 승인 결과 DB처리 실패시 : 자동취소 = */
/* = -------------------------------------------------------------------------- = */
/* = 승인 결과를 DB 작업 하는 과정에서 정상적으로 승인된 건에 대해 = */
/* = DB 작업을 실패하여 DB update 가 완료되지 않은 경우, 자동으로 = */
/* = 승인 취소 요청을 하는 프로세스가 구성되어 있습니다. = */
/* = = */
/* = DB 작업이 실패 한 경우, bSucc 라는 변수(String)의 값을 "false" = */
/* = 로 설정해 주시기 바랍니다. (DB 작업 성공의 경우에는 "false" 이외의 = */
/* = 값을 설정하시면 됩니다.) = */
/* = -------------------------------------------------------------------------- = */
$bSucc = "false"; // DB 작업 실패 또는 금액 불일치의 경우 "false" 로 세팅
/* = -------------------------------------------------------------------------- = */
/* = 07-1. DB 작업 실패일 경우 자동 승인 취소 = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
{
if( $res_cd == "0000" )
{
if ( $bSucc == "false" )
{
$c_PayPlus->mf_clear();
$tran_cd = "00200000";
/* ============================================================================== */
/* = 07-1.자동취소시 에스크로 거래인 경우 = */
/* = -------------------------------------------------------------------------- = */
// 취소시 사용하는 mod_type
$bSucc_mod_type = "";
// 에스크로 가상계좌 건의 경우 가상계좌 발급취소(STE5)
if ( $escw_yn == "Y" && $use_pay_method == "001000000000" )
{
$bSucc_mod_type = "STE5";
}
// 에스크로 가상계좌 이외 건은 즉시취소(STE2)
else if ( $escw_yn == "Y" )
{
$bSucc_mod_type = "STE2";
}
// 에스크로 거래 건이 아닌 경우(일반건)(STSC)
else
{
$bSucc_mod_type = "STSC";
}
/* = -------------------------------------------------------------------------- = */
/* = 07-1. 자동취소시 에스크로 거래인 경우 처리 END = */
/* = ========================================================================== = */
$c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호
$c_PayPlus->mf_set_modx_data( "mod_type", $bSucc_mod_type ); // 원거래 변경 요청 종류
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip ); // 변경 요청자 IP
$c_PayPlus->mf_set_modx_data( "mod_desc", "가맹점 결과 처리 오류 - 가맹점에서 취소 요청" ); // 변경 사유
$c_PayPlus->mf_do_tx( $tno, $g_conf_home_dir, $g_conf_site_cd,
"", $tran_cd, "",
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib",
$ordr_idxx, $cust_ip, "3" ,
0, 0, $g_conf_key_dir, $g_conf_log_dir);
$res_cd = $c_PayPlus->m_res_cd;
$res_msg = $c_PayPlus->m_res_msg;
}
}
} // End of [res_cd = "0000"]
/* ============================================================================== */
?>

View File

@ -0,0 +1,133 @@
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
/* ============================================================================== */
/* = PAGE : 결과 처리 PAGE = */
/* = -------------------------------------------------------------------------- = */
/* = Copyright (c) 2007 KCP Inc. All Rights Reserverd. = */
/* ============================================================================== */
/* = -------------------------------------------------------------------------- = */
/* = 06-1. 승인 결과 DB 처리(res_cd == "0000") = */
/* = -------------------------------------------------------------------------- = */
/* = 각 결제수단을 구분하시어 DB 처리를 하시기 바랍니다. = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
{
if( $res_cd == "0000" )
{
// 06-1-1. 신용카드
if ( $use_pay_method == "100000000000" )
{
// 06-1-1-1. 복합결제(신용카드 + 포인트)
if ( $pnt_issue == "SCSK" || $pnt_issue == "SCWB" )
{
}
$trade_ymd = substr($app_time,0,4)."-".substr($app_time,4,2)."-".substr($app_time,6,2);
$trade_hms = substr($app_time,8,2).":".substr($app_time,10,2).":".substr($app_time,12,2);
// 카드내역 INSERT
$sql = "insert {$g4['yc4_card_history_table']}
set od_id = '$ordr_idxx',
uq_id = '$tmp_uq_id',
cd_mall_id = '$site_cd',
cd_amount = '$good_mny',
cd_app_no = '$app_no',
cd_app_rt = '$res_cd',
cd_trade_ymd = '$trade_ymd',
cd_trade_hms = '$trade_hms',
cd_opt01 = '$buyr_name',
cd_time = NOW(),
cd_ip = '$cust_ip' ";
$result = sql_query($sql, TRUE);
}
// 06-1-2. 계좌이체
if ( $use_pay_method == "010000000000" )
{
$trade_ymd = date("Y-m-d", time());
$trade_hms = date("H:i:s", time());
// 계좌이체내역 INSERT
$sql = "insert {$g4['yc4_card_history_table']}
set od_id = '$ordr_idxx',
uq_id = '$tmp_uq_id',
cd_mall_id = '$site_cd',
cd_amount = '$good_mny',
cd_app_no = '$tno',
cd_app_rt = '$res_cd',
cd_trade_ymd = '$trade_ymd',
cd_trade_hms = '$trade_hms',
cd_opt01 = '$buyr_name',
cd_time = NOW(),
cd_ip = '$cust_ip' ";
$result = sql_query($sql, TRUE);
}
// 06-1-3. 가상계좌
if ( $use_pay_method == "001000000000" )
{
$bankname = iconv("cp949", "utf8", $bankname);
$trade_ymd = date("Y-m-d", time());
$trade_hms = date("H:i:s", time());
// 가상계좌내역 INSERT
$sql = "insert {$g4['yc4_card_history_table']}
set od_id = '$ordr_idxx',
uq_id = '$tmp_uq_id',
cd_mall_id = '$site_cd',
cd_amount = '0',
cd_app_no = '$tno',
cd_app_rt = '$res_cd',
cd_trade_ymd = '$trade_ymd',
cd_trade_hms = '$trade_hms',
cd_opt01 = '$buyr_name',
cd_time = NOW(),
cd_ip = '$cust_ip' ";
$result = sql_query($sql, TRUE);
}
// 06-1-4. 포인트
if ( $use_pay_method == "000100000000" )
{
}
// 06-1-5. 휴대폰
if ( $use_pay_method == "000010000000" )
{
$trade_ymd = substr($app_time,0,8);
$trade_hms = substr($app_time,8,6);
// 휴대폰결제내역 INSERT
$sql = "insert {$g4['yc4_card_history_table']}
set od_id = '$ordr_idxx',
uq_id = '$tmp_uq_id',
cd_mall_id = '$site_cd',
cd_amount = '$good_mny',
cd_app_no = '$tno',
cd_app_rt = '$res_cd',
cd_trade_ymd = '$trade_ymd',
cd_trade_hms = '$trade_hms',
cd_opt01 = '$buyr_name',
cd_opt02 = '$mobile_no $commid',
cd_time = NOW(),
cd_ip = '$cust_ip' ";
$result = sql_query($sql, TRUE);
}
// 06-1-6. 상품권
if ( $use_pay_method == "000000001000" )
{
}
}
/* = -------------------------------------------------------------------------- = */
/* = 06.-2 승인 및 실패 결과 DB처리 = */
/* ============================================================================== */
else if ( $req_cd != "0000" )
{
}
}
/* = -------------------------------------------------------------------------- = */
/* = 06. 승인 및 실패 결과 DB 처리 END = */
/* = ========================================================================== = */
?>

17
shop/kcp/proc_win.html Normal file
View File

@ -0,0 +1,17 @@
<!--
/* ============================================================================== */
/* = PAGE : <20><><EFBFBD><EFBFBD>â <20><><EFBFBD><EFBFBD> PAGE = */
/* = -------------------------------------------------------------------------- = */
/* = Copyright (c) 2010.02 KCP Inc. All Rights Reserverd. = */
/* ============================================================================== */
//-->
<html>
<head>
<title> ó<><C3B3><EFBFBD><EFBFBD> </title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<meta http-equiv="ImageToolbar" content="No">
</head>
<body leftmargin="0" topmargin="0" onBlur="window.document.pro.focus();">
<img src="./img/processing.gif" name="pro">
</body>
</html>

View File

@ -27,12 +27,343 @@ include_once('./_head.php');
$s_page = 'orderform.php';
$s_uq_id = $tmp_uq_id;
include_once('./cartsub.inc.php');
// 새로운 주문번호 생성
if(!get_session('ss_order_uniqid')) {
set_session('ss_order_uniqid', get_uniqid());
}
$od_uq_id = get_session('ss_order_uniqid');
if (file_exists("./settle_{$default['de_card_pg']}.inc.php")) {
include "./settle_{$default['de_card_pg']}.inc.php";
}
$good_info = '';
// 상품수만큼 정보 필드 미리 만들어둠
for($k=0;$itemlist = sql_fetch_array($result); $k++) {
// 에스크로 상품정보
if ($k>0)
$good_info .= chr(30);
$good_info .= "seq=".($k+1).chr(31);
$good_info .= "ordr_numb={$od_uq_id}_".sprintf("%04d", $k).chr(31);
$good_info .= "good_name=".addslashes(preg_replace("/\'|\"|\||\,|\&|\;/", "", $itemlist[$k]['it_name'])).chr(31);
$good_info .= "good_cntx=".$itemlist[$k]['qty'].chr(31);
$good_info .= "good_amtx=".$itemlist[$k]['amount'].chr(31);
// 상품명
if($k == 0) {
$goods = preg_replace("/\'|\"|\||\,|\&|\;/", "", $itemlist[$k]['it_name']);
}
}
if($goods_count > 1) {
$goods .= "외 ".($goods_count - 1);
}
$good_mny = (int)$tot_sell_amount + (int)$send_cost;
$order_action_url = G4_HTTPS_SHOP_URL.'/orderformupdate.php';
?>
<form name=forderform method=post action="#" onsubmit="return forderform_check(this);" autocomplete=off>
<?
/* ============================================================================== */
/* = Javascript source Include = */
/* = -------------------------------------------------------------------------- = */
/* = ※ 필수 = */
/* = -------------------------------------------------------------------------- = */
?>
<script type="text/javascript" src="<? echo $g_conf_js_url; ?>"></script>
<?
/* = -------------------------------------------------------------------------- = */
/* = Javascript source Include END = */
/* ============================================================================== */
?>
<script type="text/javascript">
/* 플러그인 설치(확인) */
StartSmartUpdate();
/* 해당 스크립트는 타브라우져에서 적용이 되지 않습니다.
if( document.Payplus.object == null )
{
openwin = window.open( "chk_plugin.html", "chk_plugin", "width=420, height=100, top=300, left=300" );
}
*/
/* Payplus Plug-in 실행 */
function jsf__pay( form )
{
var RetVal = false;
/* Payplus Plugin 실행 */
if ( MakePayMessage( form ) == true )
{
openwin = window.open( "./kcp/proc_win.html", "proc_win", "width=449, height=209, top=300, left=300" );
RetVal = true ;
}
else
{
/* res_cd와 res_msg변수에 해당 오류코드와 오류메시지가 설정됩니다.
ex) 고객이 Payplus Plugin에서 취소 버튼 클릭시 res_cd=3001, res_msg=사용자 취소
값이 설정됩니다.
*/
res_cd = document.forderform.res_cd.value ;
res_msg = document.forderform.res_msg.value ;
}
return RetVal ;
}
// Payplus Plug-in 설치 안내
function init_pay_button()
{
/*
if( document.Payplus.object == null )
document.getElementById("display_setup_message").style.display = "block" ;
else
document.getElementById("display_pay_button").style.display = "block" ;
*/
// 체크 방법이 변경
if( GetPluginObject() == null ){
document.getElementById("display_setup_message").style.display = "block" ;
}
else{
document.getElementById("display_pay_button").style.display = "block" ;
}
}
/*
* 인터넷 익스플로러와 파이어폭스(사파리, 크롬.. 등등)는 javascript 파싱법이 틀리기 때문에 object 가 인식 전에 실행 되는 문제
* 기존에는 onload 부분에 추가를 했지만 setTimeout 부분에 추가
* setTimeout 에 2번째 변수 0은 딜레이 시간 0은 딜래이 없음을 의미
* - 김민수 - 20101018 -
*/
setTimeout("init_pay_button();",300);
</script>
<form name=forderform method=post action="<?=$order_action_url?>" onsubmit="return forderform_check(this);" autocomplete=off>
<input type=hidden name=od_amount value='<?=$tot_sell_amount?>'>
<input type=hidden name=od_send_cost value='<?=$send_cost?>'>
<?
/* ============================================================================== */
/* = 2. 가맹점 필수 정보 설정 = */
/* = -------------------------------------------------------------------------- = */
/* = ※ 필수 - 결제에 반드시 필요한 정보입니다. = */
/* = -------------------------------------------------------------------------- = */
// 요청종류 : 승인(pay)/취소,매입(mod) 요청시 사용
?>
<input type="hidden" name="req_tx" value="pay" />
<input type="hidden" name="site_cd" value="<? echo $default['de_kcp_mid']; ?>" />
<input type="hidden" name="site_key" value="<? echo $default['de_kcp_site_key']; ?>" />
<input type="hidden" name="site_name" value="<? echo $default['de_admin_company_name']; ?>" />
<?
/*
할부옵션 : Payplus Plug-in에서 카드결제시 최대로 표시할 할부개월 수를 설정합니다.(0 ~ 18 까지 설정 가능)
※ 주의 - 할부 선택은 결제금액이 50,000원 이상일 경우에만 가능, 50000원 미만의 금액은 일시불로만 표기됩니다
예) value 값을 "5" 로 설정했을 경우 => 카드결제시 결제창에 일시불부터 5개월까지 선택가능
*/
?>
<input type="hidden" name="pay_method" value="" />
<input type="hidden" name="ordr_idxx" value="<? echo $od_uq_id; ?>" />
<input type="hidden" name="good_name" value="<? echo $goods; ?>" />
<input type="hidden" name="good_mny" value="<? echo $good_mny; ?>" />
<input type="hidden" name="buyr_name" value="" />
<input type="hidden" name="buyr_mail" value="" />
<input type="hidden" name="buyr_tel1" value="" />
<input type="hidden" name="buyr_tel2" value="" />
<input type=hidden name='rcvr_name' value="" />
<input type=hidden name='rcvr_tel1' value="" />
<input type=hidden name='rcvr_tel2' value="" />
<input type=hidden name='rcvr_mail' value="" />
<input type=hidden name='rcvr_zipx' value="" />
<input type=hidden name='rcvr_add1' value="" />
<input type=hidden name='rcvr_add2' value="" />
<input type="hidden" name="quotaopt" value="12"/>
<!-- 필수 항목 : 결제 금액/화폐단위 -->
<input type="hidden" name="currency" value="WON"/>
<?
/* = -------------------------------------------------------------------------- = */
/* = 2. 가맹점 필수 정보 설정 END = */
/* ============================================================================== */
?>
<?
/* ============================================================================== */
/* = 3. Payplus Plugin 필수 정보(변경 불가) = */
/* = -------------------------------------------------------------------------- = */
/* = 결제에 필요한 주문 정보를 입력 및 설정합니다. = */
/* = -------------------------------------------------------------------------- = */
?>
<!-- PLUGIN 설정 정보입니다(변경 불가) -->
<input type="hidden" name="module_type" value="01"/>
<!-- 복합 포인트 결제시 넘어오는 포인트사 코드 : OK캐쉬백(SCSK), 베네피아 복지포인트(SCWB) -->
<input type="hidden" name="epnt_issu" value="" />
<!--
※ 필 수
필수 항목 : Payplus Plugin에서 값을 설정하는 부분으로 반드시 포함되어야 합니다
값을 설정하지 마십시오
-->
<input type="hidden" name="res_cd" value=""/>
<input type="hidden" name="res_msg" value=""/>
<input type="hidden" name="tno" value=""/>
<input type="hidden" name="trace_no" value=""/>
<input type="hidden" name="enc_info" value=""/>
<input type="hidden" name="enc_data" value=""/>
<input type="hidden" name="ret_pay_method" value=""/>
<input type="hidden" name="tran_cd" value=""/>
<input type="hidden" name="bank_name" value=""/>
<input type="hidden" name="bank_issu" value=""/>
<input type="hidden" name="use_pay_method" value=""/>
<!-- 현금영수증 관련 정보 : Payplus Plugin 에서 설정하는 정보입니다 -->
<input type="hidden" name="cash_tsdtime" value=""/>
<input type="hidden" name="cash_yn" value=""/>
<input type="hidden" name="cash_authno" value=""/>
<input type="hidden" name="cash_tr_code" value=""/>
<input type="hidden" name="cash_id_info" value=""/>
<!-- 2012년 8월 18일 정자상거래법 개정 관련 설정 부분 -->
<!-- 제공 기간 설정 0:일회성 1:기간설정(ex 1:2012010120120131) -->
<!--
2012.08.18 부터 개정 시행되는 '전자상거래 등에서의 소비자보호에 관한 법률'에 따른 코드 변경
이용기간이 제한되는 컨텐츠 상품이나 정기 과금 상품 등에 한하여 '용역의 제공기간'을
표기/적용하여야 하며 이와 무관한 실물 배송상품 등의 결제에는 해당되지 않습니다.
0 : 일반결제
good_expr의 나머지 적용 방식에 대해서는 KCP에서 제공하는 매뉴얼을 참고해 주세요.
-->
<input type="hidden" name="good_expr" value="0">
<!-- 에스크로 항목 -->
<!-- 에스크로 사용 여부 : 반드시 Y 로 세팅 -->
<input type='hidden' name='escw_used' value='Y'>
<!-- 에스크로 결제처리 모드 : 에스크로: Y, 일반: N, KCP 설정 조건: O -->
<input type='hidden' name='pay_mod' value='<?=($default['de_escrow_use']?"O":"N");?>'>
<!-- 배송 소요일 : 예상 배송 소요일을 입력 -->
<input type='hidden' name='deli_term' value='03'>
<!-- 장바구니 상품 개수 : 장바구니에 담겨있는 상품의 개수를 입력 -->
<input type='hidden' name='bask_cntx' value="<? echo (int)$goods_count; ?>" />
<!-- 장바구니 상품 상세 정보 (자바 스크립트 샘플(create_goodInfo()) 참고) -->
<input type='hidden' name='good_info' value="<? echo $good_info; ?>" />
<?
/* = -------------------------------------------------------------------------- = */
/* = 3. Payplus Plugin 필수 정보 END = */
/* ============================================================================== */
?>
<?
/* ============================================================================== */
/* = 4. 옵션 정보 = */
/* = -------------------------------------------------------------------------- = */
/* = ※ 옵션 - 결제에 필요한 추가 옵션 정보를 입력 및 설정합니다. = */
/* = -------------------------------------------------------------------------- = */
/* PayPlus에서 보이는 신용카드사 삭제 파라미터 입니다
※ 해당 카드를 결제창에서 보이지 않게 하여 고객이 해당 카드로 결제할 수 없도록 합니다. (카드사 코드는 매뉴얼을 참고)
<input type="hidden" name="not_used_card" value="CCPH:CCSS:CCKE:CCHM:CCSH:CCLO:CCLG:CCJB:CCHN:CCCH"/> */
/* 신용카드 결제시 OK캐쉬백 적립 여부를 묻는 창을 설정하는 파라미터 입니다
OK캐쉬백 포인트 가맹점의 경우에만 창이 보여집니다
<input type="hidden" name="save_ocb" value="Y"/> */
/* 고정 할부 개월 수 선택
value값을 "7" 로 설정했을 경우 => 카드결제시 결제창에 할부 7개월만 선택가능
<input type="hidden" name="fix_inst" value="07"/> */
/* 무이자 옵션
※ 설정할부 (가맹점 관리자 페이지에 설정 된 무이자 설정을 따른다) - "" 로 설정
※ 일반할부 (KCP 이벤트 이외에 설정 된 모든 무이자 설정을 무시한다) - "N" 로 설정
※ 무이자 할부 (가맹점 관리자 페이지에 설정 된 무이자 이벤트 중 원하는 무이자 설정을 세팅한다) - "Y" 로 설정
<input type="hidden" name="kcp_noint" value=""/> */
/* 무이자 설정
※ 주의 1 : 할부는 결제금액이 50,000 원 이상일 경우에만 가능
※ 주의 2 : 무이자 설정값은 무이자 옵션이 Y일 경우에만 결제 창에 적용
예) 전 카드 2,3,6개월 무이자(국민,비씨,엘지,삼성,신한,현대,롯데,외환) : ALL-02:03:04
BC 2,3,6개월, 국민 3,6개월, 삼성 6,9개월 무이자 : CCBC-02:03:06,CCKM-03:06,CCSS-03:06:04
<input type="hidden" name="kcp_noint_quota" value="CCBC-02:03:06,CCKM-03:06,CCSS-03:06:09"/> */
/* 사용카드 설정 여부 파라미터 입니다.(통합결제창 노출 유무)
<input type="hidden" name="used_card_YN" value="Y"/>
/* 사용카드 설정 파라미터 입니다. (해당 카드만 결제창에 보이게 설정하는 파라미터입니다. used_card_YN 값이 Y일때 적용됩니다.
/<input type="hidden" name="used_card" value="CCBC:CCKM:CCSS"/>
/* 해외카드 구분하는 파라미터 입니다.(해외비자, 해외마스터, 해외JCB로 구분하여 표시)
<input type="hidden" name="used_card_CCXX" value="Y"/>
/* 가상계좌 은행 선택 파라미터
※ 해당 은행을 결제창에서 보이게 합니다.(은행코드는 매뉴얼을 참조) */
?>
<input type="hidden" name="wish_vbank_list" value="05:03:04:07:11:23:26:32:34:81:71"/>
<?
/* 가상계좌 입금 기한 설정하는 파라미터 - 발급일 + 3일
<input type="hidden" name="vcnt_expire_term" value="3"/> */
/* 가상계좌 입금 시간 설정하는 파라미터
HHMMSS형식으로 입력하시기 바랍니다
설정을 안하시는경우 기본적으로 23시59분59초가 세팅이 됩니다
<input type="hidden" name="vcnt_expire_term_time" value="120000"/> */
/* 포인트 결제시 복합 결제(신용카드+포인트) 여부를 결정할 수 있습니다.- N 일경우 복합결제 사용안함
<input type="hidden" name="complex_pnt_yn" value="N"/> */
/* 문화상품권 결제시 가맹점 고객 아이디 설정을 해야 합니다.(필수 설정)
<input type="hidden" name="tk_shop_id" value=""/> */
/* 현금영수증 등록 창을 출력 여부를 설정하는 파라미터 입니다
※ Y : 현금영수증 등록 창 출력
※ N : 현금영수증 등록 창 출력 안함
※ 주의 : 현금영수증 사용 시 KCP 상점관리자 페이지에서 현금영수증 사용 동의를 하셔야 합니다 */
?>
<input type="hidden" name="disp_tax_yn" value="N"/>
<?
/* 결제창에 가맹점 사이트의 로고를 플러그인 좌측 상단에 출력하는 파라미터 입니다
업체의 로고가 있는 URL을 정확히 입력하셔야 하며, 최대 150 X 50 미만 크기 지원
※ 주의 : 로고 용량이 150 X 50 이상일 경우 site_name 값이 표시됩니다. */
?>
<input type="hidden" name="site_logo" value="" />
<?
/* 결제창 영문 표시 파라미터 입니다. 영문을 기본으로 사용하시려면 Y로 세팅하시기 바랍니다
2010-06월 현재 신용카드와 가상계좌만 지원됩니다
<input type='hidden' name='eng_flag' value='Y'> */
?>
<?
/* skin_indx 값은 스킨을 변경할 수 있는 파라미터이며 총 7가지가 지원됩니다.
변경을 원하시면 1부터 7까지 값을 넣어주시기 바랍니다. */
?>
<input type='hidden' name='skin_indx' value='1'>
<?
/* 상품코드 설정 파라미터 입니다.(상품권을 따로 구분하여 처리할 수 있는 옵션기능입니다.)
<input type='hidden' name='good_cd' value=''> */
/* = -------------------------------------------------------------------------- = */
/* = 4. 옵션 정보 END = */
/* ============================================================================== */
?>
<!-- 주문하시는 분 -->
<table width=100% align=center cellpadding=0 cellspacing=10 border=0>
<colgroup width=140>
@ -396,11 +727,13 @@ function forderform_check(f)
var settle_case = document.getElementsByName("od_settle_case");
var settle_check = false;
var settle_method = "";
for (i=0; i<settle_case.length; i++)
{
if (settle_case[i].checked)
{
settle_check = true;
settle_method = settle_case[i].value;
break;
}
}
@ -478,13 +811,38 @@ function forderform_check(f)
}
}
<?
if (G4_HTTPS_DOMAIN)
echo "f.action = '".G4_HTTPS_DOMAIN."/".G4_SHOP_DIR."/orderformupdate.php';";
else
echo "f.action = './orderformupdate.php';";
?>
// pay_method 설정
switch(settle_method)
{
case "계좌이체":
f.pay_method.value = "010000000000";
break;
case "가상계좌":
f.pay_method.value = "001000000000";
break;
case "휴대폰":
f.pay_method.value = "000010000000";
break;
case "신용카드":
f.pay_method.value = "100000000000";
break;
default:
f.pay_method.value = "무통장";
break;
}
// kcp 결제정보설정
f.buyr_name.value = f.od_name.value;
f.buyr_mail.value = f.od_email.value;
f.buyr_tel1.value = f.od_tel.value;
f.buyr_tel2.value = f.od_hp.value;
f.rcvr_name.value = f.od_b_name.value;
f.rcvr_tel1.value = f.od_b_tel.value;
f.rcvr_tel2.value = f.od_b_hp.value;
f.rcvr_mail.value = f.od_email.value;
f.rcvr_zipx.value = f.od_b_zip1.value + f.od_b_zip2.value;
f.rcvr_add1.value = f.od_b_addr1.value;
f.rcvr_add2.value = f.od_b_addr2.value;
return true;
}

View File

@ -99,53 +99,103 @@ if ($is_member && $config['cf_use_point'])
if (($i_temp_point > (int)$temp_point || $i_temp_point < 0) && $config['cf_use_point'])
die("Error...");
$i_amount = $i_amount + $i_send_cost - $i_temp_point;
if ($od_settle_case == "무통장")
{
$od_receipt_bank = $i_amount;
$od_temp_point = $i_temp_point;
$od_receipt_point = $i_temp_point;
}
else if ($od_settle_case == "계좌이체" || $od_settle_case == "가상계좌")
{
$od_receipt_bank = $i_amount;
$od_temp_point = $i_temp_point;
$od_receipt_point = 0;
$od_bank_account = $od_settle_case;
$od_deposit_name = $od_name;
}
else if ($od_settle_case == "휴대폰")
{
$od_receipt_hp = $i_amount;
$od_temp_point = $i_temp_point;
$od_receipt_point = 0;
}
else if ($od_settle_case == "신용카드")
{
$od_receipt_card = $i_amount;
$od_temp_point = $i_temp_point;
$od_receipt_point = 0;
}
else
{
die("od_settle_case Error!!!");
}
if ($od_temp_point)
{
if ($member['mb_point'] < $od_temp_point)
alert("회원님의 포인트가 부족하여 포인트로 결제 할 수 없습니다.");
}
if ($member['mb_id'])
$od_pwd = $member['mb_pwd'];
$i_amount = $i_amount + $i_send_cost - $i_temp_point;
$same_amount_check = false;
if ($od_settle_case == "무통장")
{
$od_temp_bank = $i_amount;
$od_temp_point = $i_temp_point;
$od_receipt_point = $i_temp_point;
$od_receipt_bank = 0;
}
else if ($od_settle_case == "계좌이체")
{
include "./kcp/pp_ax_hub.php";
$od_temp_bank = $i_amount;
$od_temp_point = $i_temp_point;
$od_receipt_bank = $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 = $od_settle_case;
$od_deposit_name = $od_name;
$bank_name = iconv("cp949", "utf8", $bank_name);
$od_bank_account = $bank_name;
$same_amount_check = true;
$pg_receipt_amount = $amount;
}
else if ($od_settle_case == "가상계좌")
{
include "./kcp/pp_ax_hub.php";
$od_temp_bank = $i_amount;
$od_temp_point = $i_temp_point;
$od_receipt_point = 0;
$od_receipt_amount = 0;
$bankname = iconv("cp949", "utf8", $bankname);
$depositor = iconv("cp949", "utf8", $depositor);
$od_bank_account = $bankname.' '.$account.' '.$depositor;
$od_deposit_name = $od_name;
}
else if ($od_settle_case == "휴대폰")
{
include "./kcp/pp_ax_hub.php";
$od_temp_bank = $i_amount;
$od_temp_point = $i_temp_point;
$od_receipt_hp = $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 = $commid.' '.$mobile_no;
$same_amount_check = true;
$pg_receipt_amount = $amount;
}
else if ($od_settle_case == "신용카드")
{
include "./kcp/pp_ax_hub.php";
$od_temp_card = $i_amount;
$od_temp_point = $i_temp_point;
$od_receipt_card = $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);
$card_name = iconv("cp949", "utf8", $card_name);
$od_bank_account = $card_name;
$same_amount_check = true;
$pg_receipt_amount = $amount;
}
else
{
die("od_settle_case Error!!!");
}
// 주문금액과 결제금액이 일치하는지 체크
if($same_amount_check) {
if((int)$i_amount !== (int)$pg_receipt_amount) {
include "./kcp/pp_ax_hub_cancel.php"; // 결제취소처리
die("Receipt Amount Error");
}
}
if ($is_member)
$od_pwd = $member['mb_password'];
else
$od_pwd = sql_password($_POST['od_pwd']);
// 새로운 주문번호를 얻는다.
$od_id = get_new_od_id();
// 주문번호를 얻는다.
$od_id = get_session('ss_order_uniqid');
// 주문서에 입력
$sql = " insert {$g4['yc4_order_table']}
@ -175,9 +225,9 @@ $sql = " insert {$g4['yc4_order_table']}
od_temp_card = '$od_receipt_card',
od_temp_hp = '$od_receipt_hp',
od_temp_point = '$od_temp_point',
od_receipt_bank = '0',
od_receipt_card = '0',
od_receipt_hp = '0',
od_receipt_bank = '$od_receipt_bank',
od_receipt_card = '$od_receipt_card',
od_receipt_hp = '$od_receipt_hp',
od_receipt_point = '$od_receipt_point',
od_bank_account = '$od_bank_account',
od_shop_memo = '',
@ -202,7 +252,7 @@ $sql = "update {$g4['yc4_cart_table']}
sql_query($sql);
// 회원이면서 포인트를 사용했다면 포인트 테이블에 사용을 추가
if ($member['mb_id'] && $od_receipt_point) {
if ($is_member && $od_receipt_point) {
insert_point($member['mb_id'], (-1) * $od_receipt_point, "주문번호 $od_id 결제");
}
@ -210,9 +260,7 @@ $od_memo = nl2br(htmlspecialchars2(stripslashes($od_memo))) . "&nbsp;";
include_once('./ordermail1.inc.php');
if ($od_settle_case == "무통장")
include_once('./ordermail2.inc.php');
include_once('./ordermail2.inc.php');
// SMS BEGIN --------------------------------------------------------
// 쇼핑몰 운영자가 수신자가 됨
@ -248,5 +296,5 @@ if (get_session("ss_direct"))
else
set_session("ss_uq_id", "");
goto_url(G4_SHOP_URL.'/orderconfirm.php');
goto_url(G4_SHOP_URL.'./orderinquiryview.php?od_id='.$od_id.'&amp;uq_id='.$tmp_uq_id);
?>

View File

@ -2,14 +2,15 @@
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$test = "";
if ($default['de_card_test']) {
if ($default['de_escrow_use'] == 1) {
// 일반결제 테스트
// 에스크로결제 테스트
$default['de_kcp_mid'] = "T0007";
$default['de_kcp_site_key'] = '2.mDT7R4lUIfHlHq4byhYjf__';
}
else {
// 에스크로결제 테스트
// 일반결제 테스트
$default['de_kcp_mid'] = "T0000";
$default['de_kcp_site_key'] = '3grptw1.zW0GSo4PQdaGvsF__';
}
@ -20,231 +21,8 @@ else {
$default['de_kcp_mid'] = "SR".$default['de_kcp_mid'];
}
$js_url = "https://pay.kcp.co.kr/plugin/payplus{$test}_un.js";
/*
* hashdata 암호화 (수정하지 마세요)
*
* hashdata 암호화 적용( site_cd + ordr_idxx + good_mny + timestamp + site_key )
* site_cd : 사이트코드
* ordr_idxx : 주문번호
* good_mny : 결제금액
* timestamp : 타임스탬프
* site_key : 사이트키
*
* hashdata 검증을 위한
* KCP에서 발급한 사이트키(site_key)를 반드시 입력해 주시기 바랍니다.
*/
$g_conf_js_url = "https://pay.kcp.co.kr/plugin/payplus{$test}_un.js";
$site_cd = trim($default['de_kcp_mid']);
$ordr_idxx = trim($od['od_id']);
$good_mny = (int)$settle_amount;
$timestamp = G4_SERVER_TIME;
$serverkey = $_SERVER['SERVER_SOFTWARE'].$_SERVER['SERVER_ADDR']; // 사용자가 알수 없는 고유한 값들
//echo $serverkey;
$hashdata = md5($site_cd.$ordr_idxx.$good_mny.$timestamp.$serverkey);
?>
<script type="text/javascript" src="<?=$js_url?>"></script>
<script type="text/javascript">
// 플러그인 설치(확인)
StartSmartUpdate();
/*
function OpenWindow()
{
var form = document.order_info;
if( document.Payplus.object == null ) {
openwin = window.open( './kcp/chk_plugin.php', 'chk_plugin', 'width=420, height=100, top=300, left=300' );
}
if ( MakePayMessage( form ) == true ) {
openwin = window.open( './kcp/proc_win.php', 'proc_win', 'width=420, height=100, top=300, left=300' );
form.submit();
}
}
*/
/* Payplus Plug-in 실행 */
function jsf__pay( form )
{
var RetVal = false;
/* Payplus Plugin 실행 */
if ( MakePayMessage( form ) == true )
{
//openwin = window.open( './kcp/proc_win.php', 'proc_win', 'width=420, height=100, top=300, left=300' );
openwin = window.open( './kcp/proc_win.php', 'proc_win', 'width=420, height=100, top=300, left=300' );
RetVal = true ;
}
else
{
/* res_cd와 res_msg변수에 해당 오류코드와 오류메시지가 설정됩니다.
ex) 고객이 Payplus Plugin에서 취소 버튼 클릭시 res_cd=3001, res_msg=사용자 취소
값이 설정됩니다.
*/
res_cd = document.order_info.res_cd.value ;
res_msg = document.order_info.res_msg.value ;
}
return RetVal ;
}
</script>
<form name="order_info" method="post" action='./kcp/pp_ax_hub.php'>
<!-- 사용자 변수 -->
<input type=hidden name='hashdata' value='<?=$hashdata?>'>
<input type=hidden name='timestamp' value='<?=$timestamp?>'>
<input type=hidden name='d_url' value='<?=$g4['url']?>'>
<input type=hidden name='shop_dir' value='<?=$g4['shop']?>'>
<input type=hidden name='uq_id' value='<?=$_SESSION['ss_temp_uq_id']?>'>
<?
switch ($settle_case)
{
case '계좌이체' :
$settle_method = "010000000000";
break;
case '가상계좌' :
$settle_method = "001000000000";
break;
case '휴대폰' :
$settle_method = "000010000000";
break;
default : // 신용카드
$settle_method = "100000000000";
break;
}
?>
<!--
2012.08.18 부터 개정 시행되는 '전자상거래 등에서의 소비자보호에 관한 법률'에 따른 코드 변경
이용기간이 제한되는 컨텐츠 상품이나 정기 과금 상품 등에 한하여 '용역의 제공기간'을
표기/적용하여야 하며 이와 무관한 실물 배송상품 등의 결제에는 해당되지 않습니다.
0 : 일반결제
good_expr의 나머지 적용 방식에 대해서는 KCP에서 제공하는 매뉴얼을 참고해 주세요.
-->
<input type=hidden name='good_expr' value='0'>
<input type=hidden name='pay_method' value='<?=$settle_method?>'>
<input type=hidden name='currency' value='WON'>
<input type=hidden name='good_name' value='<?=$goods?>'>
<input type=hidden name='good_mny' value='<?=$good_mny?>'>
<input type=hidden name='buyr_name' value='<?=addslashes($od['od_name'])?>' >
<input type=hidden name='buyr_mail' value='<?=$od['od_email']?>'>
<input type=hidden name='buyr_tel1' value='<?=$od['od_tel']?>'>
<input type=hidden name='buyr_tel2' value='<?=$od['od_hp']?>'>
<input type=hidden name='quotaopt' value='12'>
<input type=hidden name='rcvr_name' value='<?=addslashes($od['od_b_name'])?>'>
<input type=hidden name='rcvr_tel1' value='<?=$od['od_b_tel']?>'>
<input type=hidden name='rcvr_tel2' value='<?=$od['od_b_hp']?>'>
<input type=hidden name='rcvr_mail' value='<?=$od['od_email']?>'>
<input type=hidden name='rcvr_zipx' value='<?=$od['od_b_zip1'].$od['od_b_zip2']?>'>
<input type=hidden name='rcvr_add1' value='<?=addslashes($od['od_b_addr1'])?>'>
<input type=hidden name='rcvr_add2' value='<?=addslashes($od['od_b_addr2'])?>'>
<?
$good_info = "";
$sql = " select a.ct_id,
a.it_opt1,
a.it_opt2,
a.it_opt3,
a.it_opt4,
a.it_opt5,
a.it_opt6,
a.ct_amount,
a.ct_point,
a.ct_qty,
a.ct_status,
b.it_id,
b.it_name,
b.ca_id
from {$g4['yc4_cart_table']} a,
{$g4['yc4_item_table']} b
where a.uq_id = '$s_uq_id'
and a.it_id = b.it_id
order by a.ct_id ";
$result = sql_query($sql);
for ($i=1; $row=mysql_fetch_array($result); $i++)
{
if ($i>1)
$good_info .= chr(30);
$good_info .= "seq=".$i.chr(31);
$good_info .= "ordr_numb={$ordr_idxx}_".sprintf("%04d", $i).chr(31);
$good_info .= "good_name=".addslashes($row['it_name']).chr(31);
$good_info .= "good_cntx=".$row['ct_qty'].chr(31);
$good_info .= "good_amtx=".$row['ct_amount'].chr(31);
}
?>
<!-- 필수 항목 -->
<!-- 요청종류 승인(pay)/취소,매입(mod) 요청시 사용 -->
<input type='hidden' name='req_tx' value='pay'>
<!-- 테스트 결제시 : T0007 으로 설정, 리얼 결제시 : 부여받은 사이트코드 입력 -->
<input type='hidden' name='site_cd' value='<?=$site_cd?>'>
<!-- MPI 결제창에서 사용 한글 사용 불가 -->
<input type='hidden' name='site_name' value='<?=$default['de_admin_company_name']?>'>
<!-- http://testpay.kcp.co.kr/Pay/Test/site_key.jsp 로 접속하신후 부여받은 사이트코드를 입력하고 나온 값을 입력하시기 바랍니다. -->
<input type='hidden' name='site_key' value='<?=$default['de_kcp_site_key']?>'>
<!-- 필수 항목 : PULGIN 설정 정보 변경하지 마세요 -->
<input type='hidden' name='module_type' value='01'>
<input type='hidden' name='ordr_idxx' value='<?=$ordr_idxx?>'>
<!-- 에스크로 항목 -->
<!-- 에스크로 사용 여부 : 반드시 Y 로 세팅 -->
<input type='hidden' name='escw_used' value='Y'>
<!-- 에스크로 결제처리 모드 : 에스크로: Y, 일반: N, KCP 설정 조건: O -->
<input type='hidden' name='pay_mod' value='<?=($default['de_escrow_use']?"O":"N");?>'>
<!-- 배송 소요일 : 예상 배송 소요일을 입력 -->
<input type='hidden' name='deli_term' value='03'>
<!-- 장바구니 상품 개수 : 장바구니에 담겨있는 상품의 개수를 입력 -->
<input type='hidden' name='bask_cntx' value='<?=(int)($goods_count+1)?>'>
<!-- 장바구니 상품 상세 정보 (자바 스크립트 샘플(create_goodInfo()) 참고) -->
<input type='hidden' name='good_info' value='<?=$good_info?>'>
<!-- 필수 항목 : PLUGIN에서 값을 설정하는 부분으로 반드시 포함되어야 합니다. ※수정하지 마십시오.-->
<input type='hidden' name='res_cd' value=''>
<input type='hidden' name='res_msg' value=''>
<input type='hidden' name='tno' value=''>
<input type='hidden' name='trace_no' value=''>
<input type='hidden' name='enc_info' value=''>
<input type='hidden' name='enc_data' value=''>
<input type='hidden' name='ret_pay_method' value=''>
<input type='hidden' name='tran_cd' value=''>
<input type='hidden' name='bank_name' value=''>
<input type='hidden' name='use_pay_method' value=''>
<!-- 현금영수증 등록 창을 출력 여부 셋팅 - 5000원 이상 금액에만 보여지게 됩니다.-->
<input type="hidden" name="disp_tax_yn" value="N">
<!-- 현금영수증 관련 정보 : PLUGIN 에서 내려받는 정보입니다 -->
<input type="hidden" name="cash_tsdtime" value="">
<input type="hidden" name="cash_yn" value="">
<input type="hidden" name="cash_authno" value="">
<input type="hidden" name="cash_tr_code" value="">
<input type="hidden" name="cash_id_info" value="">
<!-- 계좌이체 서비스사 구분 -->
<input type="hidden" name="bank_issu" value="">
<!-- 무이자 설정 -->
<input type="hidden" name="kcp_noint" value="N">
<input type="hidden" name="kcp_noint_quota" value="">
<!-- 결제제외 카드 -->
<input type="hidden" name="not_used_card" value="">
<p align="center"><input type="image" src="<?=G4_SHOP_URL?>/img/btn_settle.gif" border="0" onclick="return jsf__pay(this.form);" /></p>
</form>
$g_conf_log_level = "3"; // 변경불가
$g_conf_gw_port = "8090"; // 포트번호(변경불가)