KG이니시스 INIpay PRO 주문자 이메일 확인 후 전달
- 주문서/개인결제 결제 시작 시 이메일 형식을 확인해 잘못된 경우 안내 후 중단 - 결제창 요청에서는 확인된 이메일만 선택 항목으로 전달해 결제가 막히지 않게 처리 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
23c60a8ba1
commit
bc07b8383e
@@ -117,6 +117,23 @@ if (!function_exists('inicis_pro_cut')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('inicis_pro_valid_email')) {
|
||||
function inicis_pro_valid_email($email)
|
||||
{
|
||||
$email = trim((string) $email);
|
||||
if ($email === '' || strlen($email) > 60)
|
||||
return false;
|
||||
if (!preg_match('/^[0-9A-Za-z._%+-]+@([0-9A-Za-z-]+\.)+[A-Za-z]{2,}$/', $email))
|
||||
return false;
|
||||
|
||||
$tld = strtolower(substr(strrchr($email, '.'), 1));
|
||||
if (in_array($tld, array('test', 'example', 'invalid', 'localhost', 'local')))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('inicis_pro_clean_oid')) {
|
||||
function inicis_pro_clean_oid($oid)
|
||||
{
|
||||
|
||||
@@ -12,11 +12,35 @@ if (G5_IS_MOBILE) {
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function inicis_pro_email_check()
|
||||
{
|
||||
var field = jQuery('input[name=od_email], input[name=pp_email]').first();
|
||||
if (!field.length)
|
||||
return true;
|
||||
|
||||
var email = String(field.val() || '').replace(/^\s+|\s+$/g, '');
|
||||
if (email === '')
|
||||
return true;
|
||||
|
||||
if (email.length <= 60 && /^[0-9A-Za-z._%+-]+@([0-9A-Za-z-]+\.)+[A-Za-z]{2,}$/.test(email)) {
|
||||
var tld = email.substring(email.lastIndexOf('.') + 1).toLowerCase();
|
||||
if (tld !== 'test' && tld !== 'example' && tld !== 'invalid' && tld !== 'localhost' && tld !== 'local')
|
||||
return true;
|
||||
}
|
||||
|
||||
alert('이메일 주소가 올바르지 않습니다. 이메일 주소를 다시 확인해 주십시오.');
|
||||
field.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
function inicis_pro_pay(oid, deviceType)
|
||||
{
|
||||
var requestData = null;
|
||||
var errorMessage = '';
|
||||
|
||||
if (!inicis_pro_email_check())
|
||||
return false;
|
||||
|
||||
jQuery.ajax({
|
||||
type: 'POST',
|
||||
url: g5_url + '/shop/inicis/pro/request.php',
|
||||
|
||||
@@ -72,9 +72,11 @@ $buyer_email = $is_personal ? (isset($order_data['pp_email']) ? $order_data['pp_
|
||||
$buyer_phone = $is_personal ? (isset($order_data['pp_hp']) ? $order_data['pp_hp'] : '') : (!empty($order_data['od_hp']) ? $order_data['od_hp'] : (isset($order_data['od_tel']) ? $order_data['od_tel'] : ''));
|
||||
|
||||
$reserved = array(
|
||||
'email' => inicis_pro_cut($buyer_email, 60),
|
||||
'phonenum' => preg_replace('/[^0-9]/', '', $buyer_phone)
|
||||
);
|
||||
// 이메일은 선택 항목이며, 형식이 확인되지 않으면 결제창 요청이 거부되므로 확인된 경우에만 전달한다.
|
||||
if (inicis_pro_valid_email($buyer_email))
|
||||
$reserved['email'] = inicis_pro_cut($buyer_email, 60);
|
||||
if ($pay_type === 'CARD') {
|
||||
$reserved['quotabase'] = '01:02:03:04:05:06:07:08:09:10:11:12';
|
||||
if ($easypay_code !== '')
|
||||
|
||||
Reference in New Issue
Block a user