Server IP : 162.0.217.223 / Your IP : 216.73.216.150 Web Server : LiteSpeed System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : mypckeys ( 1539) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mypckeys/www/wp-content/plugins/woo-stripe-payment/assets/js/frontend/ |
Upload File : |
!function(a,e){function t(){this.elementStatus={},e.BaseGateway.call(this,wc_stripe_credit_card_params),e.CheckoutGateway.call(this),this.message_container=this.params.notice_selector,window.addEventListener("hashchange",this.hashchange.bind(this)),(e.credit_card=this).confirmedSetupIntent=!1,this.has3DSecureParams(),this.handle_create_account_change(),a(document.body).on("change",'[name="stripe_cc_saved_method_key"]',this.maybe_initialize_installments.bind(this)),a(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.maybe_initialize_installments.bind(this))}var i={focus:"focused",empty:"empty",invalid:"invalid"};(t.prototype=a.extend({},e.BaseGateway.prototype,e.CheckoutGateway.prototype)).mappings={cardNumber:"#stripe-card-number",cardExpiry:"#stripe-exp",cardCvc:"#stripe-cvv"},t.prototype.handleActionMethod="confirmCardPayment",t.prototype.setupActionMethod="confirmCardSetup",t.prototype.initialize=function(){a(document.body).on("click","#place_order",this.place_order.bind(this)),a(document.body).on("change","#createaccount",this.handle_create_account_change.bind(this)),this.setup_card(),this.has_gateway_data()&&this.can_create_setup_intent()&&this.create_setup_intent(),this.maybe_initialize_installments()},t.prototype.setup_card=function(){var e;this.is_custom_form()?(e=a.extend(!0,{classes:i},this.params.cardOptions),["cardNumber","cardExpiry","cardCvc"].forEach(function(t){this[t]=this.elements.create(t,a.extend(!0,{},e,this.params.customFieldOptions[t])),this.elementStatus[t]={},this[t].on("change",this.on_card_element_change.bind(this))}.bind(this)),this.cardNumber.on("change",this.card_number_change.bind(this)),this.cardNumber.on("change",this.on_input_change.bind(this)),this.cardExpiry.on("change",this.on_input_change.bind(this)),this.cardCvc.on("change",this.on_input_change.bind(this)),this.fields.required("billing_postcode")&&""!==this.fields.get("billing_postcode")&&0<a("#stripe-postal-code").length&&(a("#stripe-postal-code").val(this.fields.get("billing_postcode")),this.validate_postal_field()),a(document.body).on("change","#billing_postcode",function(t){var e=a("#billing_postcode").val();a("#stripe-postal-code").val(e).trigger("keyup")}.bind(this))):(this.card=this.elements.create("card",a.extend(!0,{},{value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode"),iconStyle:"default"},this.params.cardOptions)),a(document.body).on("change","#billing_postcode",function(t){this.card&&this.card.update({value:a("#billing_postcode").val()})}.bind(this)),this.elementStatus.card={},this.card.on("change",this.on_card_element_change.bind(this))),setInterval(this.create_card_element.bind(this),2e3)},t.prototype.validate_postal_field=function(){var t,e;a("#billing_postcode").length&&a("#stripe-postal-code").length?this.params.postal_regex[this.fields.get("billing_country")]?(e=this.params.postal_regex[this.fields.get("billing_country")],t=a("#stripe-postal-code").val(),e=new RegExp(e,"i"),""!==t?null!==e.exec(t)?a("#stripe-postal-code").addClass("StripeElement--complete").removeClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").addClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").removeClass("invalid")):0!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"):a("#stripe-postal-code").length&&(""!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"))},t.prototype.create_card_element=function(){this.is_custom_form()?a("#wc-stripe-cc-custom-form").length&&0==a("#wc-stripe-cc-custom-form").find("iframe").length&&(a(this.mappings.cardNumber).length&&(this.cardNumber.mount(this.mappings.cardNumber),a(this.mappings.cardNumber).prepend(this.params.html.card_brand)),a(this.mappings.cardExpiry).length&&this.cardExpiry.mount(this.mappings.cardExpiry),a(this.mappings.cardCvc).length&&this.cardCvc.mount(this.mappings.cardCvc),a("#stripe-postal-code").length)&&(a("#stripe-postal-code, .postalCode").on("focus",function(t){a("#stripe-postal-code").addClass("focused")}.bind(this)),a("#stripe-postal-code, .postalCode").on("blur",function(t){a("#stripe-postal-code").removeClass("focused").trigger("keyup")}.bind(this)),a("#stripe-postal-code").on("keyup",function(t){0==a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("empty"):a("#stripe-postal-code").removeClass("empty")}.bind(this)),a("#stripe-postal-code").on("change",this.validate_postal_field.bind(this)),a("#stripe-postal-code").trigger("change")):a("#wc-stripe-card-element").length&&0==a("#wc-stripe-card-element").find("iframe").length&&(this.card.unmount(),this.card.mount("#wc-stripe-card-element"),this.card.update({value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode")})),a(this.container).outerWidth(!0)<450?a(this.container).addClass("stripe-small-container"):a(this.container).removeClass("stripe-small-container")},t.prototype.place_order=function(t){if(this.is_gateway_selected())if(this.fields.syncCheckoutFieldsWithDOM(),this.can_create_setup_intent()&&!this.is_saved_method_selected()&&this.checkout_fields_valid()){if(t.preventDefault(),this.confirmedSetupIntent)return this.on_setup_intent_received(this.confirmedSetupIntent);this.stripe.confirmCardSetup(this.client_secret,{payment_method:{card:this.is_custom_form()?this.cardNumber:this.card,billing_details:function(){return this.is_current_page("checkout")?this.get_billing_details():a.extend({},this.is_custom_form()?{address:{postal_code:a("#stripe-postal-code").val()}}:{})}.bind(this)()}}).then(function(t){t.error?this.submit_card_error(t.error):(this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent))}.bind(this))}else this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.checkout_fields_valid()&&this.elements.submit().then(function(t){this.stripe.createPaymentMethod(this.get_create_payment_method_params()).then(function(t){if(t.error)return this.submit_card_error(t.error);this.is_current_page("order_pay")?(this.set_nonce(t.paymentMethod.id),this.process_order_pay()):this.on_token_received(t.paymentMethod)}.bind(this))}.bind(this)))},t.prototype.checkout_place_order=function(){return this.is_saved_method_selected()||this.payment_token_received?e.CheckoutGateway.prototype.checkout_place_order.apply(this,arguments):(this.place_order.apply(this,arguments),!1)},t.prototype.on_token_received=function(t){this.payment_token_received=!0,t.hasOwnProperty("id")?this.set_nonce(t.id):this.set_nonce(t),this.get_form().trigger("submit")},t.prototype.on_setup_intent_received=function(t){this.payment_token_received=!0,this.set_nonce(t.payment_method),this.set_intent(t.id),this.get_form().trigger("submit")},t.prototype.updated_checkout=function(t,e){this.create_card_element(),this.handle_create_account_change(),this.has_gateway_data()&&this.can_create_setup_intent()&&!this.client_secret&&this.create_setup_intent()},t.prototype.update_checkout=function(){this.clear_card_elements()},t.prototype.show_payment_button=function(){e.CheckoutGateway.prototype.show_place_order.apply(this,arguments)},t.prototype.hide_place_order=function(){},t.prototype.is_custom_form=function(){return"1"===this.params.custom_form},t.prototype.get_postal_code=function(){return this.is_custom_form()&&0<a("#stripe-postal-code").length?a("#stripe-postal-code").val():this.fields.get(this.get_billing_prefix()+"_postcode",null)},t.prototype.card_number_change=function(t){"unknown"===t.brand?a("#wc-stripe-card").removeClass("active"):a("#wc-stripe-card").addClass("active"),a("#wc-stripe-card").attr("src",this.params.cards[t.brand])},t.prototype.on_input_change=function(t){if(t.complete){var e=a("#wc-stripe-cc-custom-form").find(".StripeElement, #stripe-postal-code"),i=[],e=(e.each(function(t,e){i.push("#"+a(e).attr("id"))}.bind(this)),this.mappings[t.elementType]),s=i.indexOf(e);if("undefined"!=typeof i[s+1])if("#stripe-postal-code"===i[s+1])document.getElementById("stripe-postal-code").focus();else for(var n in this.mappings)this.mappings[n]===i[s+1]&&this[n].focus()}},t.prototype.clear_card_elements=function(){for(var t=["cardNumber","cardExpiry","cardCvc"],e=0;e<t.length;e++)this[t[e]]&&this[t[e]].clear()},t.prototype.checkout_error=function(){this.is_gateway_selected()&&(this.payment_token_received=!1),e.CheckoutGateway.prototype.checkout_error.call(this)},t.prototype.get_billing_details=function(){var t=e.BaseGateway.prototype.get_billing_details.call(this);return t.address.postal_code=this.get_postal_code(),t},t.prototype.can_create_setup_intent=function(){return this.is_add_payment_method_page()||this.is_change_payment_method()||this.is_current_page("checkout")&&this.cart_contains_subscription()&&this.has_gateway_data()&&0==this.get_total_price_cents()||this.is_current_page(["checkout","product"])&&"undefined"!=typeof wc_stripe_preorder_exists||this.is_current_page("order_pay")&&"pre_order"in this.get_gateway_data()&&!0===this.get_gateway_data().pre_order||this.is_current_page("product")&&0==this.get_total_price_cents()},t.prototype.submit_card_error=function(t){"bcf"===this.params.notice_location&&(a(".wc-stripe-card-notice").remove(),a(".wc-stripe_cc-new-method-container").append('<div class="wc-stripe-card-notice"></div>')),e.BaseGateway.prototype.submit_error.call(this,t,!0)},t.prototype.container_styles=function(){e.CheckoutGateway.prototype.container_styles.apply(this,arguments),this.is_custom_form()&&a(this.container).find(".payment_box").addClass("custom-form__"+this.params.custom_form_name)},t.prototype.checkout_fields_valid=function(){var t=this.is_valid_checkout();return t||this.submit_error(this.params.messages.terms),t},t.prototype.is_installments_available=function(){var t=this.get_gateway_data();return!!t&&!!t.installments.enabled},t.prototype.update_element_status=function(t){this.elementStatus[t.elementType]=t},t.prototype.is_card_form_complete=function(){return Object.keys(this.elementStatus).filter(function(t){return!!this.elementStatus[t].complete}.bind(this)).length==Object.keys(this.elementStatus).length},t.prototype.on_card_element_change=function(t){this.update_element_status(t),this.is_current_page(["checkout","order_pay"])&&this.is_card_form_complete()&&this.is_installments_available()&&this.initialize_installments()},t.prototype.initialize_installments=function(t){this.installmentTimeoutId&&clearTimeout(this.installmentTimeoutId),this.installmentTimeoutId=setTimeout(function(t){t?(this.show_installment_loader(),this.fetch_installment_plans(t)["finally"](function(){this.hide_installment_loader()}.bind(this))):this.elements.submit().then(function(){this.stripe.createPaymentMethod(this.get_create_payment_method_params()).then(function(t){t.error?this.hide_installment_loader():(this.show_installment_loader(),this.fetch_installment_plans(t.paymentMethod.id)["finally"](function(){this.hide_installment_loader()}.bind(this)))}.bind(this))["catch"](this.hide_installment_loader.bind(this))}.bind(this))}.bind(this,t),250)},t.prototype.fetch_installment_plans=function(t){return this.fetch_payment_intent(t).then(function(t){t.installments_html&&a(".wc-stripe-installment-container").replaceWith(t.installments_html)}.bind(this))["catch"](function(t){return this.submit_card_error(t)}.bind(this))["finally"](function(){}.bind(this))},t.prototype.fetch_payment_intent=function(n){return new Promise(function(e,i){var t=this.params.routes.create_payment_intent,s=!1;this.is_current_page("order_pay")&&(t=this.params.routes.order_create_payment_intent,s=!0),a.ajax({url:t,method:"POST",dataType:"json",data:s?{payment_method_id:n,payment_method:this.gateway_id,order_id:this.get_gateway_data().order.id,order_key:this.get_gateway_data().order.key}:a.extend({},this.serialize_fields(),{payment_method_id:n,payment_method:this.gateway_id,page_id:this.get_page()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?i:e)(t)}.bind(this)).fail(function(t){i()}.bind(this))}.bind(this))},t.prototype.show_installment_loader=function(){a(".wc-stripe-installment-options").addClass("loading-installments"),a('[name="_stripe_installment_plan"] option:selected').eq(0).text(this.params.installments.loading),a(".wc-stripe-installment-loader").show()},t.prototype.hide_installment_loader=function(t){a(".wc-stripe-installment-options").removeClass("loading-installments"),a(".wc-stripe-installment-loader").hide()},t.prototype.maybe_initialize_installments=function(){this.is_installments_available()&&this.is_saved_method_selected()&&this.initialize_installments(this.get_selected_payment_method())},t.prototype.get_element_options=function(){return this.params.elementOptions},t.prototype.get_create_payment_method_params=function(){return{type:"card",card:this.is_custom_form()?this.cardNumber:this.card,billing_details:this.get_billing_details()}},new t}(jQuery,window.wc_stripe);