Файловый менеджер - Редактировать - /var/www/html/media/com_osmembership/assets/js/paymentmethods.min.js
Ðазад
function PaymentMethod(t,e,a,n,o){this.name=t,this.creditCard=e,this.cardType=a,this.cardCvv=n,this.cardHolderName=o}function PaymentMethods(){this.length=0,this.methods=[]}function stripeTokenHandler(t){var e=document.getElementById("os_form"),a=document.createElement("input");a.setAttribute("type","hidden"),a.setAttribute("name","stripeToken"),a.setAttribute("value",t.id),e.appendChild(a),e.submit()}PaymentMethod.prototype.getName=function(){return this.name},PaymentMethod.prototype.getCreditCard=function(){return this.creditCard},PaymentMethod.prototype.getCardType=function(){return this.cardType},PaymentMethod.prototype.getCardCvv=function(){return this.cardCvv},PaymentMethod.prototype.getCardHolderName=function(){return this.cardHolderName},PaymentMethods.prototype.Add=function(t){this.methods[this.length]=t,this.length=this.length+1},PaymentMethods.prototype.Find=function(t){for(var e=0;e<this.length;e++)if(this.methods[e].name==t)return this.methods[e];return null},OSMMaskInputs=function(t){t.querySelectorAll("input[data-input-mask]").forEach(function(t){var e=t.dataset.inputMask;"/"===e.slice(0,1)&&"/"===e.slice(-1)&&(e=(e=e.slice(1)).slice(0,-1),e=new RegExp(e));IMask(t,{mask:e})})},function(s){stripeResponseHandler=function(t,e){var a=s("#os_form");if(e.error)"card_error"==e.error.type&&"undefined"!=typeof osmStripeErrors&&osmStripeErrors[e.error.code]&&(e.error.message=osmStripeErrors[e.error.code]),alert(e.error.message),a.find("#btn-submit").prop("disabled",!1);else{var n=e.id;s("#x_card_num").val(""),s("#x_card_code").val(""),s("#card_holder_name").val(""),a.append(s('<input type="hidden" name="stripeToken" />').val(n)),a.get(0).submit()}},OSMVALIDATEFORM=function(t){var e=Joomla.getOptions("maxErrorsPerField");s(t).validationEngine("attach",{maxErrorsPerField:e,onValidationComplete:function(t,e){return 1==e&&(t.on("submit",function(t){t.preventDefault()}),!0)}})},changePaymentMethod=function(){updatePaymentMethod(),1==document.os_form.show_payment_fee.value&&calculateSubscriptionFee()},updatePaymentMethod=function(){var t;document.os_form;t=s("input:radio[name^=payment_method]").length?s('input:radio[name="payment_method"]:checked').val():s('input[name="payment_method"]').val(),method=methods.Find(t),method&&(method.getCreditCard()?(s("#tr_card_number").show(),s("#tr_exp_date").show(),s("#tr_cvv_code").show(),method.getCardHolderName(),s("#tr_card_holder_name").show()):(s("#tr_card_number").hide(),s("#tr_exp_date").hide(),s("#tr_cvv_code").hide(),s("#tr_card_holder_name").hide()),"undefined"!=typeof stripe&&(0===t.indexOf("os_stripe")?s("#stripe-card-form").show():s("#stripe-card-form").hide()),0===t.indexOf("os_squarecard")?s("#square-card-form").show():s("#square-card-form").hide(),MPShowPaymentMethodFields(t),document.dispatchEvent(new CustomEvent("OSMPaymentMethodChanged",{detail:{paymentMethod:t}})))},MPShowPaymentMethodFields=function(t){var e,a=Joomla.getOptions("mp_all_payment_method_fields",[]),n=Joomla.getOptions("mp_"+t+"_fields",[]);a.forEach(function(t){-1===n.indexOf(t)&&(e=document.getElementById("field_"+t))&&(e.style.display="none")}),n.forEach(function(t){(e=document.getElementById("field_"+t))&&(e.style.display="")})},calculateSubscriptionFee=function(){var t,i=s("#btn-submit"),_=s("#ajax-loading-animation");void 0!==(t=s("input:radio[name^=payment_method]").length?s('input:radio[name="payment_method"]:checked').val():s('input[name="payment_method"]').val())&&(i.attr("disabled","disabled"),_.show(),s.ajax({type:"POST",url:siteUrl+"index.php?option=com_osmembership&task=register.calculate_subscription_fee&payment_method="+t+langLinkForAjax,data:s("#os_form input[name='plan_id'], #os_form input[name='coupon_code'], #os_form select[name='country'], #os_form select[name='state'], #os_form input.taxable[type='text'], #os_form input[name='coupon_code'], #os_form input[name='act'], #os_form input[name='renew_option_id'], #os_form input[name='upgrade_option_id'], #os_form .payment-calculation input[type='text'], #os_form .payment-calculation input[type='number'], #os_form .payment-calculation input[type='range'], #os_form .payment-calculation input[type='checkbox']:checked, #os_form .payment-calculation input[type='radio']:checked, #os_form .payment-calculation select"),dataType:"json",success:function(t){var e=s("#amount"),a=s("#payment-terms"),n=s("#trial_amount"),o=s("#vat_country_code");i.removeAttr("disabled"),_.hide(),void 0!==t.setup_fee_formatted?s("#setup_fee").val(t.setup_fee_formatted):s("#setup_fee").val(t.setup_fee),e.length&&(void 0!==t.amount_formatted?e.val(t.amount_formatted):e.val(t.amount),void 0!==t.discount_amount_formatted?s("#discount_amount").val(t.discount_amount_formatted):s("#discount_amount").val(t.discount_amount),void 0!==t.tax_amount_formatted?s("#tax_amount").val(t.tax_amount_formatted):s("#tax_amount").val(t.tax_amount),t.tax_amount,s("#osm-tax-amount-container").show(),void 0!==t.payment_processing_fee_formatted?s("#payment_processing_fee").val(t.payment_processing_fee_formatted):s("#payment_processing_fee").val(t.payment_processing_fee),void 0!==t.gross_amount_formatted?s("#gross_amount").val(t.gross_amount_formatted):s("#gross_amount").val(t.gross_amount)),a.length&&(a.html(t.payment_terms),n.length&&(void 0!==t.trial_amount_formatted?n.val(t.trial_amount_formatted):n.val(t.trial_amount),void 0!==t.trial_discount_amount_formatted?s("#trial_discount_amount").val(t.trial_discount_amount_formatted):s("#trial_discount_amount").val(t.trial_discount_amount),0<t.trial_discount_amount?s("#trial_discount_amount_container").show():s("#trial_discount_amount_container").hide(),void 0!==t.trial_tax_amount_formatted?s("#trial_tax_amount").val(t.trial_tax_amount_formatted):s("#trial_tax_amount").val(t.trial_tax_amount),0<t.trial_tax_amount?s("#trial_tax_amount_container").show():s("#trial_tax_amount_container").hide(),void 0!==t.trial_payment_processing_fee_formatted?s("#trial_payment_processing_fee").val(t.trial_payment_processing_fee_formatted):s("#trial_payment_processing_fee").val(t.trial_payment_processing_fee),0<t.trial_payment_processing_fee?s("#trial_payment_processing_fee_container").show():s("#trial_payment_processing_fee_container").hide(),void 0!==t.trial_gross_amount_formatted?s("#trial_gross_amount").val(t.trial_gross_amount_formatted):s("#trial_gross_amount").val(t.trial_gross_amount),0<t.trial_discount_amount||0<t.trial_tax_amount||0<t.trial_payment_processing_fee?s("#trial_gross_amount_container").show():s("#trial_gross_amount_container").hide()),void 0!==t.regular_amount_formatted?s("#regular_amount").val(t.regular_amount_formatted):s("#regular_amount").val(t.regular_amount),void 0!==t.regular_discount_amount_formatted?s("#regular_discount_amount").val(t.regular_discount_amount_formatted):s("#regular_discount_amount").val(t.regular_discount_amount),0<t.regular_discount_amount?s("#regular_discount_amount_container").show():s("#regular_discount_amount_container").hide(),void 0!==t.regular_tax_amount_formatted?s("#regular_tax_amount").val(t.regular_tax_amount_formatted):s("#regular_tax_amount").val(t.regular_tax_amount),0<t.regular_tax_amount?s("#regular_tax_amount_container").show():s("#regular_tax_amount_container").hide(),void 0!==t.regular_payment_processing_fee_formatted?s("#regular_payment_processing_fee").val(t.regular_payment_processing_fee_formatted):s("#regular_payment_processing_fee").val(t.regular_payment_processing_fee),0<t.regular_payment_processing_fee?s("#regular_payment_processing_fee_container").show():s("#regular_payment_processing_fee_container").hide(),void 0!==t.regular_gross_amount_formatted?s("#regular_gross_amount").val(t.regular_gross_amount_formatted):s("#regular_gross_amount").val(t.regular_gross_amount),0<t.regular_discount_amount||0<t.regular_tax_amount||0<t.regular_payment_processing_fee?s("#regular_gross_amount_container").show():s("#regular_gross_amount_container").hide()),o.length&&("GR"==t.country_code?o.text("EL"):o.text(t.country_code));var r=s("input[name^=vat_number_field]").val();r&&(1==t.show_vat_number_field?s("#field_"+r).show():s("#field_"+r).hide()),0==t.show_payment_information?s(".payment_information").css("display","none"):(s(".payment_information:not(.mp-credit-card-input)").css("display",""),updatePaymentMethod()),1==t.coupon_valid?s("#coupon_validate_msg").hide():s("#coupon_validate_msg").show(),1==t.vatnumber_valid?s("#vatnumber_validate_msg").hide():s("#vatnumber_validate_msg").show(),document.dispatchEvent(new CustomEvent("onOSMAfterCalculationFee",{detail:t}))},error:function(t,e){alert(e)}}))},showHideDependFields=function(t){var o=s("#btn-submit"),r=s("#ajax-loading-animation");o.attr("disabled","disabled"),o.show(),s.ajax({type:"POST",url:siteUrl+"index.php?option=com_osmembership&task=register.get_depend_fields_status&field_id="+t+langLinkForAjax,data:s(".master-field input[type='checkbox']:checked, .master-field input[type='radio']:checked, .master-field select"),dataType:"json",success:function(t){o.removeAttr("disabled"),r.hide();var e,a=[],n=[];for(0<t.hide_fields.length&&(a=t.hide_fields.split(",")),0<t.show_fields.length&&(n=t.show_fields.split(",")),e=0;e<a.length;e++)s("#"+a[e]).hide();for(e=0;e<n.length;e++)s("#"+n[e]).show();calculateSubscriptionFee()},error:function(t,e){alert(e)}})},buildStateField=function(e,a,t){if(s("#"+e).length&&s("#"+e).is("select")){if(s("#"+a).length)var n=s("#"+a).val();else n="";s.ajax({type:"GET",url:siteUrl+"index.php?option=com_osmembership&task=register.get_states&country_name="+n+"&field_name="+e+"&state_name="+t+langLinkForAjax,success:function(t){s("#field_"+e+" .controls").length?s("#field_"+e+" .controls").html(t):s("#field_"+e+" .col-md-9").length?s("#field_"+e+" .col-md-9").html(t):s("#field_"+e+" .uk-form-controls").html(t),"undefined"!=typeof taxStateCountries&&"state"==e&&taxStateCountries[0]&&s("#state").change(function(){if(s("#"+a).length)var t=s("#country").val();else t=s("#default_country").val();t&&-1!=s.inArray(t,taxStateCountries)&&calculateSubscriptionFee()})},error:function(t,e){alert(e)}}),s("#"+a).length&&s("#"+a).change(function(){s.ajax({type:"GET",url:siteUrl+"index.php?option=com_osmembership&task=register.get_states&country_name="+s(this).val()+"&field_name="+e+"&state_name="+t+langLinkForAjax,success:function(t){s("#field_"+e+" .controls").length?s("#field_"+e+" .controls").html(t):s("#field_"+e+" .col-md-9").length?s("#field_"+e+" .col-md-9").html(t):s("#field_"+e+" .uk-form-controls").html(t),"undefined"!=typeof taxStateCountries&&"state"==e&&taxStateCountries[0]&&s("#state").change(function(){if(s("#country").length)var t=s("#country").val();else t="";t&&-1!=s.inArray(t,taxStateCountries)&&calculateSubscriptionFee()})},error:function(t,e){alert(e)}}),0!=(paymentMethod=s("input[name^=country_base_tax]").val())&&calculateSubscriptionFee()})}else s("#"+a).length&&s("#"+a).change(function(){0!=(paymentMethod=s("input[name^=country_base_tax]").val())&&calculateSubscriptionFee()})},buildStateFields=function(e,t,a){var n=s("#"+t),o=s("#"+e);o.length&&o.is("select")?n.length&&n.change(function(){s.ajax({type:"GET",url:siteUrl+"index.php?option=com_osmembership&task=register.get_states&country_name="+s(this).val()+"&field_name="+e+"&state_name="+a+langLinkForAjax,success:function(t){s("#field_"+e+" .controls").length?s("#field_"+e+" .controls").html(t):s("#field_"+e+" .col-md-9").length?s("#field_"+e+" .col-md-9").html(t):s("#field_"+e+" .uk-form-controls").html(t),"undefined"!=typeof taxStateCountries&&"state"==e&&taxStateCountries[0]&&s("#state").change(function(){var t;(t=s("#country").length?s("#country").val():"")&&-1!=s.inArray(t,taxStateCountries)&&calculateSubscriptionFee()})},error:function(t,e){alert(e)}}),0!=(paymentMethod=s("input[name^=country_base_tax]").val())&&calculateSubscriptionFee()}):n.length&&n.change(function(){0!=s("input[name^=country_base_tax]").val()&&calculateSubscriptionFee()})}}(jQuery);
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка