통합인증 : 이니시스 모듈 추가

This commit is contained in:
projectSylas
2021-09-13 06:08:11 +00:00
parent 5fc6fcd4ac
commit 353a1ad784
5 changed files with 271 additions and 148 deletions

View File

@ -7,19 +7,18 @@
$max_cr_id = $res['max_cr_id'];
if(empty($max_cr_id)) $max_cr_id = 0;
certify_count_check($member['mb_id'], 'sa'); // 금일 인증시도 횟수 체크
//$mid = 'SRA'.$config['cf_cert_kg_mid'];
$mid = $config['cf_cert_kg_mid']; // 부여받은 MID(상점ID) 입력(영업담당자 문의)
$apiKey = $config['cf_cert_kg_cd']; // 부여받은 MID 에 대한 apiKey
$mTxId ='SIR'.$max_cr_id;
if($config['cf_cert_use'] == 2) { // 테스트 일때
$mid = "INIiasTest";
$apiKey = "TGdxb2l3enJDWFRTbTgvREU3MGYwUT09";
$mTxId ='test_'.$max_cr_id;
} else {
$mid = 'SRA'.$config['cf_cert_kg_mid']; // 부여받은 MID(상점ID) 입력(영업담당자 문의)
$apiKey = $config['cf_cert_kg_cd']; // 부여받은 MID 에 대한 apiKey
$mTxId ='SIR_'.$max_cr_id.$type;
certify_count_check($member['mb_id'], 'sa'); // 금일 인증시도 횟수 체크
}
$reqSvcCd ='01';
if($config['cf_cert_use'] != 2) { // 테스트모드일때
$mid = $config['cf_cert_kg_mid'];
$apiKey = $config['cf_cert_kg_cd'];
$mTxId ='test_'.$max_cr_id;
}
// 등록가맹점 확인
$plainText1 = hash("sha256",(string)$mid.(string)$mTxId.(string)$apiKey);
$authHash = $plainText1;
@ -34,20 +33,10 @@
$plainText2 = hash("sha256",(string)$userName.(string)$mid.(string)$userPhone.(string)$mTxId.(string)$userBirth.(string)$reqSvcCd);
$userHash = $plainText2;
}
$g5['title'] = '통합인증 결과';
include_once(G5_PATH.'/head.sub.php');
$g5['title'] = 'KG이니시스 통합인증';
include_once(G5_PATH.'/head.sub.php');
?>
<script language="javascript">
function callSa() {
document.saForm.setAttribute("target", "_self");
document.saForm.setAttribute("post", "post");
document.saForm.setAttribute("action", "https://sa.inicis.com/auth");
document.saForm.submit();
}
</script>
</head>
<body>
<form name="saForm">
<input type="hidden" name="mid" value="<?php echo $mid ?>"> <!-- 필수 값 -->
<input type="hidden" name="reqSvcCd" value="<?php echo $reqSvcCd ?>"> <!-- 필수 값 -->
@ -63,9 +52,14 @@
<input type="hidden" name="directAgency" value="<?php echo $_POST['directAgency']; ?>">
<input type="hidden" name="successUrl" value="<?php echo G5_KGCERT_URL; ?>/kg_result.php"> <!-- 필수 값 -->
<input type="hidden" name="failUrl" value="<?php echo G5_KGCERT_URL; ?>/kg_response.php"> <!-- 필수 값 -->
<input type="hidden" name="failUrl" value="<?php echo G5_KGCERT_URL; ?>/kg_result.php"> <!-- 필수 값 -->
<!-- successUrl / failUrl 은 분리 하여 이용가능!-->
</form>
<script>
callSa();
document.saForm.setAttribute("target", "_self");
document.saForm.setAttribute("post", "post");
document.saForm.setAttribute("action", "https://sa.inicis.com/auth");
document.saForm.submit();
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');