# better-payment/2.2.2/assets/js/common.min.js

Better Payment – Instant Payments, Donations, Fundraising with Subscriptions &amp; More, version 2.2.2. 1 lines.

- Page: https://pluginprobe.com/plugins/better-payment/2.2.2/code/assets/js/common.min.js
- Raw: https://pluginprobe.com/plugins/better-payment/2.2.2/raw/assets/js/common.min.js
- Modified: 2025-06-30T10:06:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/better-payment/2.2.2/code/assets/js/common.min.js#L10-L20`.

```javascript
!function(t){function e(){t(".better-payment-user-dashboard-sidebar").fadeOut(500),t(".better-payment .bp-overlay").fadeOut()}t(document).on("change",".better-payment .payment-form-layout-3 .payment-method-checkbox input",function(){if(this.checked){t(".better-payment .payment-form-layout-3 .payment-method-checkbox").removeClass("active"),t(this).parent().addClass("active"),t(".better-payment .payment-form-layout-3 .payment-method-checkbox input").removeAttr("checked"),t(this).attr("checked",!0);let e="better-payment-paypal-bt",a="better-payment-stripe-bt",n="better-payment-paystack-bt",o=t(this).hasClass("layout-payment-method-paypal")?e:a;o=t(this).hasClass("layout-payment-method-paystack")?n:o,t(".better-payment ."+e+", .better-payment ."+a+", .better-payment ."+n).addClass("is-hidden"),t(".better-payment ."+o).removeClass("is-hidden")}}),t(document).on("change",".better-payment .payment-form-layout-1 .payment-method-checkbox input, .better-payment .payment-form-layout-2 .payment-method-checkbox input, .better-payment .payment-method-item input",function(e){if(this.checked){let e="better-payment-paypal-bt",a="better-payment-stripe-bt",n="better-payment-paystack-bt",o=t(this).hasClass("layout-payment-method-paypal")?e:a;o=t(this).hasClass("layout-payment-method-paystack")?n:o,t(".better-payment ."+e+", .better-payment ."+a+", .better-payment ."+n).addClass("is-hidden"),t(".better-payment ."+o).removeClass("is-hidden")}}),t(document).on("click",".better-payment .bp-modal-button",function(e){e.preventDefault();let a=t(this).attr("data-targetwrap");t("."+a+" .modal").addClass("is-active")}),t(document).on("click",".better-payment .modal-background, .better-payment .modal-close, .better-payment .delete, .better-payment .bp-modal .cancel-button",function(e){e.preventDefault();let a=t(this).closest(".bp-modal .modal");t(a).removeClass("is-active")}),t(document).on("click",".better-payment .user-dashboard-sidebar .bp--sidebar-nav",function(a){a.preventDefault();let n=t(this),o=n.data("tab");t(".better-payment .user-dashboard-sidebar .bp--sidebar-nav").removeClass("active"),t(".better-payment .bp--tab-conetnt-wrapper").addClass("d-none").fadeOut(),n.addClass("active"),t(`.better-payment .${o}-tab-wrapper`).fadeIn(500).removeClass("d-none"),window.innerWidth<768&&t(a.target).closest(".bp--sidebar-nav-list").length&&e()}),t(document).on("click",".better-payment .bp-view_all-btn",function(e){e.preventDefault(),t(".better-payment .bp--sidebar-nav.subscriptions-tab").click()}),t(".better-payment .bp-dashboard-hamburger").on("click",function(e){t(".better-payment-user-dashboard-sidebar").fadeIn(500),t(".better-payment .bp-overlay").fadeIn(500)}),t(".better-payment .bp-overlay").on("click",function(t){".better-payment-user-dashboard-sidebar"!==t.target&&e()}),t(document).on("click",".bp-transaction_data-copy_btn",function(){!function(){const e=t(".bp-transaction_id"),a=t(".bp-transaction_data-copy_btn");if(e.length){const n=t.trim(e.text());navigator.clipboard.writeText(n),a.css("stroke","#6B59EE");const o="copy-tooltip-style";let r=t("#"+o);r.length||(r=t("<style>",{id:o}).appendTo("head")),r.html("\n                .bp-transaction_data-copy_btn::after {\n                    content: 'Copied!';\n                    right: -23px;\n                }\n            "),a.addClass("copied-text"),setTimeout(()=>{a.removeClass("copied-text")},3e3)}}()}),t(document).on("click",".bp-print_btn",function(){!function(){const t=document.querySelector(".bp-thank_page");if(!t)return;const e=document.createElement("iframe");e.style.display="none",document.body.appendChild(e);const a=Array.from(document.styleSheets).map(t=>{try{return Array.from(t.cssRules).map(t=>t.cssText).join("\n")}catch(t){return""}}).filter(Boolean).join("\n"),n=e.contentDocument||e.contentWindow.document;n.write(`\n            <html>\n                <head>\n                    <title>${document.title}</title>\n                    <style>${a}</style>\n                </head>\n                <body>\n                    ${t.outerHTML}\n                </body>\n            </html>\n        `),n.close(),e.contentWindow.focus(),setTimeout(()=>{e.contentWindow.print(),setTimeout(()=>document.body.removeChild(e),1e3)},300)}()})}(jQuery);
```
