PageSourceSearch

https://clipa.com/wp-content/plugins/better-payment/assets/js/better-payment.min.js?ver=1781774152

js clipa.com collected 2026-09-24 09:36:43 UTC 11,330 bytes, 1 lines download raw bytes

1!function(t){"use strict";const e="payment_amount",{custom_texts:n}=betterPayment||{},a=n?.redirecting||"Redirecting";let r=n?.field_is_required||"field is required",i=n?.business_email_is_required||"Business Email is required",o=n?.payment_amount_field_is_required||"Payment Amount field is required",s=n?.minimum_amount_is_one||"Minimum amount is 1",m=n?.something_went_wrong||"Something went wrong";function l(t,e,n,a=!0){let m={status:!0,errors:[]},l=function(t,e,n){let a={status:!0,errors:[]};for(var i in e)if(e.hasOwnProperty(i)&&-1===n.indexOf(i)){let n=c(t[i],e[i]);if(!n.status)return a.errors.push(void 0!==n.error?n.error:`${i} ${r}!`),a.status=!1,a}return a}(n,e,["better_payment_page_id","better_payment_widget_id","return","action","security","cancel_return","payment_amount","primary_payment_amount"]);return m.status=void 0!==l.status?l.status:m.status,m.errors=void 0!==l.errors&&l.errors.constructor===Array?m.errors.concat(l.errors):m.errors,a&&!t.business_email&&(m.errors.push(`${i}!`),m.status=!1),void 0!==e.primary_payment_amount&&""!==e.primary_payment_amount||void 0!==e.primary_payment_amount_radio&&""!==e.primary_payment_amount_radio||(m.errors.push(`${o}!`),m.status=!1),void 0!==e.primary_payment_amount&&parseFloat(e.primary_payment_amount)<1&&(m.errors.push(`${s}!`),m.status=!1),m}function u(t){return void 0!==t.better_payment_payment_amount_enable&&"yes"===t.better_payment_payment_amount_enable}function p(t){let e="USD";return t.submit_actions.includes("paypal")?e=void 0!==t.better_payment_form_paypal_currency?t.better_payment_form_paypal_currency:e:t.submit_actions.includes("stripe")?e=void 0!==t.better_payment_form_stripe_currency?t.better_payment_form_stripe_currency:e:t.submit_actions.includes("paystack")&&(e=void 0!==t.better_payment_form_paystack_currency?t.better_payment_form_paystack_currency:e),e}function _(t="USD"){let e="$",n=betterPayment.currency_symbols;return t in n&&(e=n[t]),e}function c(t,e,n=""){let a=function(t){let e=!1;return t.length>1||(e=!(null===t.getAttribute("required")||""===t.getAttribute("required")),e)}(t),i={error:"",status:!0};if(t.length>1)return i;if(a){let a=t.placeholder;a=a.replace(" *",""),a||(a=t.name,a=a.replace("primary","").replace("_"," ").replace(/\b\w/g,t=>t.toUpperCase()));let o=n||`${a} ${r}!`;void 0!==e&&""!==e||(i.error=o,i.status=!1)}return i}t(document).on("click",".better-payment-paypal-bt",function(e){const n=t("#"+this.form.id),r=t(n);let i=l(t(this).data("paypal-info"),r.serializeObject(),this.form);if(t(this).attr("disabled",!0),void 0!==i.status&&!i.status)return e.preventDefault(),toastr.error(i.errors.length?i.errors[0]:`${m}!`),this.disabled=!1,!1;t(this).attr("disabled",!1),t(this).html(`${a} <span class="elementor-control-spinner">&nbsp;<i class="eicon-spinner eicon-animation-spin"></i>&nbsp;</span>`)}),t(document).on("click",".better-payment-stripe-bt",function(e){e.preventDefault();const n=t("#"+this.form.id),r=t(n),i=t(this),o=r.data("better-payment"),s=r.serializeObject();let u=l("",s,this.form,!1);if(void 0!==u.status&&!u.status)return e.preventDefault(),toastr.error(u.errors.length?u.errors[0]:`${m}!`),this.disabled=!1,!1;t(this).attr("disabled",!0),t.ajax({url:betterPayment.ajax_url,type:"post",data:{action:"better_payment_stripe_get_token",security:betterPayment.nonce,fields:s,setting_data:o},success:function(t){void 0!==t.data.stripe_data?(i.html(`${a} <span class="elementor-control-spinner">&nbsp;<i class="eicon-spinner eicon-animation-spin"></i>&nbsp;</span>`),Stripe(t.data.stripe_public_key).redirectToCheckout({sessionId:t.data.stripe_data}).then(function(t){})):(i.html("Stripe"),toastr.error(t.data)),i.attr("disabled",!1),i.html("Proceed to Payment")},error:function(){i.attr("disabled",!1),console.log("Something went wrong!"),i.html("Proceed to Payment")}})}),t(document).on("click",".better-payment-paystack-bt",function(e){e.preventDefault();const n=t("#"+this.form.id),r=t(n),i=t(this),o=r.data("better-payment"),s=r.serializeObject();let u=l("",s,this.form,!1);if(void 0!==u.status&&!u.status)return e.preventDefault(),toastr.error(u.errors.length?u.errors[0]:`${m}!`),this.disabled=!1,!1;t(this).attr("disabled",!0),t.ajax({url:betterPayment.ajax_url,type:"post",data:{action:"better_payment_paystack_get_token",security:betterPayment.nonce,fields:s,setting_data:o},success:function(t){void 0!==t.data.authorization_url?(i.html(`${a} <span class="elementor-control-spinner">&nbsp;<i class="eicon-spinner eicon-animation-spin"></i>&nbsp;</span>`),window.location.href=t.data.authorization_url):toastr.error(t.data),i.attr("disabled",!1)},error:function(){i.attr("disabled",!1),console.log("Something went wrong!")}})}),t(document).on("change",".bp-custom-payment-amount",function(e){let n=t(this).closest(".elementor-form").data("id"),a=this.form&&this.form.id?this.form.id:"";a=""==a&&""!=n?".elementor-element-"+n:"#"+a,document.querySelectorAll(a+' .bp-payment-amount-wrap input[type="radio"]').forEach(t=>{t.checked=!1}
1);let r=parseFloat(this.value);t(".bp-custom-payment-amount-quantity").length&&(r*=parseFloat(t(".bp-custom-payment-amount-quantity").val())),t(".bp-transaction-details-amount-text").text(r)}),t(document).on("click",".bp-form_pay-radio",function(e){const n=t(this);let a=parseFloat(n.val());if(""==a)return!1;n.closest("form").find(".bp-custom-payment-amount").val(a),t(".bp-custom-payment-amount-quantity").length&&(a*=parseInt(t(".bp-custom-payment-amount-quantity").val())),t(".bp-transaction-details-amount-text").text(a)}),t(window).on("elementor/frontend/init",()=>{const t=elementorModules.frontend.handlers.Base.extend({getDefaultSettings:function(){return{selectors:{form:".elementor-form"}}},getDefaultElements:function(){let t=this.getSettings("selectors"),e={};return e.$form=this.$element.find(t.form),e},bindEvents:function(){this.elements.$form.on("submit_success",this.handleFormAction)},handleFormAction:function(t,e){void 0!==e.data.better_stripe_data&&Stripe(e.data.better_stripe_data.stripe_public_key).redirectToCheckout({sessionId:e.data.better_stripe_data.stripe_data}).then(function(t){}),void 0!==e.data.better_paystack_data&&(void 0!==e.data.better_paystack_data.authorization_url?window.location.href=e.data.better_paystack_data.authorization_url:toastr.error(response.data))}});elementorFrontend.hooks.addAction("frontend/element_ready/form.default",e=>{elementorFrontend.elementsHandler.addHandler(t,{$element:e})}),"undefined"!=typeof elementor&&elementor.hooks.addAction("panel/open_editor/widget/form",function(t,n,a){elementor.hooks.addFilter("elementor_pro/forms/content_template/item",function(t,n,a){return void 0!==t.field_type&&t.field_type===e&&(t.field_type="html",t.field_html=function(t,n){let a=function(t,e){if(!u(t))return!1;return void 0!==t.better_payment_show_amount_list_enable&&"yes"===t.better_payment_show_amount_list_enable&&void 0!==e.bp_field_type&&("amount-list"===e.bp_field_type||"both"===e.bp_field_type)}(t,n),r=function(t,e){return!!u(t)&&void 0!==e.bp_field_type&&("input-field"===e.bp_field_type||"both"===e.bp_field_type)}(t,n),i="";return(a||r)&&(i+=`<label for="form-field-${e}" class="elementor-field-label">${n.field_label}</label>`,i+='<div class ="better-payment is-full-width">'),a&&(i+=function(t){if(void 0===t.better_payment_show_amount_list_items&&""===t.better_payment_show_amount_list_items)return;let e=_(p(t)),n=function(t){let e="left";return t.submit_actions.includes("paypal")?e=void 0!==t.better_payment_form_currency_alignment_paypal?t.better_payment_form_currency_alignment_paypal:e:t.submit_actions.includes("stripe")?e=void 0!==t.better_payment_form_currency_alignment_stripe?t.better_payment_form_currency_alignment_stripe:e:t.submit_actions.includes("paystack")&&(e=void 0!==t.better_payment_form_currency_alignment_paystack?t.better_payment_form_currency_alignment_paystack:e),e="left"===e||"right"===e?e:"left",e}(t),a="left"===n?e:"",r="right"===n?e:"",i="",o="";if(Array.isArray(t.better_payment_show_amount_list_items)){let e,n=t.better_payment_show_amount_list_items,s="";n.forEach(t=>{e=function(t="",e=!1){return`${t}${(1e3*Date.now()+1e3*Math.random()).toString(16).replace(/\./g,"").padEnd(14,"0")}${e?`.${Math.trunc(1e8*Math.random())}`:""}`}(),s=void 0!==t.better_payment_amount_val?parseFloat(t.better_payment_amount_val):"",o+=`\n                        <div class="bp-form__group pb-3">\n                            <input type="radio" value="${s}"\n                                id="bp_payment_amount-${e}" class="bp-form__control bp-form_pay-radio "\n                                name="primary_payment_amount_radio">\n                            <label for="bp_payment_amount-${e}">${a}${s}${r}</label>\n                        </div>\n                    `}),i+=`\n                    <div class="payment-form-layout">\n                        <div class="bp-payment-amount-wrap">\n                            ${o}\n                        </div>\n                    </div>\n                `}return i}(t)),r&&(i+=function(t,n){let a=_(p(t)),r=void 0!==n.bp_placeholder?n.bp_placeholder:"";return`  <div class="better-payment-field-advanced-layout field-
1primary_payment_amount elementor-repeater-item-form-field-payment_amount">\n                                            <div class="control has-icons-left">\n                                                ${`<input id="form-field-${e}" class="input is-medium required bp-custom-payment-amount bp-custom-payment-amount-el-integration" type="number" placeholder="${r}" name="form_fields[${e}]" required="required" min="${n.bp_field_min}" max="${n.bp_field_max}" value="">`}\n                                                <span class="icon is-medium is-left">\n                                                    <span class="bp-currency-symbol">${a}</span>\n                                                </span>\n                                            </div>\n                                        </div>\n                                    `}(t,n)),(a||r)&&(i+="</div>"),i}(a,t)),t},10,3)})}),t.fn.serializeObject=function(){var e={},n=this.serializeArray();return t.each(n,function(){e[this.name]?(e[this.name].push||(e[this.name]=[e[this.name]]),e[this.name].push(this.value||"")):e[this.name]=this.value||""}),e},toastr.options={timeOut:"2000",toastClass:"font-size-md",maxOpened:1},function(){const e=t(".bp-paypal-pending");if(!e.length)return;const n=e.data("order-id"),a=e.data("return-url");let r=0;const i=betterPayment.custom_texts&&betterPayment.custom_texts.paypal_payment_timeout?betterPayment.custom_texts.paypal_payment_timeout:"Payment verification timed out. Please contact support if your payment was charged.";function o(){e.addClass("bp-paypal-pending--timeout"),e.find(".bp-paypal-pending__heading").text(betterPayment.custom_texts&&betterPayment.custom_texts.paypal_timeout_heading?betterPayment.custom_texts.paypal_timeout_heading:"Verification timed out"),e.find(".bp-paypal-pending__sub").text(i)}const s=setInterval(function(){r++,t.post(betterPayment.ajax_url,{action:"better_payment_check_paypal_status",security:betterPayment.nonce,order_id:n},function(t){t.success&&"completed"===t.data.status?(clearInterval(s),window.location.href=a):r>=20&&(clearInterval(s),o())}).fail(function(){r>=20&&(clearInterval(s),o())})},3e3)}()}(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.