Exemplo n.º 1
0
<?php

if (!defined('_GNUBOARD_')) {
    exit;
}
// 개별 페이지 접근 불가
include_once G5_SHOP_PATH . '/kakaopay/incKakaopayCommon.php';
include_once G5_SHOP_PATH . '/kakaopay/lgcns_CNSpay.php';
// 로그 저장 위치 지정
$connector = new CnsPayWebConnector($LogDir);
$connector->CnsActionUrl($CnsPayDealRequestUrl);
$connector->CnsPayVersion($phpVersion);
// 요청 페이지 파라메터 셋팅
$connector->setRequestData($_REQUEST);
// 추가 파라메터 셋팅
$connector->addRequestData("actionType", "PY0");
// actionType : CL0 취소, PY0 승인, CI0 조회
$connector->addRequestData("MallIP", $_SERVER['REMOTE_ADDR']);
// 가맹점 고유 ip
$connector->addRequestData("CancelPwd", $cancelPwd);
//가맹점키 셋팅 (MID 별로 틀림)
$connector->addRequestData("EncodeKey", $merchantKey);
// 4. CNSPAY Lite 서버 접속하여 처리
$connector->requestAction();
// 5. 결과 처리
$buyerName = $_REQUEST["BuyerName"];
// 구매자명
$goodsName = $_REQUEST["GoodsName"];
// 상품명
// $buyerName = iconv("euc-kr", "utf-8", $connector->getResultData("BuyerName"));		// 구매자명
// $goodsName = iconv("euc-kr", "utf-8", $connector->getResultData("GoodsName"));		// 상품명
Exemplo n.º 2
0
include_once G5_SHOP_PATH . '/settle_kakaopay.inc.php';
include_once G5_SHOP_PATH . '/kakaopay/incKakaopayCommon.php';
include_once G5_SHOP_PATH . '/kakaopay/lgcns_CNSpay.php';
$CancelNo = (int) $od['od_casseqno'] + 1;
$vat_mny = round((int) $tax_mny / 1.1);
$_REQUEST['TID'] = $od['od_tno'];
$_REQUEST['Amt'] = (int) $tax_mny + (int) $free_mny;
$_REQUEST['CancelMsg'] = $mod_memo;
$_REQUEST['PartialCancelCode'] = 1;
$_REQUEST['CheckRemainAmt'] = (int) $od['od_receipt_price'] - (int) $od['od_refund_price'];
$_REQUEST['CancelNo'] = $CancelNo;
$_REQUEST['SupplyAmt'] = (int) $tax_mny + (int) $free_mny - $vat_mny;
$_REQUEST['GoodsVat'] = $vat_mny;
$_REQUEST['ServiceAmt'] = 0;
// 로그 저장 위치 지정
$connector = new CnsPayWebConnector($LogDir);
$connector->CnsActionUrl($CnsPayDealRequestUrl);
$connector->CnsPayVersion($phpVersion);
$connector->setRequestData($_REQUEST);
$connector->addRequestData("actionType", "CL0");
$connector->addRequestData("CancelPwd", $cancelPwd);
$connector->addRequestData("CancelIP", $_SERVER['REMOTE_ADDR']);
//가맹점키 셋팅 (MID 별로 틀림)
$connector->addRequestData("EncodeKey", $merchantKey);
// 4. CNSPAY Lite 서버 접속하여 처리
$connector->requestAction();
// 5. 결과 처리
$resultCode = $connector->getResultData("ResultCode");
// 결과코드 (정상 :2001(취소성공), 2002(취소진행중), 그 외 에러)
$resultMsg = $connector->getResultData("ResultMsg");
// 결과메시지
Exemplo n.º 3
0
<?php

include_once './_common.php';
include_once G5_LIB_PATH . '/json.lib.php';
include G5_SHOP_PATH . '/kakaopay/incKakaopayCommon.php';
include G5_SHOP_PATH . '/kakaopay/lgcns_CNSpay.php';
$Amt = (int) preg_replace('#[^0-9]#', '', $_POST['Amt']);
$ediDate = trim($_POST['ediDate']);
////////위변조 처리/////////
//결제요청용 키값
$cnspay_lib = new CnsPayWebConnector($LogDir);
$md_src = $ediDate . $MID . $Amt;
$salt = hash("sha256", $merchantKey . $md_src, false);
$hash_input = $cnspay_lib->makeHashInputString($salt);
$hash_calc = hash("sha256", $hash_input, false);
$hash_String = base64_encode($hash_calc);
die(json_encode(array('hash_String' => $hash_String, 'error' => '')));