정기구독 결제 수단 등록
' + '' + '카드 등록에 실패했습니다.
' + '' + 'var PAYMENT = {
onClickStep2 : function() {
var data = $('#form-step1').serializeObject();
$.ajax({
type: 'POST',
data: data,
url: ('/admin/ajax/upgrade_plan_step1.cm'),
dataType: 'json',
async: false,
cache: false,
success:function(result)
{
if(result.msg == 'SUCCESS') {
var url = '/admin/upgrade/list/?mode=' + result.mode + '&plan=' + result.plan + '&type=' + result.type + '&step=' + result.step
+ '&period_type=' + result.period_type;
if(result.monthly_type != '')
url += '&monthly_type=' + result.monthly_type;
window.parent.location.href = url;
}
else {
alert(result.msg);
}
}
});
},
onSelectMonthlyPayment : function(basic_price, period, version) {
$.ajax({
type: 'POST',
data: {'basic_price': basic_price, 'period': period, 'version': version },
url: ('/admin/ajax/select_monthly_price.cm'),
dataType : 'json',
async: false,
cache: false,
success:function(result)
{
if(result.msg == 'SUCCESS') {
//alert(result.html);
$('#month_select_price').empty().html(result.html);
}
}
});
},
onClickPaymentSubmitForm : function() {
$('#payment_submit_form').submit();
},
//가상계좌 입금계좌 확인 모달출력 함수
checkDepositAccount : function(order_number){
$.ajax({
type : "POST",
data : {"order_number" : order_number},
url : ("/admin/ajax/check_deposit_account.cm"),
dataType : "json",
async : false,
cache : false,
success : function(result){
if(result.msg === "SUCCESS"){
$.cocoaDialog.open({type : "admin_check_deposit_account", custom_popup : result.html});
}else{
alert(result.msg);
}
}
});
}
};
var PRICE = {
country: "",
cache: {},
priceData: {},
/**
* @params {couponData.couponCode} string 쿠폰 코드
* @params {couponData.couponType} period | fixedAmount | percentage 할인 타입
* @params {couponData.discountAmount} number 할인 가격(fixedAmount인 경우)
* @params {couponData.discountRate} number 할인률(percentage 인 경우)
* @params {couponData.period} number 기간 연장
* @params {couponData.periodType} day | month 기간 연장 타입
*/
couponData: null,
init: function(data = {}) {
const periodData = (data.period === '0' ? null : data.period) ?? '12'; // 1년 기본값, period가 0인 경우에도 1년 기본값 처리
const isTrialSite = data.isTrialSite ?? false;
const currentVersion = data.currentVersion ?? '';
const defaultVersion = data.defaultVersion ?? '';
const defaultPeriod = data.defaultPeriod ?? '';
const forcePeriod = data.forcePeriod ?? '';
const removedPeriods = data.removedPeriods ?? [];
const params = PRICE.getParams();
// FS-2883: 제거된 기간이 URL 쿼리로 들어오면 무시
const paramPeriod = removedPeriods.indexOf(params.period) !== -1 ? '' : params.period;
const period = forcePeriod || paramPeriod || defaultPeriod || PRICE.getTermKindValue(periodData);
PRICE.priceData = {
period: isTrialSite && period === 'non_extension' ? 'one_year' : period,
isTrialSite,
currentVersion,
defaultVersion,
forcePeriod,
};
},
start : function(country){
this.country = country;
var $payment_type = $("#div_payment_type");
var type = $('#type').val();
//기간연장/업그레이드
if(type === "upgrade") {
ADMIN_ADD_CARD.reloadedValueCheck();
PRICE.initParams();
PRICE.setVersion();
PRICE.setPeriod();
$("#coupon_value").on("focus",function(){
if (PRICE.isPaidUpgradeOrder()) {
return;
}
if (PRICE.priceData.forcePeriod) {
return;
}
var $radio_term_item = $("._day_ck").find("[name='rdo_term_kind']");
if($("._day_ck").find("[name='rdo_term_kind']:radio:checked").val() !== "coupon"){
$radio_term_item.each(function(){
if($(this).val() === "coupon"){
$(this).prop("checked", true);
}
});
}
PRICE.setPeriod();
});
if (PRICE.priceData.isTrialSite) {
$('#is_terminate_trial').change(function() {
PRICE.setPeriod();
const isChecked = $(this).prop('checked');
$('#select_card_submit_btn').text(isChecked ? '즉시 결제' : '저장');
});
}
}
//부가 서비스
else {
var proc_file = "./payment/proc_ajax.cm";
var param = {};
param.mode = "get_site_infomation";
param.country = this.country;
param.site_code = $("#sel_site").val();
param.version = $("#value_version").val();
param.site_changed = "N";
$.ajax({
type: 'POST',
url: proc_file,
data: param,
async: false,
success: function(data) {
service_info = $.parseJSON(data);
}
});
PRICE.setExtraService(type);
}
// 결제방식 제어
$payment_type.find('.item-wrap').find('a.item').on('click', function(){
if ( $(this).hasClass('text-gray-bright') ) {
var disabled_msg = $(this).data('disabled_msg');
if ( disabled_msg.trim() != '' ) alert(disabled_msg);
} else {
$('#div_payment_type').find('.item-wrap').find('a.item.active').removeClass('active');
$(this).addClass('active');
$('input[name=sel_payment_type]').val($(this).data('paymethod'));
}
});
$("#prev_version_price").val(service_info.version_price);
$("#request_site_version").val(service_info["site_version"]);
$("#request_price").val(service_info["price"]);
$('#btn_payment').on('click', function(e){
e.stopPropagation();
PRICE.submit();
return false;
});
this.paymentInit();
switch(this.country){
case KOREA_COUNTRY_CODE:
this.initKR();
break;
case TAIWAN_COUNTRY_CODE:
this.initTW();
break;
}
},
initKR: function(){
// 정기결제 관련 제어
var $payment_type = $('#div_payment_type');
$('input[name="rdo_term_kind"]:radio').on('change', function(){
$payment_type.find('.item-wrap').find('a.item').each(function(){
$(this).toggleClass('text-gray-bright', !$(this).data('default'));
});
if ($(this).val() === 'one_month') {
$payment_type.find('.item-wrap').find('a.item').each(function(){
var _pay_method = $(this).data('paymethod');
if (_pay_method === "card") {
$(this).toggleClass('disabled', false);
if ( !$(this).hasClass('active') ) {
$payment_type.find('.item-wrap').find('a.item').removeClass('active');
$(this).addClass('active');
$('input[name=sel_payment_type]').val(_pay_method);
}
} else {
$(this).toggleClass('text-gray-bright', true);
}
});
}
});
$.each($('input[name=rdo_term_kind]'), (idx, el) => {
const $el = $(el)
const value = $el.val()
if (value === 'non_extension' || value === 'coupon') {
$el.on('change', () => PRICE.handleChangeNonPeriod())
} else {
$el.on('change', () => PRICE.handleChangePeriod($el))
}
})
$('._extend_period_list').find('input[name=value_version]').on('change', PRICE.handleChangeVersion)
},
initTW: function(){
var $invoice_wrapper = $('._invoice_wrapper');
$invoice_wrapper.find('select').on('change', function(){
$invoice_wrapper.find('._invoice_data_wrapper').toggle( ($(this).val().trim()!= '') );
var invoice_type = $(this).val();
$invoice_wrapper.find('._invoice_data').each(function(){
var target = $(this).data('target');
$(this).toggle(target.indexOf(invoice_type) != -1);
});
});
$invoice_wrapper.find('._invoice_love_code').on('keyup', function(){
$(this).data('checked', false);
$invoice_wrapper.find('._love_code_chk_btn').addClass('btn-primary');
});
$('input[name=rdo_term_kind]').on('change', PRICE.setPeriod)
$('._extend_period_list').find('input[name=value_version]').on('change', PRICE.setVersion)
},
checkLoveCode: function(){
var love_code = $('._invoice_love_code').val();
if ( love_code.length > 0 ) {
$.ajax({
"type": "POST",
"url": "/admin/ajax/check_invoice_donation_code.cm",
"data": {"love_code": love_code},
"dataType": "JSON",
"success": function(res){
if ( res.msg == 'SUCCESS' ) {
$('._invoice_love_code').data('checked', true);
$('._love_code_chk_btn').removeClass('btn-primary');
} else {
alert(res.msg);
}
}
});
}
return false;
},
initParams: function() {
const version = this.getParams().version || PRICE.priceData.defaultVersion || 'free';
const period = PRICE.priceData.period;
[version, period].forEach(value => {
const $radio = document.querySelector(`input[type="radio"][value="${value}"]`);
if (!$radio) return;
$radio.checked = true;
});
/**
* PG 프로모션 조건
* pro 버전 - 1, 3, 6개월 선택 시 띄우기
* global 버전 - 1, 3개월 선택 시 띄우기
*/
const modal_period = {
pro: ['one_month', 'three_month', 'six_month'],
global: ['one_month', 'three_month'],
}[version] ?? []
if (modal_period.includes(period)) {
PRICE.openPromotionPGModal(version);
PRICE.togglePromotionPGInfo(false);
} else {
PRICE.togglePromotionPGInfo(true);
}
},
getTermKindValue: function(period) {
const value = {
'0': 'non_extension',
'1': 'one_month',
'3': 'three_month',
'6': 'six_month',
'12': 'one_year',
'24': 'two_year',
'coupon': 'coupon',
}[period];
return value ?? 'one_year';
},
getTermKindNumber: function(term_kind) {
return {
'non_extension': 0,
'one_month': 1,
'three_month': 3,
'six_month': 6,
'one_year': 12,
'two_year': 24,
}[term_kind];
},
getParams: function() {
return Object.fromEntries(new URLSearchParams(window.location.search));
},
isUpgradeOrder: function() {
if ($('#type').val() !== 'upgrade') {
return false;
}
const selected_version = $('input[name="value_version"]:checked').val();
const current_version = (typeof php_site_version !== 'undefined' && php_site_version) ? php_site_version : (PRICE.priceData.currentVersion || '');
if (!selected_version || !current_version) {
return false;
}
return selected_version !== current_version;
},
isPaidUpgradeOrder: function() {
if (!PRICE.isUpgradeOrder()) {
return false;
}
const selected_version = $('input[name="value_version"]:checked').val();
const upgradePriceKeyMap = {
starter: 'starter_price_upgrade',
pro: 'pro_price_upgrade',
global: 'global_price_upgrade',
};
const key = upgradePriceKeyMap[selected_version] || 'price_upgrade';
const price = parseInt(service_info[key], 10);
return !isNaN(price) && price > 0;
},
setParams: function(params) {
const searchParams = new URLSearchParams(window.location.search);
Object.keys(params).forEach(key => searchParams.set(key, params[key]));
window.history.replaceState({}, '', `${window.location.pathname}?${searchParams}`);
},
//요금 티어 선택
setVersion : function(){
var select_version;
select_version = $("input[name='value_version']:checked").val();
if(select_version == 'free' || select_version == 'sample') {
$("._extend_list").hide();
} else {
$("._extend_list").show();
}
PRICE.setParams({ version: select_version });
PRICE.togglePaymentInfoVersionFree();
var proc_file = "./payment/proc_ajax.cm";
var param = {};
param.country = this.country;
param.mode = "get_site_infomation";
param.site_code = $("#sel_site").val();
param.version = select_version;
param.site_changed = "N";
param.term_kind = $("._day_ck").find("[name='rdo_term_kind']:checked").val();
param.is_trial_site = $("#is_trial_site").val() || 'N';
param.is_terminate_trial = $("#is_terminate_trial").prop("checked") ? 'Y' :'N';
$.ajax({
type: 'POST',
url: proc_file,
data: param,
async: false,
success: function(data) {
service_info = $.parseJSON(data);
}
});
if(service_info.site_version !== "free" && service_info.site_version !== 'sample') {
var current_version_span_id = "#div_upgrade_"+service_info.site_version+"_price_sub";
$("#div_upgrade_starter_price_sub").html(this.makePriceStr(service_info.starter_price_upgrade));
$("#div_upgrade_pro_price_sub").html(this.makePriceStr(service_info.pro_price_upgrade));
$("#div_upgrade_global_price_sub").html(this.makePriceStr(service_info.global_price_upgrade));
$(current_version_span_id).html("");
$("#div_upgrade_pay").show();
} else {
$(".not_extend").empty().toggleClass('border-bottom', false);
$("#div_upgrade_pay").hide();
$("#div_upgrade_price").html("");
}
if(service_info.upgrade_version && service_info.upgrade_version !== "free") {
var event_discount = 1;
var discount = 1;
var site_version_price = service_info['default_price'] * discount * event_discount;
var is_event = false;
if ( typeof service_info['event_discount'] != 'undefined') {
service_info['event_discount'] = parseFloat(service_info['event_discount']);
if ( !isNaN(service_info['event_discount']) && service_info['event_discount'] !== 0 ) {
event_discount = 1 - (service_info['event_discount'] / 100);
}
}
var price_str_per_month = "/" + getLocalizeString('타이틀_월', '', '월');
var price_wrapper = {1: "price_one_month", 3: "price_three_month", 6: "price_six_month", 12: "price_one_year", 24: "price_two_year"};
for ( var _period in price_wrapper ) {
_period = parseInt(_period);
if ( typeof service_info['discount'][_period] != "undefined" ) discount = 1 - (service_info['discount'][_period] / 100);
site_version_price = service_info['default_price'] * discount * event_discount;
$("#"+price_wrapper[_period]).html(this.makePriceStr(service_info["default_price"]) + price_str_per_month);
$("#"+price_wrapper[_period]).toggle(service_info['default_price'] > site_version_price);
$("#discount_" + price_wrapper[_period]).html(this.makePriceStr(site_version_price) + price_str_per_month);
$("#discount_" + price_wrapper[_period]).toggleClass('text-primary', (service_info['price'] > site_version_price));
if(service_info['discount_str'][service_info.upgrade_version][_period] !== ''){
$(".discount_" + price_wrapper[_period] + "_str").text( " (" + getLocalizeString('설명_n프로할인', service_info['discount_str'][service_info.upgrade_version][_period], service_info['discount_str'][service_info.upgrade_version][_period] + '%') + ")");
}
}
}
$("#prev_version_price").val(service_info.version_price);
$("#request_extend_price").val(service_info.price_extend);
$("#request_upgrade_price").val(service_info.price_upgrade);
service_info.total_price = parseInt(service_info.price_extend, 10);
this.setdiscountRate();
this.drawPriceSection();
},
togglePaymentInfoVersionFree : function (){
//if Version === Free, this function will be operated Once.
if($("input[name='value_version']:checked").val() === 'free'){
$("#notify_regularly_payment").addClass("tw-hidden");
} else {
$("#notify_regularly_payment").removeClass("tw-hidden");
}
},
setdiscountRate : function(){
var discount_wrapper = {
1: "discount_rate_by_version_one_month",
3: "discount_rate_by_version_three_month",
6: "discount_rate_by_version_six_month",
12: "discount_rate_by_version_one_year",
24: "discount_rate_by_version_two_year",
};
switch ( this.country ) {
case 'kr':
for(var _discount in discount_wrapper){
if(_discount === '1'){
$(`#${discount_wrapper[_discount]}`).html( getLocalizeString("설명_n개월",_discount,"%1개월") );
} else {
$(`#${discount_wrapper[_discount]}`).html(
getLocalizeString("설명_n개월",_discount,"%1개월")
+` (`
+ service_info.discount[_discount]
+'% '
+ getLocalizeString("설명_할인",'',"off")
+`)`
)
}
}
break;
case 'tw':
for(var _discount in discount_wrapper){
$(`#${discount_wrapper[_discount]}`).html(
getLocalizeString("설명_n개월",_discount,"%1개월")
+` (`
+ service_info.discount_str[service_info['upgrade_version']][_discount]
+'% '
+ getLocalizeString("설명_할인",'',"off")
+`)`
)
}
break;
}
},
//기간 선택
setPeriod : function(){
var proc_file = "./payment/proc_ajax.cm";
var param = {};
param.country = this.country;
param.mode = "get_site_infomation";
param.site_code = $("#sel_site").val();
param.version = service_info.upgrade_version;
param.site_changed = "N";
param.term_kind = $("._day_ck").find("[name='rdo_term_kind']:checked").val();
console.log('param.term_kind', param.term_kind);
param.is_trial_site = $("#is_trial_site").val() || 'N';
param.is_terminate_trial = $("#is_terminate_trial").prop("checked") ? 'Y' :'N';
/** 쿠폰은 URL에 저장하지 않는다 */
if (param.term_kind !== 'coupon') {
PRICE.setParams({ period: param.term_kind });
}
$.ajax({
type: "POST",
url: proc_file,
data: param,
async: false,
success: function(data) {
service_info = $.parseJSON(data);
}
});
$("#prev_version_price").val(service_info.version_price);
$("#request_extend_price").val(service_info.price_extend);
$("#request_upgrade_price").val(service_info.price_upgrade);
$("#next_pay_date").html(service_info.next_pay_date + " ");
service_info.total_price = parseInt(service_info.price_extend, 10);
this.paymentInit();
this.drawPriceSection();
if(this.country === "kr"){
this.drawPeriodSection();
}
},
setExtraService : function(type) {
service_info.price_extend = 0;
service_info.price_upgrade = 0;
if(type === 'ios') {
$('#ios_price_list').toggle(service_info["is_ios_infinite"] !== 'Y');
if((service_info["is_ios_infinite"] !== 'Y') && $('#ios_price_list').find(':radio:checked').length > 0){
var ios_price_selected = $('#ios_price_list').find(':radio:checked').val();
if(service_info["ios_price"] && service_info["ios_price"][ios_price_selected] !== undefined && service_info.is_ios_infinite !== 'Y'){
$("#request_ios").val(service_info['ios_price'][ios_price_selected]);
service_info.total_price = parseInt(service_info['ios_price'][ios_price_selected]);
}
}
} else if(type === 'android') {
if($("#chk_android").is(":checked") && service_info.app_android === 'N'){
$("#request_android").val(parseInt(service_info.android_price));
service_info.total_price = parseInt(service_info.android_price);
}
$("#div_android_price_wrapper").find(".text-line-through").html(this.makePriceStr(100000));
$("#div_android_price_wrapper").find(".text-primary").html(this.makePriceStr(service_info.android_price));
} else if(type === 'adult') {
$("#auth_service_price_dream_security").html(this.makePriceStr(service_info.auth_service_price_dream_security));
$("#auth_service_price_mobilians").html(this.makePriceStr(service_info.auth_service_price_mobilians));
$("#auth_service_price_inicis").html(this.makePriceStr(service_info.auth_service_price_inicis));
var auth_comobination_price_html = this.makePriceStr(service_info.auth_service_price_combination);
if(service_info.auth_service_price_combination === 0) auth_comobination_price_html = "30,000원"+" "+auth_comobination_price_html+"";
$("#auth_service_price_combination").html(auth_comobination_price_html);
service_info.total_price = 0;
$("#chk_auth_service_dream_security").change(function(){
if($("#chk_auth_service_dream_security").prop("checked")){
service_info.total_price += parseInt(service_info.auth_service_price_dream_security);
$("#request_auth_service_dream_security").val(service_info.auth_service_price_dream_security);
}else{
service_info.total_price -= parseInt(service_info.auth_service_price_dream_security);
$("#request_auth_service_dream_security").val(0);
}
PRICE.drawPriceSection();
});
$("#chk_auth_service_mobilians").change(function(){
if($("#chk_auth_service_mobilians").prop("checked")){
$("._auth_mobilians_description").show();
service_info.total_price += parseInt(service_info.auth_service_price_mobilians);
$("#request_auth_service_mobilians").val(service_info.auth_service_price_mobilians);
}else{
$("._auth_mobilians_description").hide();
service_info.total_price -= parseInt(service_info.auth_service_price_mobilians);
$("#request_auth_service_mobilians").val(0);
}
PRICE.drawPriceSection();
});
$("#chk_auth_service_inicis").change(function(){
if($("#chk_auth_service_inicis").prop("checked")){
service_info.total_price += parseInt(service_info.auth_service_price_inicis);
$("#request_auth_service_inicis").val(service_info.auth_service_price_inicis);
}else{
service_info.total_price -= parseInt(service_info.auth_service_price_inicis);
$("#request_auth_service_inicis").val(0);
}
PRICE.drawPriceSection();
});
$("#chk_auth_service_combination").change(function(){
if($("#chk_auth_service_combination").prop("checked")){
service_info.total_price += parseInt(service_info.auth_service_price_combination);
$("#request_auth_service_combination").val(service_info.auth_service_price_combination);
}else{
service_info.total_price -= parseInt(service_info.auth_service_price_combination);
$("#request_auth_service_combination").val(0);
}
PRICE.drawPriceSection();
});
}
PRICE.drawPriceSection();
},
getTotalDiscountAmount: function() {
var term_kind = $("._day_ck").find("[name='rdo_term_kind']:checked").val();
var term_kind_number = PRICE.getTermKindNumber(term_kind);
var discount_percent = service_info.discount[term_kind_number];
if (!discount_percent) {
return {
rate: 0,
amount: 0,
};
}
var price_rate = discount_percent / 100;
var discount_amount = (service_info['default_price'] * price_rate) * term_kind_number;
return {
rate: price_rate * 100,
amount: discount_amount,
};
},
shouldCalculateCouponDiscountPrice: function() {
if (PRICE.couponData === null) {
return false;
}
if (PRICE.isPaidUpgradeOrder()) {
return false;
}
if (PRICE.couponData.couponType === 'period') {
return false;
}
return true;
},
calculateCouponDiscountPrice: function(total_price) {
if (!PRICE.shouldCalculateCouponDiscountPrice()) {
return 0;
}
const couponData = PRICE.couponData;
if (couponData.couponType === 'fixedAmount') {
return couponData.discountAmount;
}
return total_price ? total_price * (couponData.discountRate / 100) : 0;
},
drawPriceSection : function() {
var default_price_extend = parseInt(service_info.default_price_extend, 10);
var total_discount_amount = PRICE.getTotalDiscountAmount();
var total_price = parseInt(service_info.total_price);
var upgrage_price = parseInt(service_info.price_upgrade);
var coupon_discount_price = PRICE.calculateCouponDiscountPrice(total_price);
var price_tax = 0;
var sum_data = Math.max(total_price + upgrage_price - coupon_discount_price, 0);
var next_pay_price = 0;
switch ( this.country ) {
default:
case KOREA_COUNTRY_CODE:
price_tax = parseInt(sum_data * service_info.vat, 10);
sum_data += price_tax;
next_pay_price = total_price + parseInt(total_price * service_info.vat, 10);
break;
case TAIWAN_COUNTRY_CODE:
total_price = Math.round(total_price / (1 + service_info.vat));
upgrage_price = Math.round((upgrage_price / (1 + service_info.vat)));
price_tax = sum_data - (total_price + upgrage_price);
break;
}
// upgrade케이스가 아닌 경우 1의자리 절삭한다
if (upgrage_price == 0) {
sum_data = parseInt(sum_data / 10, 10) * 10;
}
$("#div_total_price").html(this.makePriceStr(default_price_extend));
$("#div_upgrade_price").html(this.makePriceStr(upgrage_price));
$("#div_total_tax").html(this.makePriceStr(price_tax));
$("#div_total").html(this.makePriceStr(sum_data));
var term_kind = $("._day_ck").find("[name='rdo_term_kind']:checked").val();
if (this.country === KOREA_COUNTRY_CODE && term_kind === 'non_extension' && $('#type').val() === 'upgrade') {
var next_regular_payment_price = parseInt(service_info.regular_payment_price, 10);
if (!isNaN(next_regular_payment_price) && next_regular_payment_price > 0) {
next_pay_price = next_regular_payment_price;
}
}
$("#regular_payment_price").html(this.makePriceStr(next_pay_price));
if (total_discount_amount.rate === 0) {
$("#div_discount_amount").hide();
$("#div_discount_amount").find('._discount_rate').text('');
$("#div_discount_amount").find('._discount_amount').text('');
} else {
$("#div_discount_amount").show();
$("#div_discount_amount").find('._discount_rate').text(`${total_discount_amount.rate}% 할인`);
$("#div_discount_amount").find('._discount_amount').text(`-${total_discount_amount.amount.toLocaleString()}원`);
}
if (PRICE.getCouponData() === null) {
$("#div_coupon_discount_amount").hide();
$("#div_discount_amount").find('._coupon_discount_amount').text('');
$("._coupon_description").hide();
} else {
$("#div_coupon_discount_amount").show();
$("#div_coupon_discount_amount").find('._coupon_discount_amount').text(coupon_discount_price ? `-${coupon_discount_price.toLocaleString()}원` : '0원');
$("._coupon_description").show();
}
if ( this.country == 'tw' ) {
this.checkLimit(sum_data);
}
},
drawPeriodSection : function(){
let period = "12개월";
switch ($("._day_ck").find("[name='rdo_term_kind']:checked").val()){
case "non_extension":
var next_period = parseInt(service_info.regular_payment_period, 10);
if (!isNaN(next_period) && next_period > 0) {
$("#regular_payment_period").html(getLocalizeString("설명_n개월", next_period, next_period + "개월"));
} else {
$("#regular_payment_period").html('12개월');
}
$("#select_promotion_code").removeClass('tw-hidden');
$("#view_select_promotion_code").addClass('tw-hidden');
break;
case "one_month":
$("#regular_payment_period").html('1개월');
$("#select_promotion_code").removeClass('tw-hidden');
$("#view_select_promotion_code").addClass('tw-hidden');
break;
case "three_month":
$("#regular_payment_period").html('3개월');
$("#select_promotion_code").removeClass('tw-hidden');
$("#view_select_promotion_code").addClass('tw-hidden');
break;
case "six_month":
$("#regular_payment_period").html('6개월');
$("#select_promotion_code").removeClass('tw-hidden');
$("#view_select_promotion_code").addClass('tw-hidden');
break;
case "one_year":
$("#regular_payment_period").html('12개월');
$("#select_promotion_code").removeClass('tw-hidden');
$("#view_select_promotion_code").addClass('tw-hidden');
break;
case "two_year":
$("#regular_payment_period").html('24개월');
$("#select_promotion_code").removeClass('tw-hidden');
$("#view_select_promotion_code").addClass('tw-hidden');
break;
case "coupon" :
$("#select_promotion_code").addClass('tw-hidden');
$("#view_select_promotion_code").removeClass('tw-hidden');
$("#view_select_promotion_code").html(`
무료
카드 등록에 실패했습니다.
' + '' + '