1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00
invoiceninja/public/js/clients/payment_methods/authorize-checkout-card.js
2022-07-20 10:08:05 +10:00

2 lines
1.1 KiB
JavaScript
Vendored

/*! For license information please see authorize-checkout-card.js.LICENSE.txt */
(()=>{function e(e,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}(new(function(){function n(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.button=document.querySelector("#pay-button")}var t,a,r;return t=n,(a=[{key:"init",value:function(){this.frames=Frames.init(document.querySelector("meta[name=public-key]").content)}},{key:"handle",value:function(){var e=this;this.init(),Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED,(function(n){e.button.disabled=!Frames.isCardValid()})),Frames.addEventHandler(Frames.Events.CARD_TOKENIZED,(function(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e),document.getElementById("server_response").submit()})),document.querySelector("#authorization-form").addEventListener("submit",(function(n){e.button.disabled=!0,n.preventDefault(),Frames.submitCard()}))}}])&&e(t.prototype,a),r&&e(t,r),n}())).handle()})();