Viewing File: /home/fshjisk/myqueen/wp-content/plugins/woo-stripe-payment/assets/js/frontend/local-payment.min.js
!function(n,i){function o(t){i.BaseGateway.call(this,t),i.CheckoutGateway.call(this),n(document.body).on("click","#place_order",this.place_order.bind(this)),this.is_current_page("order_pay")&&n("#order_review").on("submit",this.process_order_pay.bind(this)),this.maybe_hide_gateway()}function t(t){this.elementType="idealBank",this.confirmation_method="confirmIdealPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function e(t){this.elementType="p24Bank",this.confirmation_method="confirmP24Payment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function s(t){this.elementType="iban",this.confirmation_method="confirmSepaDebitPayment",this.setupActionMethod="confirmSepaDebitSetup",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function r(t){this.confirmation_method="confirmKlarnaPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function a(t){this.elementType="fpxBank",this.confirmation_method="confirmFpxPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function h(t){o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function p(t){this.elementType="auBankAccount",this.confirmation_method="confirmAuBecsDebitPayment",this.setupActionMethod="confirmAuBecsDebitSetup",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function c(t){this.confirmation_method="confirmGrabPayPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function _(t){this.confirmation_method="confirmAfterpayClearpayPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function d(t){this.confirmation_method="confirmBoletoPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function m(t){this.confirmation_method="confirmOxxoPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function l(t){this.confirmation_method="confirmGiropayPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function y(t){this.confirmation_method="confirmBancontactPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function u(t){this.elementType="epsBank",this.confirmation_method="confirmEpsPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function f(t){this.confirmation_method="confirmAlipayPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function g(t){this.confirmation_method="confirmSofortPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}(o.prototype=n.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).initialize=function(){this.mount_button()},o.prototype.elementType=null,o.prototype.is_active=function(){return n("#wc_stripe_local_payment_"+this.gateway_id).data("active")},o.prototype.maybe_hide_gateway=function(){this.is_active()?n(this.container).show():(n(this.container).hide(),this.is_gateway_selected()&&n('li[class*="payment_method_stripe_"]').filter(":visible").eq(0).find('[name="payment_method"]').prop("checked",!0).trigger("click"))},o.prototype.createSource=function(){return new Promise(function(e,t){var i=function(t){t.error?this.submit_error(t.error):(this.payment_token_received=!0,this.set_nonce(t.source.id),this.get_form().trigger("submit")),e()}.bind(this);if(null!=this.elementType)if(this.confirmation_method)if(this.confirmation_obj)this.processConfirmation(this.confirmation_obj);else{if(!this.isValidElement())return this.submit_error({code:"empty_element_"+this.params.local_payment_type,message:wc_stripe_messages.empty_element});this.payment_token_received=!0,this.get_form().trigger("submit")}else this.stripe.createSource(this.element,this.getSourceArgs()).then(i)["catch"](function(t){this.submit_error(t.message)}.bind(this));else this.payment_token_received=!0,this.get_form().trigger("submit")}.bind(this))},o.prototype.place_order=function(t){this.is_gateway_selected()&&(this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.is_change_payment_method()?this.process_setup_intent():this.createSource()))},o.prototype.process_setup_intent=function(){this.block(),this.create_setup_intent().then(function(){this.stripe[this.setupActionMethod](this.client_secret,this.get_confirmation_args()).then(function(t){if(t.error)return this.submit_error(t.error.message);this.set_nonce(t.setupIntent.payment_method),this.set_intent(t.setupIntent.id),this.payment_token_received=!0,this.get_form().trigger("submit")}.bind(this))}.bind(this))["catch"](function(t){this.submit_error(t)}.bind(this))["finally"](function(){this.unblock()}.bind(this))},o.prototype.checkout_place_order=function(t){return this.is_saved_method_selected()||this.payment_token_received?i.CheckoutGateway.prototype.checkout_place_order.apply(this,arguments):(this.place_order.apply(this,arguments),!1)},o.prototype.process_order_pay=function(t){this.is_gateway_selected()&&(t.preventDefault(),i.CheckoutGateway.prototype.process_order_pay.apply(this,arguments))},o.prototype.show_payment_button=function(){this.show_place_order()},o.prototype.hide_place_order=function(){},o.prototype.show_place_order=function(){i.CheckoutGateway.prototype.show_place_order.apply(this,arguments),this.payment_token_received&&n("#place_order").text(n("#place_order").data("value"))},o.prototype.getSourceArgs=function(){return{type:this.params.local_payment_type,amount:this.get_total_price_cents(),currency:this.get_currency(),owner:{name:this.get_customer_name(this.get_billing_prefix()),email:this.fields.get("billing_email",null)},redirect:{return_url:this.params.return_url}}},o.prototype.updated_checkout=function(){this.mount_button(),this.maybe_hide_gateway()},o.prototype.mount_button=function(){var t="#wc_stripe_local_payment_"+this.gateway_id;n(t).length&&null!=this.elementType&&(n(t).empty(),this.element||(this.element=this.elements.create(this.elementType,this.params.element_params),this.element.on("change",this.handleElementChange.bind(this))),this.elementEmpty=!0,this.element.mount(t))},o.prototype.handleElementChange=function(t){this.elementEmpty=t.empty},o.prototype.load_external_script=function(t){var e=document.createElement("script");e.type="text/javascript",e.src=t,e.onload=function(){this.script_loaded=!0}.bind(this),document.body.appendChild(e)},o.prototype.hashChange=function(t){var e;!this.is_gateway_selected()||(e=window.location.hash.match(/response=(.*)/))&&(history.pushState({},"",window.location.pathname),e=JSON.parse(window.atob(decodeURIComponent(e[1]))),this.processConfirmation(e))},o.prototype.handle_next_action=function(t){this.processConfirmation(t)},o.prototype.processConfirmation=function(i){"payment_intent"===i.type?this.stripe[this.confirmation_method](i.client_secret,this.get_confirmation_args(i)).then(function(t){if(t.error)return this.confirmation_obj=i,this.payment_token_received=!1,this.submit_error(t.error.message);var e=decodeURI(i.order_received_url);"processing"===t.paymentIntent.status&&(e+="&"+n.param({_stripe_local_payment:this.gateway_id,payment_intent:t.paymentIntent.id,payment_intent_client_secret:t.paymentIntent.client_secret})),window.location.href=decodeURI(e)}.bind(this)):this.stripe[this.setupActionMethod](i.client_secret,this.get_confirmation_args(i)).then(function(t){return t.error?this.submit_error(t.error.message):(this.set_nonce(t.setupIntent.payment_method),this.set_intent(t.setupIntent.id),this.process_payment(i.order_id,i.order_key))}.bind(this))},o.prototype.get_confirmation_args=function(t){t=void 0===t?{}:t;t={payment_method:{billing_details:this.get_billing_details()},return_url:t.return_url};return this.elementType&&(t.payment_method[this.params.local_payment_type]=this.element),t},o.prototype.isValidElement=function(){return!this.element||!this.elementEmpty},o.prototype.delete_order_source=function(){return new Promise(function(e,t){n.ajax({url:this.params.routes.delete_order_source,method:"DELETE",dataType:"json",beforeSend:this.ajax_before_send.bind(this)}).done(function(t){e(t)}.bind(this)).fail(function(){t()}.bind(this))}.bind(this))},o.prototype.update_source=function(i){return new Promise(function(e,t){this.updateSourceXhr&&this.updateSourceXhr.abort(),this.updateSourceXhr=n.ajax({url:this.params.routes.update_source,method:"POST",dataType:"json",data:{_wpnonce:this.params.rest_nonce,updates:i,source_id:this.source.id,client_secret:this.source.client_secret,payment_method:this.gateway_id}}).done(function(t){e(t.source)}.bind(this)).fail(function(){t()})}.bind(this))},h.prototype.updated_checkout=function(){!this.script_loaded&&n(this.container).length&&this.load_external_script(this.params.qr_script),o.prototype.updated_checkout.apply(this,arguments)},h.prototype.hashChange=function(t){var e;!this.is_gateway_selected()||(e=window.location.hash.match(/qrcode=(.*)/))&&(history.pushState({},"",window.location.pathname),this.qrcode=JSON.parse(window.atob(decodeURIComponent(e[1]))),this.get_form().unblock().removeClass("processing").addClass("wechat"),new QRCode("wc_stripe_local_payment_stripe_wechat",{text:this.qrcode.code,width:parseInt(this.params.qr_size),height:parseInt(this.params.qr_size),colorDark:"#424770",colorLight:"#f8fbfd",correctLevel:QRCode.CorrectLevel.H}),n("#wc_stripe_local_payment_stripe_wechat").append('<p class="qrcode-message">'+this.params.qr_message+"</p>"),this.payment_token_received=!0,this.show_place_order())},h.prototype.place_order=function(t){this.qrcode&&this.payment_token_received?(t.preventDefault(),window.location=this.qrcode.redirect):o.prototype.place_order.apply(this,arguments)},_.prototype.is_currency_supported=function(){return-1<this.params.currencies.indexOf(this.get_currency())},_.prototype.updated_checkout=function(){this.maybe_hide_gateway(),this.has_gateway_data()&&this.is_currency_supported()&&(this.add_eligibility(this.container,parseFloat(this.get_total_price())),this.elements=this.stripe.elements(this.get_element_options()),this.initialize_messaging())},_.prototype.initialize=function(){this.has_gateway_data()&&this.is_currency_supported()&&(this.add_eligibility(this.container,parseFloat(this.get_total_price())),this.initialize_messaging())},_.prototype.initialize_messaging=function(){this.msgElement=this.elements.create("afterpayClearpayMessage",n.extend({},this.params.msg_options,{amount:this.get_total_price_cents(),currency:this.get_currency()})),this.mount_message()},_.prototype.mount_message=function(t){t&&this.msgElement.update({amount:this.get_total_price_cents(),currency:this.get_currency()}),n('label[for="payment_method_stripe_afterpay"]').find("#wc-stripe-afterpay-msg").length||n('label[for="payment_method_stripe_afterpay"]').append('<div id="wc-stripe-afterpay-msg"></div>'),this.msgElement.mount("#wc-stripe-afterpay-msg")},_.prototype.add_eligibility=function(t,e){i.Afterpay.prototype.add_eligibility.apply(this,arguments),this.is_eligible(e)||n(this.container).find(".wc-stripe-afterpay__offsite").addClass("afterpay-ineligible")},d.prototype.get_confirmation_args=function(t){t=o.prototype.get_confirmation_args.call(this,t);return t.payment_method.boleto={tax_id:this.get_tax_id()},t},d.prototype.createSource=function(){var t=this.get_tax_id();if(!t||!t.match(/^(\w{3}\.){2}\w{3}-\w{2}$|^(\w{11}|\w{14})$|^\w{2}\.\w{3}\.\w{3}\/\w{4}-\w{2}$/))return this.submit_error({code:"incomplete_boleto_tax_id"});this.payment_token_received=!0,this.get_form().trigger("submit")},d.prototype.get_tax_id=function(){return n("#wc_stripe_boleto_tax_id").val()},s.prototype.updated_checkout=function(t){o.prototype.updated_checkout.apply(this,arguments);var e=n('[name="billing_country"]').val();e&&this.element&&this.element.update({placeholderCountry:e})},g.prototype.get_confirmation_args=function(){var t=o.prototype.get_confirmation_args.apply(this,arguments);return t.payment_method.sofort={country:t.payment_method.billing_details.address.country},t},t.prototype=n.extend({},o.prototype,t.prototype),e.prototype=n.extend({},o.prototype,e.prototype),s.prototype=n.extend({},o.prototype,s.prototype),r.prototype=n.extend({},o.prototype,r.prototype),a.prototype=n.extend({},o.prototype,a.prototype),h.prototype=n.extend({},o.prototype,h.prototype),p.prototype=n.extend({},o.prototype,p.prototype),c.prototype=n.extend({},o.prototype,c.prototype),_.prototype=n.extend({},o.prototype,i.Afterpay.prototype,_.prototype),d.prototype=n.extend({},o.prototype,d.prototype),m.prototype=n.extend({},o.prototype,m.prototype),l.prototype=n.extend({},o.prototype,l.prototype),y.prototype=n.extend({},o.prototype,y.prototype),u.prototype=n.extend({},o.prototype,u.prototype),f.prototype=n.extend({},o.prototype,f.prototype),g.prototype=n.extend({},o.prototype,g.prototype);var w,b={ideal:t,p24:e,sepa_debit:s,klarna:r,fpx:a,wechat:h,au_becs_debit:p,grabpay:c,afterpay_clearpay:_,boleto:d,oxxo:m,giropay:l,bancontact:y,eps:u,alipay:f,sofort:g};for(w in wc_stripe_local_payment_params.gateways){var v=wc_stripe_local_payment_params.gateways[w];new(b[v.local_payment_type]||o)(v)}}(jQuery,window.wc_stripe);
Back to Directory
File Manager