mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
/client/invoices/payment
This commit is contained in:
parent
16887cda39
commit
8085311b98
291404
public/css/app.css
vendored
291404
public/css/app.css
vendored
File diff suppressed because one or more lines are too long
2
public/css/card-js.min.css
vendored
2
public/css/card-js.min.css
vendored
@ -1 +1 @@
|
||||
.card-js input.card-number{padding-right:48px}.card-js .card-number-wrapper .card-type-icon{height:23px;width:32px;position:absolute;display:block;right:8px;top:7px;background:url(https://cardjs.co.uk/img/cards.png) 0 23px no-repeat;pointer-events:none;opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-ms-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.card-js .card-number-wrapper .show{opacity:1}.card-js .card-number-wrapper .card-type-icon.visa{background-position:0 0}.card-js .card-number-wrapper .card-type-icon.master-card{background-position:-32px 0}.card-js .card-number-wrapper .card-type-icon.american-express{background-position:-64px 0}.card-js .card-number-wrapper .card-type-icon.discover{background-position:-96px 0}.card-js .card-number-wrapper .card-type-icon.diners{background-position:-128px 0}.card-js .card-number-wrapper .card-type-icon.jcb{background-position:-160px 0}.card-js .cvc-container{width:50%;float:right}.card-js .cvc-wrapper{box-sizing:border-box;margin-left:5px}.card-js .cvc-wrapper .cvc{display:block;width:100%}.card-js .expiry-container{width:50%;float:left}.card-js .expiry-wrapper{box-sizing:border-box;margin-right:5px}.card-js .expiry-wrapper .expiry{display:block;width:100%}.card-js .expiry-wrapper .expiry-month{border-top-right-radius:0;border-bottom-right-radius:0;padding-left:30px}.card-js .expiry-wrapper .expiry-year{border-top-left-radius:0;border-bottom-left-radius:0;border-left:0}.card-js .expiry-wrapper .expiry-month,.card-js .expiry-wrapper .expiry-year{display:inline-block}.card-js .expiry-wrapper .expiry{padding-left:38px}.card-js .icon{position:absolute;display:block;width:24px;height:17px;left:8px;top:10px;pointer-events:none}.card-js .icon.right{right:8px;left:auto}.card-js .icon.popup{cursor:pointer;pointer-events:auto}.card-js .icon .svg{fill:#888}.card-js .icon.popup .svg{fill:#aaa!important}.card-js .card-number-wrapper,.card-js .name-wrapper{margin-bottom:15px;width:100%}.card-js .card-number-wrapper,.card-js .cvc-wrapper,.card-js .expiry-wrapper,.card-js .name-wrapper{-webkit-box-shadow:0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);-moz-box-shadow:0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);-ms-box-shadow:0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);-o-box-shadow:0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);box-shadow:0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);position:relative}.card-js .card-number-wrapper,.card-js .cvc-container,.card-js .expiry-container,.card-js .name-wrapper{display:inline-block}.card-js::after{content:' ';display:table;clear:both}.card-js input,.card-js select{color:#676767;font-size:15px;font-weight:300;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;height:36px;border:1px solid #d9d9d9;border-radius:4px;box-shadow:none;background-color:#fdfdfd;box-sizing:border-box;padding:0;-webkit-transition:border-color .15s linear,box-shadow .15s linear;-moz-transition:border-color .15s linear,box-shadow .15s linear;-ms-transition:border-color .15s linear,box-shadow .15s linear;-o-transition:border-color .15s linear,box-shadow .15s linear;transition:border-color .15s linear,box-shadow .15s linear}.card-js select{-moz-appearance:none;text-indent:.01px;text-overflow:''}.card-js input[disabled],.card-js select[disabled]{background-color:#eee;color:#555}.card-js select option[hidden]{color:#aba9a9}.card-js input:focus,.card-js select:focus{background-color:#fff;outline:0;border-color:#66afe9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.card-js input[readonly=readonly]:not([disabled]),.card-js input[readonly]:not([disabled]){background-color:#fff;cursor:pointer}.card-js .has-error input,.card-js .has-error input:focus{border-color:#f64b2f;box-shadow:none}.card-js input.card-number,.card-js input.cvc,.card-js input.name{padding-left:38px;width:100%}.card-js.stripe .icon .svg{fill:#559A28}
|
||||
.card-js input.card-number{padding-right:48px}.card-js .card-number-wrapper .card-type-icon{height:23px;width:32px;position:absolute;display:block;right:8px;top:7px;background:url(https://cardjs.co.uk/img/cards.png) 0 23px no-repeat;pointer-events:none;opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-ms-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.card-js .card-number-wrapper .show{opacity:1}.card-js .card-number-wrapper .card-type-icon.visa{background-position:0 0}.card-js .card-number-wrapper .card-type-icon.master-card{background-position:-32px 0}.card-js .card-number-wrapper .card-type-icon.american-express{background-position:-64px 0}.card-js .card-number-wrapper .card-type-icon.discover{background-position:-96px 0}.card-js .card-number-wrapper .card-type-icon.diners{background-position:-128px 0}.card-js .card-number-wrapper .card-type-icon.jcb{background-position:-160px 0}.card-js .cvc-container{width:50%;float:right}.card-js .cvc-wrapper{box-sizing:border-box;margin-left:5px}.card-js .cvc-wrapper .cvc{display:block;width:100%}.card-js .expiry-container{width:50%;float:left}.card-js .expiry-wrapper{box-sizing:border-box;margin-right:5px}.card-js .expiry-wrapper .expiry{display:block;width:100%}.card-js .expiry-wrapper .expiry-month{border-top-right-radius:0;border-bottom-right-radius:0;padding-left:30px}.card-js .expiry-wrapper .expiry-year{border-top-left-radius:0;border-bottom-left-radius:0;border-left:0}.card-js .expiry-wrapper .expiry-month,.card-js .expiry-wrapper .expiry-year{display:inline-block}.card-js .expiry-wrapper .expiry{padding-left:38px}.card-js .icon{position:absolute;display:block;width:24px;height:17px;left:8px;top:10px;pointer-events:none}.card-js .icon.right{right:8px;left:auto}.card-js .icon.popup{cursor:pointer;pointer-events:auto}.card-js .icon .svg{fill:#888}.card-js .icon.popup .svg{fill:#aaa!important}.card-js .card-number-wrapper,.card-js .name-wrapper{margin-bottom:15px;width:100%}.card-js .card-number-wrapper,.card-js .cvc-wrapper,.card-js .expiry-wrapper,.card-js .name-wrapper{-webkit-box-shadow:0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);-moz-box-shadow:0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);-ms-box-shadow:0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);-o-box-shadow:0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);box-shadow:0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);position:relative}.card-js .card-number-wrapper,.card-js .cvc-container,.card-js .expiry-container,.card-js .name-wrapper{display:inline-block}.card-js::after{content:' ';display:table;clear:both}.card-js input,.card-js select{color:#676767;font-size:15px;font-weight:300;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;height:36px;border:1px solid #d9d9d9;border-radius:4px;box-shadow:none;background-color:#FDFDFD;box-sizing:border-box;padding:0;-webkit-transition:border-color .15s linear,box-shadow .15s linear;-moz-transition:border-color .15s linear,box-shadow .15s linear;-ms-transition:border-color .15s linear,box-shadow .15s linear;-o-transition:border-color .15s linear,box-shadow .15s linear;transition:border-color .15s linear,box-shadow .15s linear}.card-js select{-moz-appearance:none;text-indent:.01px;text-overflow:''}.card-js input[disabled],.card-js select[disabled]{background-color:#eee;color:#555}.card-js select option[hidden]{color:#ABA9A9}.card-js input:focus,.card-js select:focus{background-color:#fff;outline:0;border-color:#66afe9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.card-js input[readonly=readonly]:not([disabled]),.card-js input[readonly]:not([disabled]){background-color:#fff;cursor:pointer}.card-js .has-error input,.card-js .has-error input:focus{border-color:#F64B2F;box-shadow:none}.card-js input.card-number,.card-js input.cvc,.card-js input.name{padding-left:38px;width:100%}.card-js.stripe .icon .svg{fill:#559A28}
|
3367
public/js/app.js
vendored
3367
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
138
public/js/clients/invoices/action-selectors.js
vendored
138
public/js/clients/invoices/action-selectors.js
vendored
@ -1,2 +1,136 @@
|
||||
/*! For license information please see action-selectors.js.LICENSE.txt */
|
||||
(()=>{function e(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0,c=function(){};return{s:c,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw i}}}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(new(function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var r,o,c;return r=t,o=[{key:"watchCheckboxes",value:function(e){var t=this;document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),document.querySelectorAll(".form-check-child").forEach((function(n){e.checked?(n.checked=e.checked,t.processChildItem(n,document.getElementById("bulkActions"))):(n.checked=!1,document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})))}))}},{key:"processChildItem",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(r.hasOwnProperty("single")&&document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),!1!==t.checked){var o=document.createElement("INPUT");o.setAttribute("name","invoices[]"),o.setAttribute("value",t.dataset.value),o.setAttribute("class","child-hidden-input"),o.hidden=!0,n.append(o)}else{var c,i=document.querySelectorAll("input.child-hidden-input"),a=e(i);try{for(a.s();!(c=a.n()).done;){var l=c.value;l.value==t.dataset.value&&l.remove()}}catch(e){a.e(e)}finally{a.f()}}}},{key:"handle",value:function(){var t=this;this.parentElement.addEventListener("click",(function(){t.watchCheckboxes(t.parentElement)}));var n,r=e(document.querySelectorAll(".form-check-child"));try{var o=function(){var e=n.value;e.addEventListener("click",(function(){t.processChildItem(e,t.parentForm)}))};for(r.s();!(n=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}}}],o&&n(r.prototype,o),c&&n(r,c),t}())).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!***********************************************************!*\
|
||||
!*** ./resources/js/clients/invoices/action-selectors.js ***!
|
||||
\***********************************************************/
|
||||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
||||
|
||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ActionSelectors = /*#__PURE__*/function () {
|
||||
function ActionSelectors() {
|
||||
_classCallCheck(this, ActionSelectors);
|
||||
|
||||
this.parentElement = document.querySelector('.form-check-parent');
|
||||
this.parentForm = document.getElementById('bulkActions');
|
||||
}
|
||||
|
||||
_createClass(ActionSelectors, [{
|
||||
key: "watchCheckboxes",
|
||||
value: function watchCheckboxes(parentElement) {
|
||||
var _this = this;
|
||||
|
||||
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
|
||||
return element.remove();
|
||||
});
|
||||
document.querySelectorAll('.form-check-child').forEach(function (child) {
|
||||
if (parentElement.checked) {
|
||||
child.checked = parentElement.checked;
|
||||
|
||||
_this.processChildItem(child, document.getElementById('bulkActions'));
|
||||
} else {
|
||||
child.checked = false;
|
||||
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
|
||||
return element.remove();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "processChildItem",
|
||||
value: function processChildItem(element, parent) {
|
||||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
|
||||
if (options.hasOwnProperty('single')) {
|
||||
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
|
||||
return element.remove();
|
||||
});
|
||||
}
|
||||
|
||||
if (element.checked === false) {
|
||||
var inputs = document.querySelectorAll('input.child-hidden-input');
|
||||
|
||||
var _iterator = _createForOfIteratorHelper(inputs),
|
||||
_step;
|
||||
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var i = _step.value;
|
||||
if (i.value == element.dataset.value) i.remove();
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var _temp = document.createElement('INPUT');
|
||||
|
||||
_temp.setAttribute('name', 'invoices[]');
|
||||
|
||||
_temp.setAttribute('value', element.dataset.value);
|
||||
|
||||
_temp.setAttribute('class', 'child-hidden-input');
|
||||
|
||||
_temp.hidden = true;
|
||||
parent.append(_temp);
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this2 = this;
|
||||
|
||||
this.parentElement.addEventListener('click', function () {
|
||||
_this2.watchCheckboxes(_this2.parentElement);
|
||||
});
|
||||
|
||||
var _iterator2 = _createForOfIteratorHelper(document.querySelectorAll('.form-check-child')),
|
||||
_step2;
|
||||
|
||||
try {
|
||||
var _loop = function _loop() {
|
||||
var child = _step2.value;
|
||||
child.addEventListener('click', function () {
|
||||
_this2.processChildItem(child, _this2.parentForm);
|
||||
});
|
||||
};
|
||||
|
||||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
||||
_loop();
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator2.e(err);
|
||||
} finally {
|
||||
_iterator2.f();
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return ActionSelectors;
|
||||
}();
|
||||
/** @handle **/
|
||||
|
||||
|
||||
new ActionSelectors().handle();
|
||||
/******/ })()
|
||||
;
|
122
public/js/clients/invoices/payment.js
vendored
122
public/js/clients/invoices/payment.js
vendored
@ -1,2 +1,120 @@
|
||||
/*! For license information please see payment.js.LICENSE.txt */
|
||||
(()=>{function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var t=function(){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.shouldDisplayTerms=e,this.shouldDisplaySignature=n,this.termsAccepted=!1}var n,a,i;return n=t,(a=[{key:"handleMethodSelect",value:function(e){var t=this;document.getElementById("company_gateway_id").value=e.dataset.companyGatewayId,document.getElementById("payment_method_id").value=e.dataset.gatewayTypeId,this.shouldDisplaySignature&&!this.shouldDisplayTerms&&(this.displayTerms(),document.getElementById("accept-terms-button").addEventListener("click",(function(){t.termsAccepted=!0,t.submitForm()}))),!this.shouldDisplaySignature&&this.shouldDisplayTerms&&(this.displaySignature(),document.getElementById("signature-next-step").addEventListener("click",(function(){document.querySelector('input[name="signature"').value=t.signaturePad.toDataURL(),t.submitForm()}))),this.shouldDisplaySignature&&this.shouldDisplayTerms&&(this.displaySignature(),document.getElementById("signature-next-step").addEventListener("click",(function(){t.displayTerms(),document.getElementById("accept-terms-button").addEventListener("click",(function(){document.querySelector('input[name="signature"').value=t.signaturePad.toDataURL(),t.termsAccepted=!0,t.submitForm()}))}))),this.shouldDisplaySignature||this.shouldDisplayTerms||this.submitForm()}},{key:"submitForm",value:function(){document.getElementById("payment-form").submit()}},{key:"displayTerms",value:function(){document.getElementById("displayTermsModal").removeAttribute("style")}},{key:"displaySignature",value:function(){document.getElementById("displaySignatureModal").removeAttribute("style");var e=new SignaturePad(document.getElementById("signature-pad"),{penColor:"rgb(0, 0, 0)"});this.signaturePad=e}},{key:"handle",value:function(){var e=this;document.querySelectorAll(".dropdown-gateway-button").forEach((function(t){t.addEventListener("click",(function(){return e.handleMethodSelect(t)}))}))}}])&&e(n.prototype,a),i&&e(n,i),t}(),n=document.querySelector('meta[name="require-invoice-signature"]').content,a=document.querySelector('meta[name="show-invoice-terms"]').content;new t(Boolean(+n),Boolean(+a)).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!**************************************************!*\
|
||||
!*** ./resources/js/clients/invoices/payment.js ***!
|
||||
\**************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var Payment = /*#__PURE__*/function () {
|
||||
function Payment(displayTerms, displaySignature) {
|
||||
_classCallCheck(this, Payment);
|
||||
|
||||
this.shouldDisplayTerms = displayTerms;
|
||||
this.shouldDisplaySignature = displaySignature;
|
||||
this.termsAccepted = false;
|
||||
this.submitting = false;
|
||||
}
|
||||
|
||||
_createClass(Payment, [{
|
||||
key: "handleMethodSelect",
|
||||
value: function handleMethodSelect(element) {
|
||||
var _this = this;
|
||||
|
||||
document.getElementById("company_gateway_id").value = element.dataset.companyGatewayId;
|
||||
document.getElementById("payment_method_id").value = element.dataset.gatewayTypeId;
|
||||
|
||||
if (this.shouldDisplaySignature && !this.shouldDisplayTerms) {
|
||||
this.displayTerms();
|
||||
document.getElementById("accept-terms-button").addEventListener("click", function () {
|
||||
_this.termsAccepted = true;
|
||||
|
||||
_this.submitForm();
|
||||
});
|
||||
}
|
||||
|
||||
if (!this.shouldDisplaySignature && this.shouldDisplayTerms) {
|
||||
this.displaySignature();
|
||||
document.getElementById("signature-next-step").addEventListener("click", function () {
|
||||
document.querySelector('input[name="signature"').value = _this.signaturePad.toDataURL();
|
||||
|
||||
_this.submitForm();
|
||||
});
|
||||
}
|
||||
|
||||
if (this.shouldDisplaySignature && this.shouldDisplayTerms) {
|
||||
this.displaySignature();
|
||||
document.getElementById("signature-next-step").addEventListener("click", function () {
|
||||
_this.displayTerms();
|
||||
|
||||
document.getElementById("accept-terms-button").addEventListener("click", function () {
|
||||
document.querySelector('input[name="signature"').value = _this.signaturePad.toDataURL();
|
||||
_this.termsAccepted = true;
|
||||
|
||||
_this.submitForm();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (!this.shouldDisplaySignature && !this.shouldDisplayTerms) {
|
||||
this.submitForm();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "submitForm",
|
||||
value: function submitForm() {
|
||||
document.getElementById("payment-form").submit();
|
||||
}
|
||||
}, {
|
||||
key: "displayTerms",
|
||||
value: function displayTerms() {
|
||||
var displayTermsModal = document.getElementById("displayTermsModal");
|
||||
displayTermsModal.removeAttribute("style");
|
||||
}
|
||||
}, {
|
||||
key: "displaySignature",
|
||||
value: function displaySignature() {
|
||||
var displaySignatureModal = document.getElementById("displaySignatureModal");
|
||||
displaySignatureModal.removeAttribute("style");
|
||||
var signaturePad = new SignaturePad(document.getElementById("signature-pad"), {
|
||||
penColor: "rgb(0, 0, 0)"
|
||||
});
|
||||
this.signaturePad = signaturePad;
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this2 = this;
|
||||
|
||||
document.querySelectorAll(".dropdown-gateway-button").forEach(function (element) {
|
||||
element.addEventListener("click", function () {
|
||||
if (!_this2.submitting) {
|
||||
_this2.handleMethodSelect(element);
|
||||
|
||||
_this2.submitting = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return Payment;
|
||||
}();
|
||||
|
||||
var signature = document.querySelector('meta[name="require-invoice-signature"]').content;
|
||||
var terms = document.querySelector('meta[name="show-invoice-terms"]').content;
|
||||
new Payment(Boolean(+signature), Boolean(+terms)).handle();
|
||||
/******/ })()
|
||||
;
|
270
public/js/clients/linkify-urls.js
vendored
270
public/js/clients/linkify-urls.js
vendored
@ -1 +1,269 @@
|
||||
(()=>{var e,t={8945:(e,t,r)=>{"use strict";const a=r(920),n=r(3523),s=r(2263),o=new Set(n);e.exports=e=>{if((e=Object.assign({name:"div",attributes:{},html:""},e)).html&&e.text)throw new Error("The `html` and `text` options are mutually exclusive");const t=e.text?s.escape(e.text):e.html;let r=`<${e.name}${a(e.attributes)}>`;return o.has(e.name)||(r+=`${t}</${e.name}>`),r}},3523:(e,t,r)=>{"use strict";e.exports=r(8346)},2263:(e,t)=>{"use strict";t.escape=e=>e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"),t.unescape=e=>e.replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,'"').replace(/&/g,"&"),t.escapeTag=function(e){let r=e[0];for(let a=1;a<arguments.length;a++)r=r+t.escape(arguments[a])+e[a];return r},t.unescapeTag=function(e){let r=e[0];for(let a=1;a<arguments.length;a++)r=r+t.unescape(arguments[a])+e[a];return r}},1881:(e,t,r)=>{"use strict";const a=r(8945),n=(e,t)=>a({name:"a",attributes:{href:"",...t.attributes,href:e},text:void 0===t.value?e:void 0,html:void 0===t.value?void 0:"function"==typeof t.value?t.value(e):t.value});e.exports=(e,t)=>{if("string"===(t={attributes:{},type:"string",...t}).type)return((e,t)=>e.replace(/((?<!\+)(?:https?(?::\/\/))(?:www\.)?(?:[a-zA-Z\d-_.]+(?:(?:\.|@)[a-zA-Z\d]{2,})|localhost)(?:(?:[-a-zA-Z\d:%_+.~#*$!?&//=@]*)(?:[,](?![\s]))*)*)/g,(e=>n(e,t))))(e,t);if("dom"===t.type)return((e,t)=>{const r=document.createDocumentFragment();for(const[s,o]of Object.entries(e.split(/((?<!\+)(?:https?(?::\/\/))(?:www\.)?(?:[a-zA-Z\d-_.]+(?:(?:\.|@)[a-zA-Z\d]{2,})|localhost)(?:(?:[-a-zA-Z\d:%_+.~#*$!?&//=@]*)(?:[,](?![\s]))*)*)/g)))s%2?r.append((a=n(o,t),document.createRange().createContextualFragment(a))):o.length>0&&r.append(o);var a;return r})(e,t);throw new Error("The type option must be either `dom` or `string`")}},920:(e,t,r)=>{"use strict";const a=r(2263);e.exports=e=>{const t=[];for(const r of Object.keys(e)){let n=e[r];if(!1===n)continue;Array.isArray(n)&&(n=n.join(" "));let s=a.escape(r);!0!==n&&(s+=`="${a.escape(String(n))}"`),t.push(s)}return t.length>0?" "+t.join(" "):""}},8346:e=>{"use strict";e.exports=JSON.parse('["area","base","br","col","embed","hr","img","input","link","menuitem","meta","param","source","track","wbr"]')}},r={};function a(e){var n=r[e];if(void 0!==n)return n.exports;var s=r[e]={exports:{}};return t[e](s,s.exports,a),s.exports}e=a(1881),document.querySelectorAll("[data-ref=entity-terms]").forEach((function(t){t.innerHTML=e(t.innerText,{attributes:{target:"_blank",class:"text-primary"}})}))})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ "./node_modules/create-html-element/index.js":
|
||||
/*!***************************************************!*\
|
||||
!*** ./node_modules/create-html-element/index.js ***!
|
||||
\***************************************************/
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
const stringifyAttributes = __webpack_require__(/*! stringify-attributes */ "./node_modules/stringify-attributes/index.js");
|
||||
const htmlTags = __webpack_require__(/*! html-tags/void */ "./node_modules/create-html-element/node_modules/html-tags/void.js");
|
||||
const escapeGoat = __webpack_require__(/*! escape-goat */ "./node_modules/escape-goat/index.js");
|
||||
|
||||
const voidHtmlTags = new Set(htmlTags);
|
||||
|
||||
module.exports = options => {
|
||||
options = Object.assign({
|
||||
name: 'div',
|
||||
attributes: {},
|
||||
html: ''
|
||||
}, options);
|
||||
|
||||
if (options.html && options.text) {
|
||||
throw new Error('The `html` and `text` options are mutually exclusive');
|
||||
}
|
||||
|
||||
const content = options.text ? escapeGoat.escape(options.text) : options.html;
|
||||
let result = `<${options.name}${stringifyAttributes(options.attributes)}>`;
|
||||
|
||||
if (!voidHtmlTags.has(options.name)) {
|
||||
result += `${content}</${options.name}>`;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/create-html-element/node_modules/html-tags/void.js":
|
||||
/*!*************************************************************************!*\
|
||||
!*** ./node_modules/create-html-element/node_modules/html-tags/void.js ***!
|
||||
\*************************************************************************/
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
module.exports = __webpack_require__(/*! ./html-tags-void.json */ "./node_modules/create-html-element/node_modules/html-tags/html-tags-void.json");
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/escape-goat/index.js":
|
||||
/*!*******************************************!*\
|
||||
!*** ./node_modules/escape-goat/index.js ***!
|
||||
\*******************************************/
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
exports.escape = input => input
|
||||
.replace(/&/g, '&')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
|
||||
exports.unescape = input => input
|
||||
.replace(/>/g, '>')
|
||||
.replace(/</g, '<')
|
||||
.replace(/'/g, '\'')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/&/g, '&');
|
||||
|
||||
exports.escapeTag = function (input) {
|
||||
let output = input[0];
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
output = output + exports.escape(arguments[i]) + input[i];
|
||||
}
|
||||
return output;
|
||||
};
|
||||
|
||||
exports.unescapeTag = function (input) {
|
||||
let output = input[0];
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
output = output + exports.unescape(arguments[i]) + input[i];
|
||||
}
|
||||
return output;
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/linkify-urls/index.js":
|
||||
/*!********************************************!*\
|
||||
!*** ./node_modules/linkify-urls/index.js ***!
|
||||
\********************************************/
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
const createHtmlElement = __webpack_require__(/*! create-html-element */ "./node_modules/create-html-element/index.js");
|
||||
|
||||
// Capture the whole URL in group 1 to keep `String#split()` support
|
||||
const urlRegex = () => (/((?<!\+)(?:https?(?::\/\/))(?:www\.)?(?:[a-zA-Z\d-_.]+(?:(?:\.|@)[a-zA-Z\d]{2,})|localhost)(?:(?:[-a-zA-Z\d:%_+.~#*$!?&//=@]*)(?:[,](?![\s]))*)*)/g);
|
||||
|
||||
// Get `<a>` element as string
|
||||
const linkify = (href, options) => createHtmlElement({
|
||||
name: 'a',
|
||||
attributes: {
|
||||
href: '',
|
||||
...options.attributes,
|
||||
href // eslint-disable-line no-dupe-keys
|
||||
},
|
||||
text: typeof options.value === 'undefined' ? href : undefined,
|
||||
html: typeof options.value === 'undefined' ? undefined :
|
||||
(typeof options.value === 'function' ? options.value(href) : options.value)
|
||||
});
|
||||
|
||||
// Get DOM node from HTML
|
||||
const domify = html => document.createRange().createContextualFragment(html);
|
||||
|
||||
const getAsString = (string, options) => {
|
||||
return string.replace(urlRegex(), match => linkify(match, options));
|
||||
};
|
||||
|
||||
const getAsDocumentFragment = (string, options) => {
|
||||
const fragment = document.createDocumentFragment();
|
||||
for (const [index, text] of Object.entries(string.split(urlRegex()))) {
|
||||
if (index % 2) { // URLs are always in odd positions
|
||||
fragment.append(domify(linkify(text, options)));
|
||||
} else if (text.length > 0) {
|
||||
fragment.append(text);
|
||||
}
|
||||
}
|
||||
|
||||
return fragment;
|
||||
};
|
||||
|
||||
module.exports = (string, options) => {
|
||||
options = {
|
||||
attributes: {},
|
||||
type: 'string',
|
||||
...options
|
||||
};
|
||||
|
||||
if (options.type === 'string') {
|
||||
return getAsString(string, options);
|
||||
}
|
||||
|
||||
if (options.type === 'dom') {
|
||||
return getAsDocumentFragment(string, options);
|
||||
}
|
||||
|
||||
throw new Error('The type option must be either `dom` or `string`');
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/stringify-attributes/index.js":
|
||||
/*!****************************************************!*\
|
||||
!*** ./node_modules/stringify-attributes/index.js ***!
|
||||
\****************************************************/
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
const escapeGoat = __webpack_require__(/*! escape-goat */ "./node_modules/escape-goat/index.js");
|
||||
|
||||
module.exports = input => {
|
||||
const attributes = [];
|
||||
|
||||
for (const key of Object.keys(input)) {
|
||||
let value = input[key];
|
||||
|
||||
if (value === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
value = value.join(' ');
|
||||
}
|
||||
|
||||
let attribute = escapeGoat.escape(key);
|
||||
|
||||
if (value !== true) {
|
||||
attribute += `="${escapeGoat.escape(String(value))}"`;
|
||||
}
|
||||
|
||||
attributes.push(attribute);
|
||||
}
|
||||
|
||||
return attributes.length > 0 ? ' ' + attributes.join(' ') : '';
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/create-html-element/node_modules/html-tags/html-tags-void.json":
|
||||
/*!*************************************************************************************!*\
|
||||
!*** ./node_modules/create-html-element/node_modules/html-tags/html-tags-void.json ***!
|
||||
\*************************************************************************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = JSON.parse('["area","base","br","col","embed","hr","img","input","link","menuitem","meta","param","source","track","wbr"]');
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
||||
(() => {
|
||||
/*!**********************************************!*\
|
||||
!*** ./resources/js/clients/linkify-urls.js ***!
|
||||
\**********************************************/
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var linkifyUrls = __webpack_require__(/*! linkify-urls */ "./node_modules/linkify-urls/index.js");
|
||||
|
||||
document.querySelectorAll('[data-ref=entity-terms]').forEach(function (text) {
|
||||
text.innerHTML = linkifyUrls(text.innerText, {
|
||||
attributes: {
|
||||
target: '_blank',
|
||||
"class": 'text-primary'
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
/******/ })()
|
||||
;
|
@ -1,2 +1,95 @@
|
||||
/*! For license information please see authorize-authorize-card.js.LICENSE.txt */
|
||||
(()=>{function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var t=function(){function t(e,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.publicKey=e,this.loginId=a,this.cardHolderName=document.getElementById("cardholder_name"),this.cardButton=document.getElementById("card_button")}var a,n,r;return a=t,(n=[{key:"handleAuthorization",value:function(){var e=$("#my-card"),t={};t.clientKey=this.publicKey,t.apiLoginID=this.loginId;var a={};a.cardNumber=e.CardJs("cardNumber").replace(/[^\d]/g,""),a.month=e.CardJs("expiryMonth").replace(/[^\d]/g,""),a.year=e.CardJs("expiryYear").replace(/[^\d]/g,""),a.cardCode=document.getElementById("cvv").value.replace(/[^\d]/g,"");var n={};return n.authData=t,n.cardData=a,document.getElementById("card_button").disabled=!0,document.querySelector("#card_button > svg").classList.remove("hidden"),document.querySelector("#card_button > span").classList.add("hidden"),Accept.dispatchData(n,this.responseHandler),!1}},{key:"responseHandler",value:function(e){return"Error"===e.messages.resultCode?($("#errors").show().html("<p>"+e.messages.message[0].code+": "+e.messages.message[0].text+"</p>"),document.getElementById("card_button").disabled=!1,document.querySelector("#card_button > svg").classList.add("hidden"),document.querySelector("#card_button > span").classList.remove("hidden")):"Ok"===e.messages.resultCode&&(document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue,document.getElementById("server_response").submit()),!1}},{key:"handle",value:function(){var e=this;return this.cardButton.addEventListener("click",(function(){e.cardButton.disabled=!e.cardButton.disabled,e.handleAuthorization()})),this}}])&&e(a.prototype,n),r&&e(a,r),t}();new t(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!**************************************************************************!*\
|
||||
!*** ./resources/js/clients/payment_methods/authorize-authorize-card.js ***!
|
||||
\**************************************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var AuthorizeAuthorizeCard = /*#__PURE__*/function () {
|
||||
function AuthorizeAuthorizeCard(publicKey, loginId) {
|
||||
_classCallCheck(this, AuthorizeAuthorizeCard);
|
||||
|
||||
this.publicKey = publicKey;
|
||||
this.loginId = loginId;
|
||||
this.cardHolderName = document.getElementById("cardholder_name");
|
||||
this.cardButton = document.getElementById("card_button");
|
||||
}
|
||||
|
||||
_createClass(AuthorizeAuthorizeCard, [{
|
||||
key: "handleAuthorization",
|
||||
value: function handleAuthorization() {
|
||||
var myCard = $('#my-card');
|
||||
var authData = {};
|
||||
authData.clientKey = this.publicKey;
|
||||
authData.apiLoginID = this.loginId;
|
||||
var cardData = {};
|
||||
cardData.cardNumber = myCard.CardJs('cardNumber').replace(/[^\d]/g, '');
|
||||
cardData.month = myCard.CardJs('expiryMonth').replace(/[^\d]/g, '');
|
||||
cardData.year = myCard.CardJs('expiryYear').replace(/[^\d]/g, '');
|
||||
cardData.cardCode = document.getElementById("cvv").value.replace(/[^\d]/g, '');
|
||||
;
|
||||
var secureData = {};
|
||||
secureData.authData = authData;
|
||||
secureData.cardData = cardData;
|
||||
document.getElementById('card_button').disabled = true;
|
||||
document.querySelector('#card_button > svg').classList.remove('hidden');
|
||||
document.querySelector('#card_button > span').classList.add('hidden');
|
||||
Accept.dispatchData(secureData, this.responseHandler);
|
||||
return false;
|
||||
}
|
||||
}, {
|
||||
key: "responseHandler",
|
||||
value: function responseHandler(response) {
|
||||
if (response.messages.resultCode === "Error") {
|
||||
var i = 0;
|
||||
var $errors = $('#errors'); // get the reference of the div
|
||||
|
||||
$errors.show().html("<p>" + response.messages.message[i].code + ": " + response.messages.message[i].text + "</p>");
|
||||
document.getElementById('card_button').disabled = false;
|
||||
document.querySelector('#card_button > svg').classList.add('hidden');
|
||||
document.querySelector('#card_button > span').classList.remove('hidden');
|
||||
} else if (response.messages.resultCode === "Ok") {
|
||||
document.getElementById("dataDescriptor").value = response.opaqueData.dataDescriptor;
|
||||
document.getElementById("dataValue").value = response.opaqueData.dataValue;
|
||||
document.getElementById("server_response").submit();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this = this;
|
||||
|
||||
this.cardButton.addEventListener("click", function () {
|
||||
_this.cardButton.disabled = !_this.cardButton.disabled;
|
||||
|
||||
_this.handleAuthorization();
|
||||
});
|
||||
return this;
|
||||
}
|
||||
}]);
|
||||
|
||||
return AuthorizeAuthorizeCard;
|
||||
}();
|
||||
|
||||
var publicKey = document.querySelector('meta[name="authorize-public-key"]').content;
|
||||
var loginId = document.querySelector('meta[name="authorize-login-id"]').content;
|
||||
/** @handle */
|
||||
|
||||
new AuthorizeAuthorizeCard(publicKey, loginId).handle();
|
||||
/******/ })()
|
||||
;
|
@ -1,2 +1,59 @@
|
||||
/*! 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()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!*************************************************************************!*\
|
||||
!*** ./resources/js/clients/payment_methods/authorize-checkout-card.js ***!
|
||||
\*************************************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var CheckoutCreditCardAuthorization = /*#__PURE__*/function () {
|
||||
function CheckoutCreditCardAuthorization() {
|
||||
_classCallCheck(this, CheckoutCreditCardAuthorization);
|
||||
|
||||
this.button = document.querySelector('#pay-button');
|
||||
}
|
||||
|
||||
_createClass(CheckoutCreditCardAuthorization, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
this.frames = Frames.init(document.querySelector('meta[name=public-key]').content);
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this = this;
|
||||
|
||||
this.init();
|
||||
Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED, function (event) {
|
||||
_this.button.disabled = !Frames.isCardValid();
|
||||
});
|
||||
Frames.addEventHandler(Frames.Events.CARD_TOKENIZED, function (event) {
|
||||
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(event);
|
||||
document.getElementById('server_response').submit();
|
||||
});
|
||||
document.querySelector('#authorization-form').addEventListener('submit', function (event) {
|
||||
_this.button.disabled = true;
|
||||
event.preventDefault();
|
||||
Frames.submitCard();
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return CheckoutCreditCardAuthorization;
|
||||
}();
|
||||
|
||||
new CheckoutCreditCardAuthorization().handle();
|
||||
/******/ })()
|
||||
;
|
@ -1,2 +1,69 @@
|
||||
/*! For license information please see braintree-ach.js.LICENSE.txt */
|
||||
(()=>{var e;window.braintree.client.create({authorization:null===(e=document.querySelector('meta[name="client-token"]'))||void 0===e?void 0:e.content}).then((function(e){return braintree.usBankAccount.create({client:e})})).then((function(e){var t;null===(t=document.getElementById("authorize-bank-account"))||void 0===t||t.addEventListener("click",(function(t){t.target.parentElement.disabled=!0,document.getElementById("errors").hidden=!0,document.getElementById("errors").textContent="";var n={accountNumber:document.getElementById("account-number").value,routingNumber:document.getElementById("routing-number").value,accountType:document.querySelector('input[name="account-type"]:checked').value,ownershipType:document.querySelector('input[name="ownership-type"]:checked').value,billingAddress:{streetAddress:document.getElementById("billing-street-address").value,extendedAddress:document.getElementById("billing-extended-address").value,locality:document.getElementById("billing-locality").value,region:document.getElementById("billing-region").value,postalCode:document.getElementById("billing-postal-code").value}};if("personal"===n.ownershipType){var r=document.getElementById("account-holder-name").value.split(" ",2);n.firstName=r[0],n.lastName=r[1]}else n.businessName=document.getElementById("account-holder-name").value;e.tokenize({bankDetails:n,mandateText:'By clicking ["Checkout"], I authorize Braintree, a service of PayPal, on behalf of [your business name here] (i) to verify my bank account information using bank information and consumer reports and (ii) to debit my bank account.'}).then((function(e){document.querySelector("input[name=nonce]").value=e.nonce,document.getElementById("server_response").submit()})).catch((function(e){t.target.parentElement.disabled=!1,document.getElementById("errors").textContent="".concat(e.details.originalError.message," ").concat(e.details.originalError.details.originalError[0].message),document.getElementById("errors").hidden=!1}))}))})).catch((function(e){document.getElementById("errors").textContent="".concat(error.details.originalError.message," ").concat(error.details.originalError.details.originalError[0].message),document.getElementById("errors").hidden=!1}))})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!***************************************************************!*\
|
||||
!*** ./resources/js/clients/payment_methods/braintree-ach.js ***!
|
||||
\***************************************************************/
|
||||
var _document$querySelect;
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
window.braintree.client.create({
|
||||
authorization: (_document$querySelect = document.querySelector('meta[name="client-token"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content
|
||||
}).then(function (clientInstance) {
|
||||
return braintree.usBankAccount.create({
|
||||
client: clientInstance
|
||||
});
|
||||
}).then(function (usBankAccountInstance) {
|
||||
var _document$getElementB;
|
||||
|
||||
(_document$getElementB = document.getElementById('authorize-bank-account')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.addEventListener('click', function (e) {
|
||||
e.target.parentElement.disabled = true;
|
||||
document.getElementById('errors').hidden = true;
|
||||
document.getElementById('errors').textContent = '';
|
||||
var bankDetails = {
|
||||
accountNumber: document.getElementById('account-number').value,
|
||||
routingNumber: document.getElementById('routing-number').value,
|
||||
accountType: document.querySelector('input[name="account-type"]:checked').value,
|
||||
ownershipType: document.querySelector('input[name="ownership-type"]:checked').value,
|
||||
billingAddress: {
|
||||
streetAddress: document.getElementById('billing-street-address').value,
|
||||
extendedAddress: document.getElementById('billing-extended-address').value,
|
||||
locality: document.getElementById('billing-locality').value,
|
||||
region: document.getElementById('billing-region').value,
|
||||
postalCode: document.getElementById('billing-postal-code').value
|
||||
}
|
||||
};
|
||||
|
||||
if (bankDetails.ownershipType === 'personal') {
|
||||
var name = document.getElementById('account-holder-name').value.split(' ', 2);
|
||||
bankDetails.firstName = name[0];
|
||||
bankDetails.lastName = name[1];
|
||||
} else {
|
||||
bankDetails.businessName = document.getElementById('account-holder-name').value;
|
||||
}
|
||||
|
||||
usBankAccountInstance.tokenize({
|
||||
bankDetails: bankDetails,
|
||||
mandateText: 'By clicking ["Checkout"], I authorize Braintree, a service of PayPal, on behalf of [your business name here] (i) to verify my bank account information using bank information and consumer reports and (ii) to debit my bank account.'
|
||||
}).then(function (payload) {
|
||||
document.querySelector('input[name=nonce]').value = payload.nonce;
|
||||
document.getElementById('server_response').submit();
|
||||
})["catch"](function (error) {
|
||||
e.target.parentElement.disabled = false;
|
||||
document.getElementById('errors').textContent = "".concat(error.details.originalError.message, " ").concat(error.details.originalError.details.originalError[0].message);
|
||||
document.getElementById('errors').hidden = false;
|
||||
});
|
||||
});
|
||||
})["catch"](function (err) {
|
||||
document.getElementById('errors').textContent = "".concat(error.details.originalError.message, " ").concat(error.details.originalError.details.originalError[0].message);
|
||||
document.getElementById('errors').hidden = false;
|
||||
});
|
||||
/******/ })()
|
||||
;
|
@ -1,2 +1,74 @@
|
||||
/*! For license information please see wepay-bank-account.js.LICENSE.txt */
|
||||
(()=>{function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var n=function(){function n(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n)}var t,o,r;return t=n,(o=[{key:"initializeWePay",value:function(){var e,n=null===(e=document.querySelector('meta[name="wepay-environment"]'))||void 0===e?void 0:e.content;return WePay.set_endpoint("staging"===n?"stage":"production"),this}},{key:"showBankPopup",value:function(){var e,n;WePay.bank_account.create({client_id:null===(e=document.querySelector("meta[name=wepay-client-id]"))||void 0===e?void 0:e.content,email:null===(n=document.querySelector("meta[name=contact-email]"))||void 0===n?void 0:n.content},(function(e){e.error?(errors.textContent="",errors.textContent=e.error_description,errors.hidden=!1):(document.querySelector('input[name="bank_account_id"]').value=e.bank_account_id,document.getElementById("server_response").submit())}),(function(e){e.error&&(errors.textContent="",errors.textContent=e.error_description,errors.hidden=!1)}))}},{key:"handle",value:function(){this.initializeWePay().showBankPopup()}}])&&e(t.prototype,o),r&&e(t,r),n}();document.addEventListener("DOMContentLoaded",(function(){(new n).handle()}))})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!********************************************************************!*\
|
||||
!*** ./resources/js/clients/payment_methods/wepay-bank-account.js ***!
|
||||
\********************************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
var WePayBank = /*#__PURE__*/function () {
|
||||
function WePayBank() {
|
||||
_classCallCheck(this, WePayBank);
|
||||
}
|
||||
|
||||
_createClass(WePayBank, [{
|
||||
key: "initializeWePay",
|
||||
value: function initializeWePay() {
|
||||
var _document$querySelect;
|
||||
|
||||
var environment = (_document$querySelect = document.querySelector('meta[name="wepay-environment"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content;
|
||||
WePay.set_endpoint(environment === 'staging' ? 'stage' : 'production');
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "showBankPopup",
|
||||
value: function showBankPopup() {
|
||||
var _document$querySelect2, _document$querySelect3;
|
||||
|
||||
WePay.bank_account.create({
|
||||
client_id: (_document$querySelect2 = document.querySelector('meta[name=wepay-client-id]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content,
|
||||
email: (_document$querySelect3 = document.querySelector('meta[name=contact-email]')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.content
|
||||
}, function (data) {
|
||||
if (data.error) {
|
||||
errors.textContent = '';
|
||||
errors.textContent = data.error_description;
|
||||
errors.hidden = false;
|
||||
} else {
|
||||
document.querySelector('input[name="bank_account_id"]').value = data.bank_account_id;
|
||||
document.getElementById('server_response').submit();
|
||||
}
|
||||
}, function (data) {
|
||||
if (data.error) {
|
||||
errors.textContent = '';
|
||||
errors.textContent = data.error_description;
|
||||
errors.hidden = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
this.initializeWePay().showBankPopup();
|
||||
}
|
||||
}]);
|
||||
|
||||
return WePayBank;
|
||||
}();
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
new WePayBank().handle();
|
||||
});
|
||||
/******/ })()
|
||||
;
|
@ -1,2 +1,137 @@
|
||||
/*! For license information please see authorize-credit-card-payment.js.LICENSE.txt */
|
||||
(()=>{function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n=function(){function n(e,a){var d=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t(this,"handleAuthorization",(function(){var e=$("#my-card"),t={};t.clientKey=d.publicKey,t.apiLoginID=d.loginId;var n={};n.cardNumber=e.CardJs("cardNumber").replace(/[^\d]/g,""),n.month=e.CardJs("expiryMonth").replace(/[^\d]/g,""),n.year=e.CardJs("expiryYear").replace(/[^\d]/g,""),n.cardCode=document.getElementById("cvv").value.replace(/[^\d]/g,"");var a={};return a.authData=t,a.cardData=n,document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),Accept.dispatchData(a,d.responseHandler),!1})),t(this,"responseHandler",(function(e){if("Error"===e.messages.resultCode){$("#errors").show().html("<p>"+e.messages.message[0].code+": "+e.messages.message[0].text+"</p>"),document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}else if("Ok"===e.messages.resultCode){document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue;var t=document.querySelector("input[name=token-billing-checkbox]:checked");t&&(document.getElementById("store_card").value=t.value),document.getElementById("server_response").submit()}return!1})),t(this,"handle",(function(){Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("save-card--container").style.display="none",document.getElementById("authorize--credit-card-container").style.display="none",document.getElementById("token").value=e.target.dataset.token}))}));var e=document.getElementById("toggle-payment-with-credit-card");e&&e.addEventListener("click",(function(){document.getElementById("save-card--container").style.display="grid",document.getElementById("authorize--credit-card-container").style.display="flex",document.getElementById("token").value=null}));var t=document.getElementById("pay-now");return t&&t.addEventListener("click",(function(e){var t=document.getElementById("token");t.value?d.handlePayNowAction(t.value):d.handleAuthorization()})),d})),this.publicKey=e,this.loginId=a,this.cardHolderName=document.getElementById("cardholder_name")}var a,d,o;return a=n,(d=[{key:"handlePayNowAction",value:function(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),document.getElementById("token").value=e,document.getElementById("server_response").submit()}}])&&e(a.prototype,d),o&&e(a,o),n}();new n(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!************************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/authorize-credit-card-payment.js ***!
|
||||
\************************************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var AuthorizeAuthorizeCard = /*#__PURE__*/function () {
|
||||
function AuthorizeAuthorizeCard(publicKey, loginId) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, AuthorizeAuthorizeCard);
|
||||
|
||||
_defineProperty(this, "handleAuthorization", function () {
|
||||
var myCard = $('#my-card');
|
||||
var authData = {};
|
||||
authData.clientKey = _this.publicKey;
|
||||
authData.apiLoginID = _this.loginId;
|
||||
var cardData = {};
|
||||
cardData.cardNumber = myCard.CardJs('cardNumber').replace(/[^\d]/g, '');
|
||||
cardData.month = myCard.CardJs('expiryMonth').replace(/[^\d]/g, '');
|
||||
cardData.year = myCard.CardJs('expiryYear').replace(/[^\d]/g, '');
|
||||
cardData.cardCode = document.getElementById("cvv").value.replace(/[^\d]/g, '');
|
||||
var secureData = {};
|
||||
secureData.authData = authData;
|
||||
secureData.cardData = cardData; // If using banking information instead of card information,
|
||||
// send the bankData object instead of the cardData object.
|
||||
//
|
||||
// secureData.bankData = bankData;
|
||||
|
||||
var payNowButton = document.getElementById('pay-now');
|
||||
|
||||
if (payNowButton) {
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
}
|
||||
|
||||
Accept.dispatchData(secureData, _this.responseHandler);
|
||||
return false;
|
||||
});
|
||||
|
||||
_defineProperty(this, "responseHandler", function (response) {
|
||||
if (response.messages.resultCode === "Error") {
|
||||
var i = 0;
|
||||
var $errors = $('#errors'); // get the reference of the div
|
||||
|
||||
$errors.show().html("<p>" + response.messages.message[i].code + ": " + response.messages.message[i].text + "</p>");
|
||||
document.getElementById('pay-now').disabled = false;
|
||||
document.querySelector('#pay-now > svg').classList.add('hidden');
|
||||
document.querySelector('#pay-now > span').classList.remove('hidden');
|
||||
} else if (response.messages.resultCode === "Ok") {
|
||||
document.getElementById("dataDescriptor").value = response.opaqueData.dataDescriptor;
|
||||
document.getElementById("dataValue").value = response.opaqueData.dataValue;
|
||||
var storeCard = document.querySelector('input[name=token-billing-checkbox]:checked');
|
||||
|
||||
if (storeCard) {
|
||||
document.getElementById("store_card").value = storeCard.value;
|
||||
}
|
||||
|
||||
document.getElementById("server_response").submit();
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) {
|
||||
return element.addEventListener('click', function (e) {
|
||||
document.getElementById('save-card--container').style.display = 'none';
|
||||
document.getElementById('authorize--credit-card-container').style.display = 'none';
|
||||
document.getElementById('token').value = e.target.dataset.token;
|
||||
});
|
||||
});
|
||||
var payWithCreditCardToggle = document.getElementById('toggle-payment-with-credit-card');
|
||||
|
||||
if (payWithCreditCardToggle) {
|
||||
payWithCreditCardToggle.addEventListener('click', function () {
|
||||
document.getElementById('save-card--container').style.display = 'grid';
|
||||
document.getElementById('authorize--credit-card-container').style.display = 'flex';
|
||||
document.getElementById('token').value = null;
|
||||
});
|
||||
}
|
||||
|
||||
var payNowButton = document.getElementById('pay-now');
|
||||
|
||||
if (payNowButton) {
|
||||
payNowButton.addEventListener('click', function (e) {
|
||||
var token = document.getElementById('token');
|
||||
token.value ? _this.handlePayNowAction(token.value) : _this.handleAuthorization();
|
||||
});
|
||||
}
|
||||
|
||||
return _this;
|
||||
});
|
||||
|
||||
this.publicKey = publicKey;
|
||||
this.loginId = loginId;
|
||||
this.cardHolderName = document.getElementById("cardholder_name");
|
||||
}
|
||||
|
||||
_createClass(AuthorizeAuthorizeCard, [{
|
||||
key: "handlePayNowAction",
|
||||
value: function handlePayNowAction(token_hashed_id) {
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
document.getElementById("token").value = token_hashed_id;
|
||||
document.getElementById("server_response").submit();
|
||||
}
|
||||
}]);
|
||||
|
||||
return AuthorizeAuthorizeCard;
|
||||
}();
|
||||
|
||||
var publicKey = document.querySelector('meta[name="authorize-public-key"]').content;
|
||||
var loginId = document.querySelector('meta[name="authorize-login-id"]').content;
|
||||
/** @handle */
|
||||
|
||||
new AuthorizeAuthorizeCard(publicKey, loginId).handle();
|
||||
/******/ })()
|
||||
;
|
119
public/js/clients/payments/braintree-credit-card.js
vendored
119
public/js/clients/payments/braintree-credit-card.js
vendored
@ -1,2 +1,117 @@
|
||||
/*! For license information please see braintree-credit-card.js.LICENSE.txt */
|
||||
(()=>{function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}(new(function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,a,o;return n=t,(a=[{key:"initBraintreeDataCollector",value:function(){window.braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content},(function(e,t){window.braintree.dataCollector.create({client:t,paypal:!0},(function(e,t){e||(document.querySelector("input[name=client-data]").value=t.deviceData)}))}))}},{key:"mountBraintreePaymentWidget",value:function(){window.braintree.dropin.create({authorization:document.querySelector("meta[name=client-token]").content,container:"#dropin-container"},this.handleCallback)}},{key:"handleCallback",value:function(e,t){if(e)console.error(e);else{var n=document.getElementById("pay-now");n.addEventListener("click",(function(){t.requestPaymentMethod((function(e,t){if(e)return console.error(e);n.disabled=!0,n.querySelector("svg").classList.remove("hidden"),n.querySelector("span").classList.add("hidden"),document.querySelector("input[name=gateway_response]").value=JSON.stringify(t);var a=document.querySelector('input[name="token-billing-checkbox"]:checked');a&&(document.querySelector('input[name="store_card"]').value=a.value),document.getElementById("server-response").submit()}))}))}}},{key:"handle",value:function(){this.initBraintreeDataCollector(),this.mountBraintreePaymentWidget(),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("dropin-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token,document.getElementById("pay-now-with-token").classList.remove("hidden"),document.getElementById("pay-now").classList.add("hidden")}))})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",(function(e){document.getElementById("dropin-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="",document.getElementById("pay-now-with-token").classList.add("hidden"),document.getElementById("pay-now").classList.remove("hidden")}));var e=document.getElementById("pay-now-with-token");e.addEventListener("click",(function(t){e.disabled=!0,e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}))}}])&&e(n.prototype,a),o&&e(n,o),t}())).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!****************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/braintree-credit-card.js ***!
|
||||
\****************************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var BraintreeCreditCard = /*#__PURE__*/function () {
|
||||
function BraintreeCreditCard() {
|
||||
_classCallCheck(this, BraintreeCreditCard);
|
||||
}
|
||||
|
||||
_createClass(BraintreeCreditCard, [{
|
||||
key: "initBraintreeDataCollector",
|
||||
value: function initBraintreeDataCollector() {
|
||||
window.braintree.client.create({
|
||||
authorization: document.querySelector('meta[name=client-token]').content
|
||||
}, function (err, clientInstance) {
|
||||
window.braintree.dataCollector.create({
|
||||
client: clientInstance,
|
||||
paypal: true
|
||||
}, function (err, dataCollectorInstance) {
|
||||
if (err) {
|
||||
return;
|
||||
}
|
||||
|
||||
document.querySelector('input[name=client-data]').value = dataCollectorInstance.deviceData;
|
||||
});
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "mountBraintreePaymentWidget",
|
||||
value: function mountBraintreePaymentWidget() {
|
||||
window.braintree.dropin.create({
|
||||
authorization: document.querySelector('meta[name=client-token]').content,
|
||||
container: '#dropin-container'
|
||||
}, this.handleCallback);
|
||||
}
|
||||
}, {
|
||||
key: "handleCallback",
|
||||
value: function handleCallback(error, dropinInstance) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
return;
|
||||
}
|
||||
|
||||
var payNow = document.getElementById('pay-now');
|
||||
payNow.addEventListener('click', function () {
|
||||
dropinInstance.requestPaymentMethod(function (error, payload) {
|
||||
if (error) {
|
||||
return console.error(error);
|
||||
}
|
||||
|
||||
payNow.disabled = true;
|
||||
payNow.querySelector('svg').classList.remove('hidden');
|
||||
payNow.querySelector('span').classList.add('hidden');
|
||||
document.querySelector('input[name=gateway_response]').value = JSON.stringify(payload);
|
||||
var tokenBillingCheckbox = document.querySelector('input[name="token-billing-checkbox"]:checked');
|
||||
|
||||
if (tokenBillingCheckbox) {
|
||||
document.querySelector('input[name="store_card"]').value = tokenBillingCheckbox.value;
|
||||
}
|
||||
|
||||
document.getElementById('server-response').submit();
|
||||
});
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
this.initBraintreeDataCollector();
|
||||
this.mountBraintreePaymentWidget();
|
||||
Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) {
|
||||
return element.addEventListener('click', function (element) {
|
||||
document.getElementById('dropin-container').classList.add('hidden');
|
||||
document.getElementById('save-card--container').style.display = 'none';
|
||||
document.querySelector('input[name=token]').value = element.target.dataset.token;
|
||||
document.getElementById('pay-now-with-token').classList.remove('hidden');
|
||||
document.getElementById('pay-now').classList.add('hidden');
|
||||
});
|
||||
});
|
||||
document.getElementById('toggle-payment-with-credit-card').addEventListener('click', function (element) {
|
||||
document.getElementById('dropin-container').classList.remove('hidden');
|
||||
document.getElementById('save-card--container').style.display = 'grid';
|
||||
document.querySelector('input[name=token]').value = "";
|
||||
document.getElementById('pay-now-with-token').classList.add('hidden');
|
||||
document.getElementById('pay-now').classList.remove('hidden');
|
||||
});
|
||||
var payNowWithToken = document.getElementById('pay-now-with-token');
|
||||
payNowWithToken.addEventListener('click', function (element) {
|
||||
payNowWithToken.disabled = true;
|
||||
payNowWithToken.querySelector('svg').classList.remove('hidden');
|
||||
payNowWithToken.querySelector('span').classList.add('hidden');
|
||||
document.getElementById('server-response').submit();
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return BraintreeCreditCard;
|
||||
}();
|
||||
|
||||
new BraintreeCreditCard().handle();
|
||||
/******/ })()
|
||||
;
|
132
public/js/clients/payments/braintree-paypal.js
vendored
132
public/js/clients/payments/braintree-paypal.js
vendored
@ -1,2 +1,130 @@
|
||||
/*! For license information please see braintree-paypal.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)}var t,a,o;return t=n,o=[{key:"getPaymentDetails",value:function(){return{flow:"vault"}}},{key:"handleErrorMessage",value:function(e){var n=document.getElementById("errors");n.innerText=e,n.hidden=!1}}],(a=[{key:"initBraintreeDataCollector",value:function(){window.braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content},(function(e,n){window.braintree.dataCollector.create({client:n,paypal:!0},(function(e,n){e||(document.querySelector("input[name=client-data]").value=n.deviceData)}))}))}},{key:"handlePaymentWithToken",value:function(){Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("paypal-button").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token,document.getElementById("pay-now-with-token").classList.remove("hidden"),document.getElementById("pay-now").classList.add("hidden")}))}));var e=document.getElementById("pay-now-with-token");e.addEventListener("click",(function(n){e.disabled=!0,e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}))}},{key:"handle",value:function(){this.initBraintreeDataCollector(),this.handlePaymentWithToken(),braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content}).then((function(e){return braintree.paypalCheckout.create({client:e})})).then((function(e){return e.loadPayPalSDK({vault:!0}).then((function(e){return paypal.Buttons({fundingSource:paypal.FUNDING.PAYPAL,createBillingAgreement:function(){return e.createPayment(n.getPaymentDetails())},onApprove:function(n,t){return e.tokenizePayment(n).then((function(e){var n=document.querySelector('input[name="token-billing-checkbox"]:checked');n&&(document.querySelector('input[name="store_card"]').value=n.value),document.querySelector("input[name=gateway_response]").value=JSON.stringify(e),document.getElementById("server-response").submit()}))},onCancel:function(e){},onError:function(e){console.log(e.message),n.handleErrorMessage(e.message)}}).render("#paypal-button")}))})).catch((function(e){console.log(e.message),n.handleErrorMessage(e.message)}))}}])&&e(t.prototype,a),o&&e(t,o),n}())).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!***********************************************************!*\
|
||||
!*** ./resources/js/clients/payments/braintree-paypal.js ***!
|
||||
\***********************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var BraintreePayPal = /*#__PURE__*/function () {
|
||||
function BraintreePayPal() {
|
||||
_classCallCheck(this, BraintreePayPal);
|
||||
}
|
||||
|
||||
_createClass(BraintreePayPal, [{
|
||||
key: "initBraintreeDataCollector",
|
||||
value: function initBraintreeDataCollector() {
|
||||
window.braintree.client.create({
|
||||
authorization: document.querySelector('meta[name=client-token]').content
|
||||
}, function (err, clientInstance) {
|
||||
window.braintree.dataCollector.create({
|
||||
client: clientInstance,
|
||||
paypal: true
|
||||
}, function (err, dataCollectorInstance) {
|
||||
if (err) {
|
||||
return;
|
||||
}
|
||||
|
||||
document.querySelector('input[name=client-data]').value = dataCollectorInstance.deviceData;
|
||||
});
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handlePaymentWithToken",
|
||||
value: function handlePaymentWithToken() {
|
||||
Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) {
|
||||
return element.addEventListener('click', function (element) {
|
||||
document.getElementById('paypal-button').classList.add('hidden');
|
||||
document.getElementById('save-card--container').style.display = 'none';
|
||||
document.querySelector('input[name=token]').value = element.target.dataset.token;
|
||||
document.getElementById('pay-now-with-token').classList.remove('hidden');
|
||||
document.getElementById('pay-now').classList.add('hidden');
|
||||
});
|
||||
});
|
||||
var payNowWithToken = document.getElementById('pay-now-with-token');
|
||||
payNowWithToken.addEventListener('click', function (element) {
|
||||
payNowWithToken.disabled = true;
|
||||
payNowWithToken.querySelector('svg').classList.remove('hidden');
|
||||
payNowWithToken.querySelector('span').classList.add('hidden');
|
||||
document.getElementById('server-response').submit();
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
this.initBraintreeDataCollector();
|
||||
this.handlePaymentWithToken();
|
||||
braintree.client.create({
|
||||
authorization: document.querySelector('meta[name=client-token]').content
|
||||
}).then(function (clientInstance) {
|
||||
return braintree.paypalCheckout.create({
|
||||
client: clientInstance
|
||||
});
|
||||
}).then(function (paypalCheckoutInstance) {
|
||||
return paypalCheckoutInstance.loadPayPalSDK({
|
||||
vault: true
|
||||
}).then(function (paypalCheckoutInstance) {
|
||||
return paypal.Buttons({
|
||||
fundingSource: paypal.FUNDING.PAYPAL,
|
||||
createBillingAgreement: function createBillingAgreement() {
|
||||
return paypalCheckoutInstance.createPayment(BraintreePayPal.getPaymentDetails());
|
||||
},
|
||||
onApprove: function onApprove(data, actions) {
|
||||
return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {
|
||||
var tokenBillingCheckbox = document.querySelector('input[name="token-billing-checkbox"]:checked');
|
||||
|
||||
if (tokenBillingCheckbox) {
|
||||
document.querySelector('input[name="store_card"]').value = tokenBillingCheckbox.value;
|
||||
}
|
||||
|
||||
document.querySelector('input[name=gateway_response]').value = JSON.stringify(payload);
|
||||
document.getElementById('server-response').submit();
|
||||
});
|
||||
},
|
||||
onCancel: function onCancel(data) {// ..
|
||||
},
|
||||
onError: function onError(err) {
|
||||
console.log(err.message);
|
||||
BraintreePayPal.handleErrorMessage(err.message);
|
||||
}
|
||||
}).render('#paypal-button');
|
||||
});
|
||||
})["catch"](function (err) {
|
||||
console.log(err.message);
|
||||
BraintreePayPal.handleErrorMessage(err.message);
|
||||
});
|
||||
}
|
||||
}], [{
|
||||
key: "getPaymentDetails",
|
||||
value: function getPaymentDetails() {
|
||||
return {
|
||||
flow: 'vault'
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: "handleErrorMessage",
|
||||
value: function handleErrorMessage(message) {
|
||||
var errorsContainer = document.getElementById('errors');
|
||||
errorsContainer.innerText = message;
|
||||
errorsContainer.hidden = false;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BraintreePayPal;
|
||||
}();
|
||||
|
||||
new BraintreePayPal().handle();
|
||||
/******/ })()
|
||||
;
|
9
public/js/clients/payments/card-js.min.js
vendored
9
public/js/clients/payments/card-js.min.js
vendored
File diff suppressed because one or more lines are too long
101
public/js/clients/payments/checkout-credit-card.js
vendored
101
public/js/clients/payments/checkout-credit-card.js
vendored
@ -1,2 +1,99 @@
|
||||
/*! For license information please see checkout-credit-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.tokens=[]}var t,a,d;return t=n,(a=[{key:"mountFrames",value:function(){console.log("Mount checkout frames..")}},{key:"handlePaymentUsingToken",value:function(e){document.getElementById("checkout--container").classList.add("hidden"),document.getElementById("pay-now-with-token--container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token}},{key:"handlePaymentUsingCreditCard",value:function(e){var n;document.getElementById("checkout--container").classList.remove("hidden"),document.getElementById("pay-now-with-token--container").classList.add("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="";var t=document.getElementById("pay-button"),a=null!==(n=document.querySelector('meta[name="public-key"]').content)&&void 0!==n?n:"",d=document.getElementById("payment-form");Frames.init(a),Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED,(function(e){t.disabled=!Frames.isCardValid()})),Frames.addEventHandler(Frames.Events.CARD_TOKENIZATION_FAILED,(function(e){pay.button.disabled=!1})),Frames.addEventHandler(Frames.Events.CARD_TOKENIZED,(function(e){t.disabled=!0,document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e),document.querySelector('input[name="store_card"]').value=document.querySelector("input[name=token-billing-checkbox]:checked").value,document.getElementById("server-response").submit()})),d.addEventListener("submit",(function(e){e.preventDefault(),Frames.submitCard()}))}},{key:"completePaymentUsingToken",value:function(e){var n=document.getElementById("pay-now-with-token");n.disabled=!0,n.querySelector("svg").classList.remove("hidden"),n.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}},{key:"handle",value:function(){var e=this;this.handlePaymentUsingCreditCard(),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(n){return n.addEventListener("click",e.handlePaymentUsingToken)})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",this.handlePaymentUsingCreditCard),document.getElementById("pay-now-with-token").addEventListener("click",this.completePaymentUsingToken)}}])&&e(t.prototype,a),d&&e(t,d),n}())).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!***************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/checkout-credit-card.js ***!
|
||||
\***************************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var CheckoutCreditCard = /*#__PURE__*/function () {
|
||||
function CheckoutCreditCard() {
|
||||
_classCallCheck(this, CheckoutCreditCard);
|
||||
|
||||
this.tokens = [];
|
||||
}
|
||||
|
||||
_createClass(CheckoutCreditCard, [{
|
||||
key: "mountFrames",
|
||||
value: function mountFrames() {
|
||||
console.log('Mount checkout frames..');
|
||||
}
|
||||
}, {
|
||||
key: "handlePaymentUsingToken",
|
||||
value: function handlePaymentUsingToken(e) {
|
||||
document.getElementById('checkout--container').classList.add('hidden');
|
||||
document.getElementById('pay-now-with-token--container').classList.remove('hidden');
|
||||
document.getElementById('save-card--container').style.display = 'none';
|
||||
document.querySelector('input[name=token]').value = e.target.dataset.token;
|
||||
}
|
||||
}, {
|
||||
key: "handlePaymentUsingCreditCard",
|
||||
value: function handlePaymentUsingCreditCard(e) {
|
||||
var _document$querySelect;
|
||||
|
||||
document.getElementById('checkout--container').classList.remove('hidden');
|
||||
document.getElementById('pay-now-with-token--container').classList.add('hidden');
|
||||
document.getElementById('save-card--container').style.display = 'grid';
|
||||
document.querySelector('input[name=token]').value = '';
|
||||
var payButton = document.getElementById('pay-button');
|
||||
var publicKey = (_document$querySelect = document.querySelector('meta[name="public-key"]').content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
|
||||
var form = document.getElementById('payment-form');
|
||||
Frames.init(publicKey);
|
||||
Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED, function (event) {
|
||||
payButton.disabled = !Frames.isCardValid();
|
||||
});
|
||||
Frames.addEventHandler(Frames.Events.CARD_TOKENIZATION_FAILED, function (event) {
|
||||
pay.button.disabled = false;
|
||||
});
|
||||
Frames.addEventHandler(Frames.Events.CARD_TOKENIZED, function (event) {
|
||||
payButton.disabled = true;
|
||||
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(event);
|
||||
document.querySelector('input[name="store_card"]').value = document.querySelector('input[name=token-billing-checkbox]:checked').value;
|
||||
document.getElementById('server-response').submit();
|
||||
});
|
||||
form.addEventListener('submit', function (event) {
|
||||
event.preventDefault();
|
||||
Frames.submitCard();
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "completePaymentUsingToken",
|
||||
value: function completePaymentUsingToken(e) {
|
||||
var btn = document.getElementById('pay-now-with-token');
|
||||
btn.disabled = true;
|
||||
btn.querySelector('svg').classList.remove('hidden');
|
||||
btn.querySelector('span').classList.add('hidden');
|
||||
document.getElementById('server-response').submit();
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this = this;
|
||||
|
||||
this.handlePaymentUsingCreditCard();
|
||||
Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) {
|
||||
return element.addEventListener('click', _this.handlePaymentUsingToken);
|
||||
});
|
||||
document.getElementById('toggle-payment-with-credit-card').addEventListener('click', this.handlePaymentUsingCreditCard);
|
||||
document.getElementById('pay-now-with-token').addEventListener('click', this.completePaymentUsingToken);
|
||||
}
|
||||
}]);
|
||||
|
||||
return CheckoutCreditCard;
|
||||
}();
|
||||
|
||||
new CheckoutCreditCard().handle();
|
||||
/******/ })()
|
||||
;
|
380
public/js/clients/payments/eway-credit-card.js
vendored
380
public/js/clients/payments/eway-credit-card.js
vendored
File diff suppressed because one or more lines are too long
157
public/js/clients/payments/mollie-credit-card.js
vendored
157
public/js/clients/payments/mollie-credit-card.js
vendored
@ -1,2 +1,155 @@
|
||||
/*! For license information please see mollie-credit-card.js.LICENSE.txt */
|
||||
(()=>{function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(new(function(){function t(){var e,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.mollie=Mollie(null===(e=document.querySelector("meta[name=mollie-profileId]"))||void 0===e?void 0:e.content,{testmode:null===(n=document.querySelector("meta[name=mollie-testmode]"))||void 0===n?void 0:n.content,locale:"en_US"})}var n,r,o;return n=t,(r=[{key:"createCardHolderInput",value:function(){var e=this.mollie.createComponent("cardHolder");e.mount("#card-holder");var t=document.getElementById("card-holder-error");return e.addEventListener("change",(function(e){e.error&&e.touched?t.textContent=e.error:t.textContent=""})),this}},{key:"createCardNumberInput",value:function(){var e=this.mollie.createComponent("cardNumber");e.mount("#card-number");var t=document.getElementById("card-number-error");return e.addEventListener("change",(function(e){e.error&&e.touched?t.textContent=e.error:t.textContent=""})),this}},{key:"createExpiryDateInput",value:function(){var e=this.mollie.createComponent("expiryDate");e.mount("#expiry-date");var t=document.getElementById("expiry-date-error");return e.addEventListener("change",(function(e){e.error&&e.touched?t.textContent=e.error:t.textContent=""})),this}},{key:"createCvvInput",value:function(){var e=this.mollie.createComponent("verificationCode");e.mount("#cvv");var t=document.getElementById("cvv-error");return e.addEventListener("change",(function(e){e.error&&e.touched?t.textContent=e.error:t.textContent=""})),this}},{key:"handlePayNowButton",value:function(){if(document.getElementById("pay-now").disabled=!0,""!==document.querySelector("input[name=token]").value)return document.querySelector("input[name=gateway_response]").value="",document.getElementById("server-response").submit();this.mollie.createToken().then((function(e){var t=e.token,n=e.error;if(n){document.getElementById("pay-now").disabled=!1;var r=document.getElementById("errors");return r.innerText=n.message,void(r.hidden=!1)}var o=document.querySelector('input[name="token-billing-checkbox"]:checked');o&&(document.querySelector('input[name="store_card"]').value=o.value),document.querySelector("input[name=gateway_response]").value=t,document.querySelector("input[name=token]").value="",document.getElementById("server-response").submit()}))}},{key:"handle",value:function(){var e=this;this.createCardHolderInput().createCardNumberInput().createExpiryDateInput().createCvvInput(),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("mollie--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token}))})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",(function(e){document.getElementById("mollie--payment-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""})),document.getElementById("pay-now").addEventListener("click",(function(){return e.handlePayNowButton()}))}}])&&e(n.prototype,r),o&&e(n,o),t}())).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!*************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/mollie-credit-card.js ***!
|
||||
\*************************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
var _Mollie = /*#__PURE__*/function () {
|
||||
function _Mollie() {
|
||||
var _document$querySelect, _document$querySelect2;
|
||||
|
||||
_classCallCheck(this, _Mollie);
|
||||
|
||||
this.mollie = Mollie((_document$querySelect = document.querySelector('meta[name=mollie-profileId]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content, {
|
||||
testmode: (_document$querySelect2 = document.querySelector('meta[name=mollie-testmode]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content,
|
||||
locale: 'en_US'
|
||||
});
|
||||
}
|
||||
|
||||
_createClass(_Mollie, [{
|
||||
key: "createCardHolderInput",
|
||||
value: function createCardHolderInput() {
|
||||
var cardHolder = this.mollie.createComponent('cardHolder');
|
||||
cardHolder.mount('#card-holder');
|
||||
var cardHolderError = document.getElementById('card-holder-error');
|
||||
cardHolder.addEventListener('change', function (event) {
|
||||
if (event.error && event.touched) {
|
||||
cardHolderError.textContent = event.error;
|
||||
} else {
|
||||
cardHolderError.textContent = '';
|
||||
}
|
||||
});
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "createCardNumberInput",
|
||||
value: function createCardNumberInput() {
|
||||
var cardNumber = this.mollie.createComponent('cardNumber');
|
||||
cardNumber.mount('#card-number');
|
||||
var cardNumberError = document.getElementById('card-number-error');
|
||||
cardNumber.addEventListener('change', function (event) {
|
||||
if (event.error && event.touched) {
|
||||
cardNumberError.textContent = event.error;
|
||||
} else {
|
||||
cardNumberError.textContent = '';
|
||||
}
|
||||
});
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "createExpiryDateInput",
|
||||
value: function createExpiryDateInput() {
|
||||
var expiryDate = this.mollie.createComponent('expiryDate');
|
||||
expiryDate.mount('#expiry-date');
|
||||
var expiryDateError = document.getElementById('expiry-date-error');
|
||||
expiryDate.addEventListener('change', function (event) {
|
||||
if (event.error && event.touched) {
|
||||
expiryDateError.textContent = event.error;
|
||||
} else {
|
||||
expiryDateError.textContent = '';
|
||||
}
|
||||
});
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "createCvvInput",
|
||||
value: function createCvvInput() {
|
||||
var verificationCode = this.mollie.createComponent('verificationCode');
|
||||
verificationCode.mount('#cvv');
|
||||
var verificationCodeError = document.getElementById('cvv-error');
|
||||
verificationCode.addEventListener('change', function (event) {
|
||||
if (event.error && event.touched) {
|
||||
verificationCodeError.textContent = event.error;
|
||||
} else {
|
||||
verificationCodeError.textContent = '';
|
||||
}
|
||||
});
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "handlePayNowButton",
|
||||
value: function handlePayNowButton() {
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
|
||||
if (document.querySelector('input[name=token]').value !== '') {
|
||||
document.querySelector('input[name=gateway_response]').value = '';
|
||||
return document.getElementById('server-response').submit();
|
||||
}
|
||||
|
||||
this.mollie.createToken().then(function (result) {
|
||||
var token = result.token;
|
||||
var error = result.error;
|
||||
|
||||
if (error) {
|
||||
document.getElementById('pay-now').disabled = false;
|
||||
var errorsContainer = document.getElementById('errors');
|
||||
errorsContainer.innerText = error.message;
|
||||
errorsContainer.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var tokenBillingCheckbox = document.querySelector('input[name="token-billing-checkbox"]:checked');
|
||||
|
||||
if (tokenBillingCheckbox) {
|
||||
document.querySelector('input[name="store_card"]').value = tokenBillingCheckbox.value;
|
||||
}
|
||||
|
||||
document.querySelector('input[name=gateway_response]').value = token;
|
||||
document.querySelector('input[name=token]').value = '';
|
||||
document.getElementById('server-response').submit();
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this = this;
|
||||
|
||||
this.createCardHolderInput().createCardNumberInput().createExpiryDateInput().createCvvInput();
|
||||
Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) {
|
||||
return element.addEventListener('click', function (element) {
|
||||
document.getElementById('mollie--payment-container').classList.add('hidden');
|
||||
document.getElementById('save-card--container').style.display = 'none';
|
||||
document.querySelector('input[name=token]').value = element.target.dataset.token;
|
||||
});
|
||||
});
|
||||
document.getElementById('toggle-payment-with-credit-card').addEventListener('click', function (element) {
|
||||
document.getElementById('mollie--payment-container').classList.remove('hidden');
|
||||
document.getElementById('save-card--container').style.display = 'grid';
|
||||
document.querySelector('input[name=token]').value = '';
|
||||
});
|
||||
document.getElementById('pay-now').addEventListener('click', function () {
|
||||
return _this.handlePayNowButton();
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return _Mollie;
|
||||
}();
|
||||
|
||||
new _Mollie().handle();
|
||||
/******/ })()
|
||||
;
|
176
public/js/clients/payments/paytrace-credit-card.js
vendored
176
public/js/clients/payments/paytrace-credit-card.js
vendored
@ -1,2 +1,174 @@
|
||||
/*! For license information please see paytrace-credit-card.js.LICENSE.txt */
|
||||
(()=>{function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(new(function(){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.clientKey=null===(e=document.querySelector("meta[name=paytrace-client-key]"))||void 0===e?void 0:e.content}var n,o,r;return n=t,(o=[{key:"creditCardStyles",get:function(){return{font_color:"#111827",border_color:"rgba(210,214,220,1)",label_color:"#111827",label_size:"12pt",background_color:"white",border_style:"solid",font_size:"15pt",height:"30px",width:"100%"}}},{key:"codeStyles",get:function(){return{font_color:"#111827",border_color:"rgba(210,214,220,1)",label_color:"#111827",label_size:"12pt",background_color:"white",border_style:"solid",font_size:"15pt",height:"30px",width:"300px"}}},{key:"expStyles",get:function(){return{font_color:"#111827",border_color:"rgba(210,214,220,1)",label_color:"#111827",label_size:"12pt",background_color:"white",border_style:"solid",font_size:"15pt",height:"30px",width:"85px",type:"dropdown"}}},{key:"updatePayTraceLabels",value:function(){window.PTPayment.getControl("securityCode").label.text(document.querySelector("meta[name=ctrans-cvv]").content),window.PTPayment.getControl("creditCard").label.text(document.querySelector("meta[name=ctrans-card_number]").content),window.PTPayment.getControl("expiration").label.text(document.querySelector("meta[name=ctrans-expires]").content)}},{key:"setupPayTrace",value:function(){return window.PTPayment.setup({styles:{code:this.codeStyles,cc:this.creditCardStyles,exp:this.expStyles},authorization:{clientKey:this.clientKey}})}},{key:"handlePaymentWithCreditCard",value:function(e){var t=this;e.target.parentElement.disabled=!0,document.getElementById("errors").hidden=!0,window.PTPayment.validate((function(n){if(n.length>=1){var o=document.getElementById("errors");return o.textContent=n[0].description,o.hidden=!1,e.target.parentElement.disabled=!1}t.ptInstance.process().then((function(e){document.getElementById("HPF_Token").value=e.message.hpf_token,document.getElementById("enc_key").value=e.message.enc_key;var t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server_response").submit()})).catch((function(e){document.getElementById("errors").textContent=JSON.stringify(e),document.getElementById("errors").hidden=!1,console.log(e)}))}))}},{key:"handlePaymentWithToken",value:function(e){e.target.parentElement.disabled=!0,document.getElementById("server_response").submit()}},{key:"handle",value:function(){var e,t=this;Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("paytrace--credit-card-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token}))})),null===(e=document.getElementById("toggle-payment-with-credit-card"))||void 0===e||e.addEventListener("click",(function(e){document.getElementById("paytrace--credit-card-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="",t.setupPayTrace().then((function(e){t.ptInstance=e,t.updatePayTraceLabels()}))})),document.getElementById("pay-now").addEventListener("click",(function(e){return""===document.querySelector("input[name=token]").value?t.handlePaymentWithCreditCard(e):t.handlePaymentWithToken(e)}))}}])&&e(n.prototype,o),r&&e(n,r),t}())).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!***************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/paytrace-credit-card.js ***!
|
||||
\***************************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
var PayTraceCreditCard = /*#__PURE__*/function () {
|
||||
function PayTraceCreditCard() {
|
||||
var _document$querySelect;
|
||||
|
||||
_classCallCheck(this, PayTraceCreditCard);
|
||||
|
||||
this.clientKey = (_document$querySelect = document.querySelector('meta[name=paytrace-client-key]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content;
|
||||
}
|
||||
|
||||
_createClass(PayTraceCreditCard, [{
|
||||
key: "creditCardStyles",
|
||||
get: function get() {
|
||||
return {
|
||||
font_color: '#111827',
|
||||
border_color: 'rgba(210,214,220,1)',
|
||||
label_color: '#111827',
|
||||
label_size: '12pt',
|
||||
background_color: 'white',
|
||||
border_style: 'solid',
|
||||
font_size: '15pt',
|
||||
height: '30px',
|
||||
width: '100%'
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: "codeStyles",
|
||||
get: function get() {
|
||||
return {
|
||||
font_color: '#111827',
|
||||
border_color: 'rgba(210,214,220,1)',
|
||||
label_color: '#111827',
|
||||
label_size: '12pt',
|
||||
background_color: 'white',
|
||||
border_style: 'solid',
|
||||
font_size: '15pt',
|
||||
height: '30px',
|
||||
width: '300px'
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: "expStyles",
|
||||
get: function get() {
|
||||
return {
|
||||
font_color: '#111827',
|
||||
border_color: 'rgba(210,214,220,1)',
|
||||
label_color: '#111827',
|
||||
label_size: '12pt',
|
||||
background_color: 'white',
|
||||
border_style: 'solid',
|
||||
font_size: '15pt',
|
||||
height: '30px',
|
||||
width: '85px',
|
||||
type: 'dropdown'
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: "updatePayTraceLabels",
|
||||
value: function updatePayTraceLabels() {
|
||||
window.PTPayment.getControl('securityCode').label.text(document.querySelector('meta[name=ctrans-cvv]').content);
|
||||
window.PTPayment.getControl('creditCard').label.text(document.querySelector('meta[name=ctrans-card_number]').content);
|
||||
window.PTPayment.getControl('expiration').label.text(document.querySelector('meta[name=ctrans-expires]').content);
|
||||
}
|
||||
}, {
|
||||
key: "setupPayTrace",
|
||||
value: function setupPayTrace() {
|
||||
return window.PTPayment.setup({
|
||||
styles: {
|
||||
code: this.codeStyles,
|
||||
cc: this.creditCardStyles,
|
||||
exp: this.expStyles
|
||||
},
|
||||
authorization: {
|
||||
clientKey: this.clientKey
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handlePaymentWithCreditCard",
|
||||
value: function handlePaymentWithCreditCard(event) {
|
||||
var _this = this;
|
||||
|
||||
event.target.parentElement.disabled = true;
|
||||
document.getElementById('errors').hidden = true;
|
||||
window.PTPayment.validate(function (errors) {
|
||||
if (errors.length >= 1) {
|
||||
var errorsContainer = document.getElementById('errors');
|
||||
errorsContainer.textContent = errors[0].description;
|
||||
errorsContainer.hidden = false;
|
||||
return event.target.parentElement.disabled = false;
|
||||
}
|
||||
|
||||
_this.ptInstance.process().then(function (response) {
|
||||
document.getElementById('HPF_Token').value = response.message.hpf_token;
|
||||
document.getElementById('enc_key').value = response.message.enc_key;
|
||||
var tokenBillingCheckbox = document.querySelector('input[name="token-billing-checkbox"]:checked');
|
||||
|
||||
if (tokenBillingCheckbox) {
|
||||
document.querySelector('input[name="store_card"]').value = tokenBillingCheckbox.value;
|
||||
}
|
||||
|
||||
document.getElementById('server_response').submit();
|
||||
})["catch"](function (error) {
|
||||
document.getElementById('errors').textContent = JSON.stringify(error);
|
||||
document.getElementById('errors').hidden = false;
|
||||
console.log(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handlePaymentWithToken",
|
||||
value: function handlePaymentWithToken(event) {
|
||||
event.target.parentElement.disabled = true;
|
||||
document.getElementById('server_response').submit();
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _document$getElementB,
|
||||
_this2 = this;
|
||||
|
||||
Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) {
|
||||
return element.addEventListener('click', function (element) {
|
||||
document.getElementById('paytrace--credit-card-container').classList.add('hidden');
|
||||
document.getElementById('save-card--container').style.display = 'none';
|
||||
document.querySelector('input[name=token]').value = element.target.dataset.token;
|
||||
});
|
||||
});
|
||||
(_document$getElementB = document.getElementById('toggle-payment-with-credit-card')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.addEventListener('click', function (element) {
|
||||
document.getElementById('paytrace--credit-card-container').classList.remove('hidden');
|
||||
document.getElementById('save-card--container').style.display = 'grid';
|
||||
document.querySelector('input[name=token]').value = '';
|
||||
|
||||
_this2.setupPayTrace().then(function (instance) {
|
||||
_this2.ptInstance = instance;
|
||||
|
||||
_this2.updatePayTraceLabels();
|
||||
});
|
||||
});
|
||||
document.getElementById('pay-now').addEventListener('click', function (e) {
|
||||
if (document.querySelector('input[name=token]').value === '') {
|
||||
return _this2.handlePaymentWithCreditCard(e);
|
||||
}
|
||||
|
||||
return _this2.handlePaymentWithToken(e);
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return PayTraceCreditCard;
|
||||
}();
|
||||
|
||||
new PayTraceCreditCard().handle();
|
||||
/******/ })()
|
||||
;
|
34
public/js/clients/payments/razorpay-aio.js
vendored
34
public/js/clients/payments/razorpay-aio.js
vendored
@ -1,2 +1,32 @@
|
||||
/*! For license information please see razorpay-aio.js.LICENSE.txt */
|
||||
(()=>{var e,n=JSON.parse(null===(e=document.querySelector("meta[name=razorpay-options]"))||void 0===e?void 0:e.content);n.handler=function(e){document.getElementById("razorpay_payment_id").value=e.razorpay_payment_id,document.getElementById("razorpay_signature").value=e.razorpay_signature,document.getElementById("server-response").submit()};var t=new Razorpay(n);document.getElementById("pay-now").onclick=function(e){e.target.parentElement.disabled=!0,t.open()}})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!*******************************************************!*\
|
||||
!*** ./resources/js/clients/payments/razorpay-aio.js ***!
|
||||
\*******************************************************/
|
||||
var _document$querySelect;
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var options = JSON.parse((_document$querySelect = document.querySelector('meta[name=razorpay-options]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content);
|
||||
|
||||
options.handler = function (response) {
|
||||
document.getElementById('razorpay_payment_id').value = response.razorpay_payment_id;
|
||||
document.getElementById('razorpay_signature').value = response.razorpay_signature;
|
||||
document.getElementById('server-response').submit();
|
||||
};
|
||||
|
||||
var razorpay = new Razorpay(options);
|
||||
|
||||
document.getElementById('pay-now').onclick = function (event) {
|
||||
event.target.parentElement.disabled = true;
|
||||
razorpay.open();
|
||||
};
|
||||
/******/ })()
|
||||
;
|
1160
public/js/clients/payments/square-credit-card.js
vendored
1160
public/js/clients/payments/square-credit-card.js
vendored
File diff suppressed because one or more lines are too long
101
public/js/clients/payments/stripe-ach.js
vendored
101
public/js/clients/payments/stripe-ach.js
vendored
@ -1,2 +1,99 @@
|
||||
/*! For license information please see stripe-ach.js.LICENSE.txt */
|
||||
(()=>{function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(new(function(){function n(){var e,r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t(this,"setupStripe",(function(){return r.stripe=Stripe(r.key),r.stripe_connect&&(r.stripe.stripeAccount=r.stripe_connect),r})),t(this,"getFormData",(function(){return{country:document.getElementById("country").value,currency:document.getElementById("currency").value,routing_number:document.getElementById("routing-number").value,account_number:document.getElementById("account-number").value,account_holder_name:document.getElementById("account-holder-name").value,account_holder_type:document.querySelector('input[name="account-holder-type"]:checked').value}})),t(this,"handleError",(function(e){document.getElementById("save-button").disabled=!1,document.querySelector("#save-button > svg").classList.add("hidden"),document.querySelector("#save-button > span").classList.remove("hidden"),r.errors.textContent="",r.errors.textContent=e,r.errors.hidden=!1})),t(this,"handleSuccess",(function(e){document.getElementById("gateway_response").value=JSON.stringify(e),document.getElementById("server_response").submit()})),t(this,"handleSubmit",(function(e){document.getElementById("save-button").disabled=!0,document.querySelector("#save-button > svg").classList.remove("hidden"),document.querySelector("#save-button > span").classList.add("hidden"),e.preventDefault(),r.errors.textContent="",r.errors.hidden=!0,r.stripe.createToken("bank_account",r.getFormData()).then((function(e){return e.hasOwnProperty("error")?r.handleError(e.error.message):r.handleSuccess(e)}))})),this.errors=document.getElementById("errors"),this.key=document.querySelector('meta[name="stripe-publishable-key"]').content,this.stripe_connect=null===(e=document.querySelector('meta[name="stripe-account-id"]'))||void 0===e?void 0:e.content}var r,o,u;return r=n,(o=[{key:"handle",value:function(){var e=this;document.getElementById("save-button").addEventListener("click",(function(t){return e.handleSubmit(t)}))}}])&&e(r.prototype,o),u&&e(r,u),n}())).setupStripe().handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!*****************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-ach.js ***!
|
||||
\*****************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var AuthorizeACH = /*#__PURE__*/function () {
|
||||
function AuthorizeACH() {
|
||||
var _this = this,
|
||||
_document$querySelect;
|
||||
|
||||
_classCallCheck(this, AuthorizeACH);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
if (_this.stripe_connect) _this.stripe.stripeAccount = _this.stripe_connect;
|
||||
return _this;
|
||||
});
|
||||
|
||||
_defineProperty(this, "getFormData", function () {
|
||||
return {
|
||||
country: document.getElementById('country').value,
|
||||
currency: document.getElementById('currency').value,
|
||||
routing_number: document.getElementById('routing-number').value,
|
||||
account_number: document.getElementById('account-number').value,
|
||||
account_holder_name: document.getElementById('account-holder-name').value,
|
||||
account_holder_type: document.querySelector('input[name="account-holder-type"]:checked').value
|
||||
};
|
||||
});
|
||||
|
||||
_defineProperty(this, "handleError", function (message) {
|
||||
document.getElementById('save-button').disabled = false;
|
||||
document.querySelector('#save-button > svg').classList.add('hidden');
|
||||
document.querySelector('#save-button > span').classList.remove('hidden');
|
||||
_this.errors.textContent = '';
|
||||
_this.errors.textContent = message;
|
||||
_this.errors.hidden = false;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handleSuccess", function (response) {
|
||||
document.getElementById('gateway_response').value = JSON.stringify(response);
|
||||
document.getElementById('server_response').submit();
|
||||
});
|
||||
|
||||
_defineProperty(this, "handleSubmit", function (e) {
|
||||
document.getElementById('save-button').disabled = true;
|
||||
document.querySelector('#save-button > svg').classList.remove('hidden');
|
||||
document.querySelector('#save-button > span').classList.add('hidden');
|
||||
e.preventDefault();
|
||||
_this.errors.textContent = '';
|
||||
_this.errors.hidden = true;
|
||||
|
||||
_this.stripe.createToken('bank_account', _this.getFormData()).then(function (result) {
|
||||
if (result.hasOwnProperty('error')) {
|
||||
return _this.handleError(result.error.message);
|
||||
}
|
||||
|
||||
return _this.handleSuccess(result);
|
||||
});
|
||||
});
|
||||
|
||||
this.errors = document.getElementById('errors');
|
||||
this.key = document.querySelector('meta[name="stripe-publishable-key"]').content;
|
||||
this.stripe_connect = (_document$querySelect = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content;
|
||||
}
|
||||
|
||||
_createClass(AuthorizeACH, [{
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this2 = this;
|
||||
|
||||
document.getElementById('save-button').addEventListener('click', function (e) {
|
||||
return _this2.handleSubmit(e);
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return AuthorizeACH;
|
||||
}();
|
||||
|
||||
new AuthorizeACH().setupStripe().handle();
|
||||
/******/ })()
|
||||
;
|
109
public/js/clients/payments/stripe-acss.js
vendored
109
public/js/clients/payments/stripe-acss.js
vendored
@ -1,2 +1,107 @@
|
||||
/*! For license information please see stripe-acss.js.LICENSE.txt */
|
||||
(()=>{var e,t,n,r;function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,"setupStripe",(function(){return r.stripe=Stripe(r.key),r.stripeConnect&&(r.stripe.stripeAccount=c),r})),a(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");return""===document.getElementById("acss-name").value?(document.getElementById("acss-name").focus(),t.textContent=document.querySelector("meta[name=translation-name-required]").content,void(t.hidden=!1)):""===document.getElementById("acss-email-address").value?(document.getElementById("acss-email-address").focus(),t.textContent=document.querySelector("meta[name=translation-email-required]").content,void(t.hidden=!1)):(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),void r.stripe.confirmAcssDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:document.getElementById("acss-name").value,email:document.getElementById("acss-email-address").value}}}).then((function(e){return e.error?r.handleFailure(e.error.message):r.handleSuccess(e)})))}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}var t,n,r;return t=e,(n=[{key:"handleSuccess",value:function(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent),document.getElementById("server-response").submit()}},{key:"handleFailure",value:function(e){var t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}])&&o(t.prototype,n),r&&o(t,r),e}(),i=null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",c=null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"";new d(i,c).setupStripe().handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!******************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-acss.js ***!
|
||||
\******************************************************/
|
||||
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessACSS = /*#__PURE__*/function () {
|
||||
function ProcessACSS(key, _stripeConnect) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ProcessACSS);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
if (_this.stripeConnect) _this.stripe.stripeAccount = stripeConnect;
|
||||
return _this;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
document.getElementById('pay-now').addEventListener('click', function (e) {
|
||||
var errors = document.getElementById('errors');
|
||||
|
||||
if (document.getElementById('acss-name').value === "") {
|
||||
document.getElementById('acss-name').focus();
|
||||
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
|
||||
errors.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.getElementById('acss-email-address').value === "") {
|
||||
document.getElementById('acss-email-address').focus();
|
||||
errors.textContent = document.querySelector('meta[name=translation-email-required]').content;
|
||||
errors.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
|
||||
_this.stripe.confirmAcssDebitPayment(document.querySelector('meta[name=pi-client-secret').content, {
|
||||
payment_method: {
|
||||
billing_details: {
|
||||
name: document.getElementById("acss-name").value,
|
||||
email: document.getElementById("acss-email-address").value
|
||||
}
|
||||
}
|
||||
}).then(function (result) {
|
||||
if (result.error) {
|
||||
return _this.handleFailure(result.error.message);
|
||||
}
|
||||
|
||||
return _this.handleSuccess(result);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.key = key;
|
||||
this.errors = document.getElementById('errors');
|
||||
this.stripeConnect = _stripeConnect;
|
||||
}
|
||||
|
||||
_createClass(ProcessACSS, [{
|
||||
key: "handleSuccess",
|
||||
value: function handleSuccess(result) {
|
||||
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(result.paymentIntent);
|
||||
document.getElementById('server-response').submit();
|
||||
}
|
||||
}, {
|
||||
key: "handleFailure",
|
||||
value: function handleFailure(message) {
|
||||
var errors = document.getElementById('errors');
|
||||
errors.textContent = '';
|
||||
errors.textContent = message;
|
||||
errors.hidden = false;
|
||||
document.getElementById('pay-now').disabled = false;
|
||||
document.querySelector('#pay-now > svg').classList.add('hidden');
|
||||
document.querySelector('#pay-now > span').classList.remove('hidden');
|
||||
}
|
||||
}]);
|
||||
|
||||
return ProcessACSS;
|
||||
}();
|
||||
|
||||
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
|
||||
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
|
||||
new ProcessACSS(publishableKey, stripeConnect).setupStripe().handle();
|
||||
/******/ })()
|
||||
;
|
72
public/js/clients/payments/stripe-alipay.js
vendored
72
public/js/clients/payments/stripe-alipay.js
vendored
@ -1,2 +1,70 @@
|
||||
/*! For license information please see stripe-alipay.js.LICENSE.txt */
|
||||
(()=>{var e,t,n,r;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}new function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,"setupStripe",(function(){return r.stripe=Stripe(r.key),r.stripeConnect&&(r.stripe.stripeAccount=r.stripeConnect),r})),o(this,"handle",(function(){var e={type:"alipay",amount:document.querySelector('meta[name="amount"]').content,currency:document.querySelector('meta[name="currency"]').content,redirect:{return_url:document.querySelector('meta[name="return-url"]').content}};document.getElementById("pay-now").addEventListener("click",(function(t){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden"),r.stripe.createSource(e).then((function(e){if(e.hasOwnProperty("source"))return window.location=e.source.redirect.url;document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.errors.textContent="",this.errors.textContent=e.error.message,this.errors.hidden=!1}))}))})),this.key=t,this.stripeConnect=n,this.errors=document.getElementById("errors")}(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"").setupStripe().handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!********************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-alipay.js ***!
|
||||
\********************************************************/
|
||||
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessAlipay = function ProcessAlipay(key, stripeConnect) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ProcessAlipay);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
if (_this.stripeConnect) _this.stripe.stripeAccount = _this.stripeConnect;
|
||||
return _this;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
var data = {
|
||||
type: 'alipay',
|
||||
amount: document.querySelector('meta[name="amount"]').content,
|
||||
currency: document.querySelector('meta[name="currency"]').content,
|
||||
redirect: {
|
||||
return_url: document.querySelector('meta[name="return-url"]').content
|
||||
}
|
||||
};
|
||||
document.getElementById('pay-now').addEventListener('click', function (e) {
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.add('hidden');
|
||||
document.querySelector('#pay-now > span').classList.remove('hidden');
|
||||
|
||||
_this.stripe.createSource(data).then(function (result) {
|
||||
if (result.hasOwnProperty('source')) {
|
||||
return window.location = result.source.redirect.url;
|
||||
}
|
||||
|
||||
document.getElementById('pay-now').disabled = false;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
this.errors.textContent = '';
|
||||
this.errors.textContent = result.error.message;
|
||||
this.errors.hidden = false;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.key = key;
|
||||
this.stripeConnect = stripeConnect;
|
||||
this.errors = document.getElementById('errors');
|
||||
};
|
||||
|
||||
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
|
||||
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
|
||||
new ProcessAlipay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
/******/ })()
|
||||
;
|
69
public/js/clients/payments/stripe-bancontact.js
vendored
69
public/js/clients/payments/stripe-bancontact.js
vendored
@ -1,2 +1,67 @@
|
||||
/*! For license information please see stripe-bancontact.js.LICENSE.txt */
|
||||
(()=>{var e,t,n,o;function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",c=null!==(n=null===(o=document.querySelector('meta[name="stripe-account-id"]'))||void 0===o?void 0:o.content)&&void 0!==n?n:"";new function e(t,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r(this,"setupStripe",(function(){return o.stripe=Stripe(o.key),o.stripeConnect&&(o.stripe.stripeAccount=c),o})),r(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");if(!document.getElementById("bancontact-name").value)return t.textContent=document.querySelector("meta[name=translation-name-required]").content,t.hidden=!1,void console.log("name");document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),o.stripe.confirmBancontactPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:document.getElementById("bancontact-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}(a,c).setupStripe().handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-bancontact.js ***!
|
||||
\************************************************************/
|
||||
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessBANCONTACTPay = function ProcessBANCONTACTPay(key, _stripeConnect) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ProcessBANCONTACTPay);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
if (_this.stripeConnect) _this.stripe.stripeAccount = stripeConnect;
|
||||
return _this;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
document.getElementById('pay-now').addEventListener('click', function (e) {
|
||||
var errors = document.getElementById('errors');
|
||||
|
||||
if (!document.getElementById('bancontact-name').value) {
|
||||
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
|
||||
errors.hidden = false;
|
||||
console.log("name");
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
|
||||
_this.stripe.confirmBancontactPayment(document.querySelector('meta[name=pi-client-secret').content, {
|
||||
payment_method: {
|
||||
billing_details: {
|
||||
name: document.getElementById("bancontact-name").value
|
||||
}
|
||||
},
|
||||
return_url: document.querySelector('meta[name="return-url"]').content
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.key = key;
|
||||
this.errors = document.getElementById('errors');
|
||||
this.stripeConnect = _stripeConnect;
|
||||
};
|
||||
|
||||
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
|
||||
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
|
||||
new ProcessBANCONTACTPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
/******/ })()
|
||||
;
|
151
public/js/clients/payments/stripe-becs.js
vendored
151
public/js/clients/payments/stripe-becs.js
vendored
@ -1,2 +1,149 @@
|
||||
/*! For license information please see stripe-becs.js.LICENSE.txt */
|
||||
(()=>{var e,t,n,o;function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=function(){function e(t,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"setupStripe",(function(){o.stripe=Stripe(o.key),o.stripeConnect&&(o.stripe.stripeAccount=i);var e=o.stripe.elements(),t={style:{base:{color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"},":-webkit-autofill":{color:"#32325d"}},invalid:{color:"#fa755a",iconColor:"#fa755a",":-webkit-autofill":{color:"#fa755a"}}},disabled:!1,hideIcon:!1,iconStyle:"default"};return o.auBankAccount=e.create("auBankAccount",t),o.auBankAccount.mount("#becs-iban"),o})),c(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");return""===document.getElementById("becs-name").value?(document.getElementById("becs-name").focus(),t.textContent=document.querySelector("meta[name=translation-name-required]").content,void(t.hidden=!1)):""===document.getElementById("becs-email-address").value?(document.getElementById("becs-email-address").focus(),t.textContent=document.querySelector("meta[name=translation-email-required]").content,void(t.hidden=!1)):document.getElementById("becs-mandate-acceptance").checked?(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),void o.stripe.confirmAuBecsDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{au_becs_debit:o.auBankAccount,billing_details:{name:document.getElementById("becs-name").value,email:document.getElementById("becs-email-address").value}}}).then((function(e){return e.error?o.handleFailure(e.error.message):o.handleSuccess(e)}))):(document.getElementById("becs-mandate-acceptance").focus(),t.textContent=document.querySelector("meta[name=translation-terms-required]").content,t.hidden=!1,void console.log("Terms"))}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}var t,n,o;return t=e,(n=[{key:"handleSuccess",value:function(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent),document.getElementById("server-response").submit()}},{key:"handleFailure",value:function(e){var t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}])&&a(t.prototype,n),o&&a(t,o),e}(),d=null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",i=null!==(n=null===(o=document.querySelector('meta[name="stripe-account-id"]'))||void 0===o?void 0:o.content)&&void 0!==n?n:"";new r(d,i).setupStripe().handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!******************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-becs.js ***!
|
||||
\******************************************************/
|
||||
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessBECS = /*#__PURE__*/function () {
|
||||
function ProcessBECS(key, _stripeConnect) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ProcessBECS);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
if (_this.stripeConnect) _this.stripe.stripeAccount = stripeConnect;
|
||||
|
||||
var elements = _this.stripe.elements();
|
||||
|
||||
var style = {
|
||||
base: {
|
||||
color: '#32325d',
|
||||
fontSize: '16px',
|
||||
'::placeholder': {
|
||||
color: '#aab7c4'
|
||||
},
|
||||
':-webkit-autofill': {
|
||||
color: '#32325d'
|
||||
}
|
||||
},
|
||||
invalid: {
|
||||
color: '#fa755a',
|
||||
iconColor: '#fa755a',
|
||||
':-webkit-autofill': {
|
||||
color: '#fa755a'
|
||||
}
|
||||
}
|
||||
};
|
||||
var options = {
|
||||
style: style,
|
||||
disabled: false,
|
||||
hideIcon: false,
|
||||
iconStyle: "default" // or "solid"
|
||||
|
||||
};
|
||||
_this.auBankAccount = elements.create("auBankAccount", options);
|
||||
|
||||
_this.auBankAccount.mount("#becs-iban");
|
||||
|
||||
return _this;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
document.getElementById('pay-now').addEventListener('click', function (e) {
|
||||
var errors = document.getElementById('errors');
|
||||
|
||||
if (document.getElementById('becs-name').value === "") {
|
||||
document.getElementById('becs-name').focus();
|
||||
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
|
||||
errors.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.getElementById('becs-email-address').value === "") {
|
||||
document.getElementById('becs-email-address').focus();
|
||||
errors.textContent = document.querySelector('meta[name=translation-email-required]').content;
|
||||
errors.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!document.getElementById('becs-mandate-acceptance').checked) {
|
||||
document.getElementById('becs-mandate-acceptance').focus();
|
||||
errors.textContent = document.querySelector('meta[name=translation-terms-required]').content;
|
||||
errors.hidden = false;
|
||||
console.log("Terms");
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
|
||||
_this.stripe.confirmAuBecsDebitPayment(document.querySelector('meta[name=pi-client-secret').content, {
|
||||
payment_method: {
|
||||
au_becs_debit: _this.auBankAccount,
|
||||
billing_details: {
|
||||
name: document.getElementById("becs-name").value,
|
||||
email: document.getElementById("becs-email-address").value
|
||||
}
|
||||
}
|
||||
}).then(function (result) {
|
||||
if (result.error) {
|
||||
return _this.handleFailure(result.error.message);
|
||||
}
|
||||
|
||||
return _this.handleSuccess(result);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.key = key;
|
||||
this.errors = document.getElementById('errors');
|
||||
this.stripeConnect = _stripeConnect;
|
||||
}
|
||||
|
||||
_createClass(ProcessBECS, [{
|
||||
key: "handleSuccess",
|
||||
value: function handleSuccess(result) {
|
||||
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(result.paymentIntent);
|
||||
document.getElementById('server-response').submit();
|
||||
}
|
||||
}, {
|
||||
key: "handleFailure",
|
||||
value: function handleFailure(message) {
|
||||
var errors = document.getElementById('errors');
|
||||
errors.textContent = '';
|
||||
errors.textContent = message;
|
||||
errors.hidden = false;
|
||||
document.getElementById('pay-now').disabled = false;
|
||||
document.querySelector('#pay-now > svg').classList.add('hidden');
|
||||
document.querySelector('#pay-now > span').classList.remove('hidden');
|
||||
}
|
||||
}]);
|
||||
|
||||
return ProcessBECS;
|
||||
}();
|
||||
|
||||
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
|
||||
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
|
||||
new ProcessBECS(publishableKey, stripeConnect).setupStripe().handle();
|
||||
/******/ })()
|
||||
;
|
124
public/js/clients/payments/stripe-browserpay.js
vendored
124
public/js/clients/payments/stripe-browserpay.js
vendored
@ -1,2 +1,122 @@
|
||||
/*! For license information please see stripe-browserpay.js.LICENSE.txt */
|
||||
(()=>{function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(new(function(){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.clientSecret=null===(e=document.querySelector("meta[name=stripe-pi-client-secret]"))||void 0===e?void 0:e.content}var n,r,o;return n=t,(r=[{key:"init",value:function(){var e,t,n={};return document.querySelector("meta[name=stripe-account-id]")&&(n.apiVersion="2020-08-27",n.stripeAccount=null===(t=document.querySelector("meta[name=stripe-account-id]"))||void 0===t?void 0:t.content),this.stripe=Stripe(null===(e=document.querySelector("meta[name=stripe-publishable-key]"))||void 0===e?void 0:e.content,n),this.elements=this.stripe.elements(),this}},{key:"createPaymentRequest",value:function(){return this.paymentRequest=this.stripe.paymentRequest(JSON.parse(document.querySelector("meta[name=payment-request-data").content)),this}},{key:"createPaymentRequestButton",value:function(){this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest})}},{key:"handlePaymentRequestEvents",value:function(e,t){document.querySelector("#errors").hidden=!0,this.paymentRequest.on("paymentmethod",(function(n){e.confirmCardPayment(t,{payment_method:n.paymentMethod.id},{handleActions:!1}).then((function(r){r.error?(n.complete("fail"),document.querySelector("#errors").innerText=r.error.message,document.querySelector("#errors").hidden=!1):(n.complete("success"),"requires_action"===r.paymentIntent.status?e.confirmCardPayment(t).then((function(e){e.error?(n.complete("fail"),document.querySelector("#errors").innerText=e.error.message,document.querySelector("#errors").hidden=!1):(document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent),document.getElementById("server-response").submit())})):(document.querySelector('input[name="gateway_response"]').value=JSON.stringify(r.paymentIntent),document.getElementById("server-response").submit()))}))}))}},{key:"handle",value:function(){var e=this;this.init().createPaymentRequest().createPaymentRequestButton(),this.paymentRequest.canMakePayment().then((function(t){var n;if(t)return e.paymentRequestButton.mount("#payment-request-button");document.querySelector("#errors").innerHTML=JSON.parse(null===(n=document.querySelector("meta[name=no-available-methods]"))||void 0===n?void 0:n.content),document.querySelector("#errors").hidden=!1})),this.handlePaymentRequestEvents(this.stripe,this.clientSecret)}}])&&e(n.prototype,r),o&&e(n,o),t}())).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-browserpay.js ***!
|
||||
\************************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var StripeBrowserPay = /*#__PURE__*/function () {
|
||||
function StripeBrowserPay() {
|
||||
var _document$querySelect;
|
||||
|
||||
_classCallCheck(this, StripeBrowserPay);
|
||||
|
||||
this.clientSecret = (_document$querySelect = document.querySelector('meta[name=stripe-pi-client-secret]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content;
|
||||
}
|
||||
|
||||
_createClass(StripeBrowserPay, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
var _document$querySelect3;
|
||||
|
||||
var config = {};
|
||||
|
||||
if (document.querySelector('meta[name=stripe-account-id]')) {
|
||||
var _document$querySelect2;
|
||||
|
||||
config.apiVersion = '2020-08-27';
|
||||
config.stripeAccount = (_document$querySelect2 = document.querySelector('meta[name=stripe-account-id]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content;
|
||||
}
|
||||
|
||||
this.stripe = Stripe((_document$querySelect3 = document.querySelector('meta[name=stripe-publishable-key]')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.content, config);
|
||||
this.elements = this.stripe.elements();
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "createPaymentRequest",
|
||||
value: function createPaymentRequest() {
|
||||
this.paymentRequest = this.stripe.paymentRequest(JSON.parse(document.querySelector('meta[name=payment-request-data').content));
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "createPaymentRequestButton",
|
||||
value: function createPaymentRequestButton() {
|
||||
this.paymentRequestButton = this.elements.create('paymentRequestButton', {
|
||||
paymentRequest: this.paymentRequest
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handlePaymentRequestEvents",
|
||||
value: function handlePaymentRequestEvents(stripe, clientSecret) {
|
||||
document.querySelector('#errors').hidden = true;
|
||||
this.paymentRequest.on('paymentmethod', function (ev) {
|
||||
stripe.confirmCardPayment(clientSecret, {
|
||||
payment_method: ev.paymentMethod.id
|
||||
}, {
|
||||
handleActions: false
|
||||
}).then(function (confirmResult) {
|
||||
if (confirmResult.error) {
|
||||
ev.complete('fail');
|
||||
document.querySelector('#errors').innerText = confirmResult.error.message;
|
||||
document.querySelector('#errors').hidden = false;
|
||||
} else {
|
||||
ev.complete('success');
|
||||
|
||||
if (confirmResult.paymentIntent.status === 'requires_action') {
|
||||
stripe.confirmCardPayment(clientSecret).then(function (result) {
|
||||
if (result.error) {
|
||||
ev.complete('fail');
|
||||
document.querySelector('#errors').innerText = result.error.message;
|
||||
document.querySelector('#errors').hidden = false;
|
||||
} else {
|
||||
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(result.paymentIntent);
|
||||
document.getElementById('server-response').submit();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(confirmResult.paymentIntent);
|
||||
document.getElementById('server-response').submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this = this;
|
||||
|
||||
this.init().createPaymentRequest().createPaymentRequestButton();
|
||||
this.paymentRequest.canMakePayment().then(function (result) {
|
||||
var _document$querySelect4;
|
||||
|
||||
if (result) {
|
||||
return _this.paymentRequestButton.mount('#payment-request-button');
|
||||
}
|
||||
|
||||
document.querySelector('#errors').innerHTML = JSON.parse((_document$querySelect4 = document.querySelector('meta[name=no-available-methods]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content);
|
||||
document.querySelector('#errors').hidden = false;
|
||||
});
|
||||
this.handlePaymentRequestEvents(this.stripe, this.clientSecret);
|
||||
}
|
||||
}]);
|
||||
|
||||
return StripeBrowserPay;
|
||||
}();
|
||||
|
||||
new StripeBrowserPay().handle();
|
||||
/******/ })()
|
||||
;
|
221
public/js/clients/payments/stripe-credit-card.js
vendored
221
public/js/clients/payments/stripe-credit-card.js
vendored
File diff suppressed because one or more lines are too long
89
public/js/clients/payments/stripe-eps.js
vendored
89
public/js/clients/payments/stripe-eps.js
vendored
@ -1,2 +1,87 @@
|
||||
/*! For license information please see stripe-eps.js.LICENSE.txt */
|
||||
(()=>{var e,t,n,r;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",i=null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"";new function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,"setupStripe",(function(){r.stripe=Stripe(r.key),r.stripeConnect&&(r.stripe.stripeAccount=i);var e=r.stripe.elements();return r.eps=e.create("epsBank",{style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}}),r.eps.mount("#eps-bank-element"),r})),o(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");if(!document.getElementById("eps-name").value)return t.textContent=document.querySelector("meta[name=translation-name-required]").content,t.hidden=!1,void console.log("name");document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmEpsPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{eps:r.eps,billing_details:{name:document.getElementById("ideal-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}(a,i).setupStripe().handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!*****************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-eps.js ***!
|
||||
\*****************************************************/
|
||||
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessEPSPay = function ProcessEPSPay(key, _stripeConnect) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ProcessEPSPay);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
if (_this.stripeConnect) _this.stripe.stripeAccount = stripeConnect;
|
||||
|
||||
var elements = _this.stripe.elements();
|
||||
|
||||
var options = {
|
||||
style: {
|
||||
base: {
|
||||
padding: '10px 12px',
|
||||
color: '#32325d',
|
||||
fontSize: '16px',
|
||||
'::placeholder': {
|
||||
color: '#aab7c4'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
_this.eps = elements.create('epsBank', options);
|
||||
|
||||
_this.eps.mount("#eps-bank-element");
|
||||
|
||||
return _this;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
document.getElementById('pay-now').addEventListener('click', function (e) {
|
||||
var errors = document.getElementById('errors');
|
||||
|
||||
if (!document.getElementById('eps-name').value) {
|
||||
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
|
||||
errors.hidden = false;
|
||||
console.log("name");
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
|
||||
_this.stripe.confirmEpsPayment(document.querySelector('meta[name=pi-client-secret').content, {
|
||||
payment_method: {
|
||||
eps: _this.eps,
|
||||
billing_details: {
|
||||
name: document.getElementById("ideal-name").value
|
||||
}
|
||||
},
|
||||
return_url: document.querySelector('meta[name="return-url"]').content
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.key = key;
|
||||
this.errors = document.getElementById('errors');
|
||||
this.stripeConnect = _stripeConnect;
|
||||
};
|
||||
|
||||
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
|
||||
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
|
||||
new ProcessEPSPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
/******/ })()
|
||||
;
|
69
public/js/clients/payments/stripe-giropay.js
vendored
69
public/js/clients/payments/stripe-giropay.js
vendored
@ -1,2 +1,67 @@
|
||||
/*! For license information please see stripe-giropay.js.LICENSE.txt */
|
||||
(()=>{var e,t,n,r;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",c=null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"";new function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,"setupStripe",(function(){return r.stripe=Stripe(r.key),r.stripeConnect&&(r.stripe.stripeAccount=c),r})),o(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");if(!document.getElementById("giropay-mandate-acceptance").checked)return t.textContent=document.querySelector("meta[name=translation-terms-required]").content,t.hidden=!1,void console.log("Terms");document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmGiropayPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:document.getElementById("giropay-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}(i,c).setupStripe().handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!*********************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-giropay.js ***!
|
||||
\*********************************************************/
|
||||
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessGiroPay = function ProcessGiroPay(key, _stripeConnect) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ProcessGiroPay);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
if (_this.stripeConnect) _this.stripe.stripeAccount = stripeConnect;
|
||||
return _this;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
document.getElementById('pay-now').addEventListener('click', function (e) {
|
||||
var errors = document.getElementById('errors');
|
||||
|
||||
if (!document.getElementById('giropay-mandate-acceptance').checked) {
|
||||
errors.textContent = document.querySelector('meta[name=translation-terms-required]').content;
|
||||
errors.hidden = false;
|
||||
console.log("Terms");
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
|
||||
_this.stripe.confirmGiropayPayment(document.querySelector('meta[name=pi-client-secret').content, {
|
||||
payment_method: {
|
||||
billing_details: {
|
||||
name: document.getElementById("giropay-name").value
|
||||
}
|
||||
},
|
||||
return_url: document.querySelector('meta[name="return-url"]').content
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.key = key;
|
||||
this.errors = document.getElementById('errors');
|
||||
this.stripeConnect = _stripeConnect;
|
||||
};
|
||||
|
||||
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
|
||||
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
|
||||
new ProcessGiroPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
/******/ })()
|
||||
;
|
89
public/js/clients/payments/stripe-ideal.js
vendored
89
public/js/clients/payments/stripe-ideal.js
vendored
@ -1,2 +1,87 @@
|
||||
/*! For license information please see stripe-ideal.js.LICENSE.txt */
|
||||
(()=>{var e,t,n,r;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",i=null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"";new function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,"setupStripe",(function(){r.stripe=Stripe(r.key),r.stripeConnect&&(r.stripe.stripeAccount=i);var e=r.stripe.elements();return r.ideal=e.create("idealBank",{style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}}),r.ideal.mount("#ideal-bank-element"),r})),o(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");if(!document.getElementById("ideal-name").value)return t.textContent=document.querySelector("meta[name=translation-name-required]").content,t.hidden=!1,void console.log("name");document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmIdealPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{ideal:r.ideal,billing_details:{name:document.getElementById("ideal-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}(a,i).setupStripe().handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!*******************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-ideal.js ***!
|
||||
\*******************************************************/
|
||||
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessIDEALPay = function ProcessIDEALPay(key, _stripeConnect) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ProcessIDEALPay);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
if (_this.stripeConnect) _this.stripe.stripeAccount = stripeConnect;
|
||||
|
||||
var elements = _this.stripe.elements();
|
||||
|
||||
var options = {
|
||||
style: {
|
||||
base: {
|
||||
padding: '10px 12px',
|
||||
color: '#32325d',
|
||||
fontSize: '16px',
|
||||
'::placeholder': {
|
||||
color: '#aab7c4'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
_this.ideal = elements.create('idealBank', options);
|
||||
|
||||
_this.ideal.mount("#ideal-bank-element");
|
||||
|
||||
return _this;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
document.getElementById('pay-now').addEventListener('click', function (e) {
|
||||
var errors = document.getElementById('errors');
|
||||
|
||||
if (!document.getElementById('ideal-name').value) {
|
||||
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
|
||||
errors.hidden = false;
|
||||
console.log("name");
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
|
||||
_this.stripe.confirmIdealPayment(document.querySelector('meta[name=pi-client-secret').content, {
|
||||
payment_method: {
|
||||
ideal: _this.ideal,
|
||||
billing_details: {
|
||||
name: document.getElementById("ideal-name").value
|
||||
}
|
||||
},
|
||||
return_url: document.querySelector('meta[name="return-url"]').content
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.key = key;
|
||||
this.errors = document.getElementById('errors');
|
||||
this.stripeConnect = _stripeConnect;
|
||||
};
|
||||
|
||||
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
|
||||
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
|
||||
new ProcessIDEALPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
/******/ })()
|
||||
;
|
110
public/js/clients/payments/stripe-przelewy24.js
vendored
110
public/js/clients/payments/stripe-przelewy24.js
vendored
@ -1,2 +1,108 @@
|
||||
/*! For license information please see stripe-przelewy24.js.LICENSE.txt */
|
||||
(()=>{var e,t,n,a;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",c=null!==(n=null===(a=document.querySelector('meta[name="stripe-account-id"]'))||void 0===a?void 0:a.content)&&void 0!==n?n:"";new function e(t,n){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,"setupStripe",(function(){a.stripe=Stripe(a.key),a.stripeConnect&&(a.stripe.stripeAccount=c);var e=a.stripe.elements();return a.p24bank=e.create("p24Bank",{style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}}),a.p24bank.mount("#p24-bank-element"),a})),o(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");return""===document.getElementById("p24-name").value?(document.getElementById("p24-name").focus(),t.textContent=document.querySelector("meta[name=translation-name-required]").content,void(t.hidden=!1)):""===document.getElementById("p24-email-address").value?(document.getElementById("p24-email-address").focus(),t.textContent=document.querySelector("meta[name=translation-email-required]").content,void(t.hidden=!1)):document.getElementById("p24-mandate-acceptance").checked?(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),void a.stripe.confirmP24Payment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{p24:a.p24bank,billing_details:{name:document.getElementById("p24-name").value,email:document.getElementById("p24-email-address").value}},payment_method_options:{p24:{tos_shown_and_accepted:document.getElementById("p24-mandate-acceptance").checked}},return_url:document.querySelector('meta[name="return-url"]').content})):(document.getElementById("p24-mandate-acceptance").focus(),t.textContent=document.querySelector("meta[name=translation-terms-required]").content,void(t.hidden=!1))}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}(d,c).setupStripe().handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-przelewy24.js ***!
|
||||
\************************************************************/
|
||||
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessPRZELEWY24 = function ProcessPRZELEWY24(key, _stripeConnect) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ProcessPRZELEWY24);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
if (_this.stripeConnect) _this.stripe.stripeAccount = stripeConnect;
|
||||
|
||||
var elements = _this.stripe.elements();
|
||||
|
||||
var options = {
|
||||
// Custom styling can be passed to options when creating an Element
|
||||
style: {
|
||||
base: {
|
||||
padding: '10px 12px',
|
||||
color: '#32325d',
|
||||
fontSize: '16px',
|
||||
'::placeholder': {
|
||||
color: '#aab7c4'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
_this.p24bank = elements.create('p24Bank', options);
|
||||
|
||||
_this.p24bank.mount('#p24-bank-element');
|
||||
|
||||
return _this;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
document.getElementById('pay-now').addEventListener('click', function (e) {
|
||||
var errors = document.getElementById('errors');
|
||||
|
||||
if (document.getElementById('p24-name').value === "") {
|
||||
document.getElementById('p24-name').focus();
|
||||
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
|
||||
errors.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.getElementById('p24-email-address').value === "") {
|
||||
document.getElementById('p24-email-address').focus();
|
||||
errors.textContent = document.querySelector('meta[name=translation-email-required]').content;
|
||||
errors.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!document.getElementById('p24-mandate-acceptance').checked) {
|
||||
document.getElementById('p24-mandate-acceptance').focus();
|
||||
errors.textContent = document.querySelector('meta[name=translation-terms-required]').content;
|
||||
errors.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
|
||||
_this.stripe.confirmP24Payment(document.querySelector('meta[name=pi-client-secret').content, {
|
||||
payment_method: {
|
||||
p24: _this.p24bank,
|
||||
billing_details: {
|
||||
name: document.getElementById('p24-name').value,
|
||||
email: document.getElementById('p24-email-address').value
|
||||
}
|
||||
},
|
||||
payment_method_options: {
|
||||
p24: {
|
||||
tos_shown_and_accepted: document.getElementById('p24-mandate-acceptance').checked
|
||||
}
|
||||
},
|
||||
return_url: document.querySelector('meta[name="return-url"]').content
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.key = key;
|
||||
this.errors = document.getElementById('errors');
|
||||
this.stripeConnect = _stripeConnect;
|
||||
};
|
||||
|
||||
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
|
||||
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
|
||||
new ProcessPRZELEWY24(publishableKey, stripeConnect).setupStripe().handle();
|
||||
/******/ })()
|
||||
;
|
194
public/js/clients/payments/stripe-sepa.js
vendored
194
public/js/clients/payments/stripe-sepa.js
vendored
@ -1,2 +1,192 @@
|
||||
/*! For license information please see stripe-sepa.js.LICENSE.txt */
|
||||
(()=>{var e,t,n,o;function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=function(){function e(t,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r(this,"setupStripe",(function(){o.stripe=Stripe(o.key),o.stripeConnect&&(o.stripe.stripeAccount=d);var e=o.stripe.elements(),t={style:{base:{color:"#32325d",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"},":-webkit-autofill":{color:"#32325d"}},invalid:{color:"#fa755a",iconColor:"#fa755a",":-webkit-autofill":{color:"#fa755a"}}},supportedCountries:["SEPA"],placeholderCountry:document.querySelector('meta[name="country"]').content};return o.iban=e.create("iban",t),o.iban.mount("#sepa-iban"),o})),r(this,"handle",(function(){var e=document.getElementById("errors");Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("stripe--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token}))})),document.getElementById("toggle-payment-with-new-bank-account").addEventListener("click",(function(e){document.getElementById("stripe--payment-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""})),document.getElementById("pay-now").addEventListener("click",(function(t){return 0!==document.querySelector("input[name=token]").value.length?(document.querySelector("#errors").hidden=!0,document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),void o.stripe.confirmSepaDebitSetup(document.querySelector("meta[name=si-client-secret").content,{payment_method:document.querySelector("input[name=token]").value}).then((function(e){if(!e.error)return document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.setupIntent),document.querySelector("#server-response").submit();console.error(error)})).catch((function(t){e.textContent=t,e.hidden=!1}))):""===document.getElementById("sepa-name").value?(document.getElementById("sepa-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,void(e.hidden=!1)):""===document.getElementById("sepa-email-address").value?(document.getElementById("sepa-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,void(e.hidden=!1)):document.getElementById("sepa-mandate-acceptance").checked?(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),void o.stripe.confirmSepaDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{sepa_debit:o.iban,billing_details:{name:document.getElementById("sepa-name").value,email:document.getElementById("sepa-email-address").value}}}).then((function(e){return e.error?o.handleFailure(e.error.message):o.handleSuccess(e)}))):(e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1,void console.log("Terms"))}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}var t,n,o;return t=e,(n=[{key:"handleSuccess",value:function(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);var t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server-response").submit()}},{key:"handleFailure",value:function(e){var t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}])&&a(t.prototype,n),o&&a(t,o),e}(),i=null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",d=null!==(n=null===(o=document.querySelector('meta[name="stripe-account-id"]'))||void 0===o?void 0:o.content)&&void 0!==n?n:"";new c(i,d).setupStripe().handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!******************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-sepa.js ***!
|
||||
\******************************************************/
|
||||
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessSEPA = /*#__PURE__*/function () {
|
||||
function ProcessSEPA(key, _stripeConnect) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ProcessSEPA);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
if (_this.stripeConnect) _this.stripe.stripeAccount = stripeConnect;
|
||||
|
||||
var elements = _this.stripe.elements();
|
||||
|
||||
var style = {
|
||||
base: {
|
||||
color: '#32325d',
|
||||
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
|
||||
fontSmoothing: 'antialiased',
|
||||
fontSize: '16px',
|
||||
'::placeholder': {
|
||||
color: '#aab7c4'
|
||||
},
|
||||
':-webkit-autofill': {
|
||||
color: '#32325d'
|
||||
}
|
||||
},
|
||||
invalid: {
|
||||
color: '#fa755a',
|
||||
iconColor: '#fa755a',
|
||||
':-webkit-autofill': {
|
||||
color: '#fa755a'
|
||||
}
|
||||
}
|
||||
};
|
||||
var options = {
|
||||
style: style,
|
||||
supportedCountries: ['SEPA'],
|
||||
// If you know the country of the customer, you can optionally pass it to
|
||||
// the Element as placeholderCountry. The example IBAN that is being used
|
||||
// as placeholder reflects the IBAN format of that country.
|
||||
placeholderCountry: document.querySelector('meta[name="country"]').content
|
||||
};
|
||||
_this.iban = elements.create('iban', options);
|
||||
|
||||
_this.iban.mount('#sepa-iban');
|
||||
|
||||
return _this;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
var errors = document.getElementById('errors');
|
||||
Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) {
|
||||
return element.addEventListener('click', function (element) {
|
||||
document.getElementById('stripe--payment-container').classList.add('hidden');
|
||||
document.getElementById('save-card--container').style.display = 'none';
|
||||
document.querySelector('input[name=token]').value = element.target.dataset.token;
|
||||
});
|
||||
});
|
||||
document.getElementById('toggle-payment-with-new-bank-account').addEventListener('click', function (element) {
|
||||
document.getElementById('stripe--payment-container').classList.remove('hidden');
|
||||
document.getElementById('save-card--container').style.display = 'grid';
|
||||
document.querySelector('input[name=token]').value = '';
|
||||
});
|
||||
document.getElementById('pay-now').addEventListener('click', function (e) {
|
||||
if (document.querySelector('input[name=token]').value.length !== 0) {
|
||||
document.querySelector('#errors').hidden = true;
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
|
||||
_this.stripe.confirmSepaDebitSetup(document.querySelector('meta[name=si-client-secret').content, {
|
||||
payment_method: document.querySelector('input[name=token]').value
|
||||
}).then(function (result) {
|
||||
if (result.error) {
|
||||
console.error(error);
|
||||
return;
|
||||
}
|
||||
|
||||
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(result.setupIntent);
|
||||
return document.querySelector('#server-response').submit();
|
||||
})["catch"](function (error) {
|
||||
errors.textContent = error;
|
||||
errors.hidden = false;
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.getElementById('sepa-name').value === '') {
|
||||
document.getElementById('sepa-name').focus();
|
||||
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
|
||||
errors.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.getElementById('sepa-email-address').value === '') {
|
||||
document.getElementById('sepa-email-address').focus();
|
||||
errors.textContent = document.querySelector('meta[name=translation-email-required]').content;
|
||||
errors.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!document.getElementById('sepa-mandate-acceptance').checked) {
|
||||
errors.textContent = document.querySelector('meta[name=translation-terms-required]').content;
|
||||
errors.hidden = false;
|
||||
console.log('Terms');
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
|
||||
_this.stripe.confirmSepaDebitPayment(document.querySelector('meta[name=pi-client-secret').content, {
|
||||
payment_method: {
|
||||
sepa_debit: _this.iban,
|
||||
billing_details: {
|
||||
name: document.getElementById('sepa-name').value,
|
||||
email: document.getElementById('sepa-email-address').value
|
||||
}
|
||||
}
|
||||
}).then(function (result) {
|
||||
if (result.error) {
|
||||
return _this.handleFailure(result.error.message);
|
||||
}
|
||||
|
||||
return _this.handleSuccess(result);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.key = key;
|
||||
this.errors = document.getElementById('errors');
|
||||
this.stripeConnect = _stripeConnect;
|
||||
}
|
||||
|
||||
_createClass(ProcessSEPA, [{
|
||||
key: "handleSuccess",
|
||||
value: function handleSuccess(result) {
|
||||
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(result.paymentIntent);
|
||||
var tokenBillingCheckbox = document.querySelector('input[name="token-billing-checkbox"]:checked');
|
||||
|
||||
if (tokenBillingCheckbox) {
|
||||
document.querySelector('input[name="store_card"]').value = tokenBillingCheckbox.value;
|
||||
}
|
||||
|
||||
document.getElementById('server-response').submit();
|
||||
}
|
||||
}, {
|
||||
key: "handleFailure",
|
||||
value: function handleFailure(message) {
|
||||
var errors = document.getElementById('errors');
|
||||
errors.textContent = '';
|
||||
errors.textContent = message;
|
||||
errors.hidden = false;
|
||||
document.getElementById('pay-now').disabled = false;
|
||||
document.querySelector('#pay-now > svg').classList.add('hidden');
|
||||
document.querySelector('#pay-now > span').classList.remove('hidden');
|
||||
}
|
||||
}]);
|
||||
|
||||
return ProcessSEPA;
|
||||
}();
|
||||
|
||||
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
|
||||
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
|
||||
new ProcessSEPA(publishableKey, stripeConnect).setupStripe().handle();
|
||||
/******/ })()
|
||||
;
|
60
public/js/clients/payments/stripe-sofort.js
vendored
60
public/js/clients/payments/stripe-sofort.js
vendored
@ -1,2 +1,58 @@
|
||||
/*! For license information please see stripe-sofort.js.LICENSE.txt */
|
||||
(()=>{var e,t,n,r;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",i=null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"";new function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,"setupStripe",(function(){return r.stripe=Stripe(r.key),r.stripeConnect&&(r.stripe.stripeAccount=i),r})),o(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmSofortPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{sofort:{country:document.querySelector('meta[name="country"]').content}},return_url:document.querySelector('meta[name="return-url"]').content})}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}(c,i).setupStripe().handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!********************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-sofort.js ***!
|
||||
\********************************************************/
|
||||
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessSOFORT = function ProcessSOFORT(key, _stripeConnect) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ProcessSOFORT);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
if (_this.stripeConnect) _this.stripe.stripeAccount = stripeConnect;
|
||||
return _this;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
document.getElementById('pay-now').addEventListener('click', function (e) {
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||
|
||||
_this.stripe.confirmSofortPayment(document.querySelector('meta[name=pi-client-secret').content, {
|
||||
payment_method: {
|
||||
sofort: {
|
||||
country: document.querySelector('meta[name="country"]').content
|
||||
}
|
||||
},
|
||||
return_url: document.querySelector('meta[name="return-url"]').content
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.key = key;
|
||||
this.errors = document.getElementById('errors');
|
||||
this.stripeConnect = _stripeConnect;
|
||||
};
|
||||
|
||||
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
|
||||
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
|
||||
new ProcessSOFORT(publishableKey, stripeConnect).setupStripe().handle();
|
||||
/******/ })()
|
||||
;
|
218
public/js/clients/payments/wepay-credit-card.js
vendored
218
public/js/clients/payments/wepay-credit-card.js
vendored
File diff suppressed because one or more lines are too long
138
public/js/clients/quotes/action-selectors.js
vendored
138
public/js/clients/quotes/action-selectors.js
vendored
@ -1,2 +1,136 @@
|
||||
/*! For license information please see action-selectors.js.LICENSE.txt */
|
||||
(()=>{function e(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0,c=function(){};return{s:c,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(new(function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var r,o,c;return r=t,o=[{key:"watchCheckboxes",value:function(e){var t=this;document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),document.querySelectorAll(".form-check-child").forEach((function(n){e.checked?(n.checked=e.checked,t.processChildItem(n,document.getElementById("bulkActions"))):(n.checked=!1,document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})))}))}},{key:"processChildItem",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(r.hasOwnProperty("single")&&document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),!1!==t.checked){var o=document.createElement("INPUT");o.setAttribute("name","quotes[]"),o.setAttribute("value",t.dataset.value),o.setAttribute("class","child-hidden-input"),o.hidden=!0,n.append(o)}else{var c,i=document.querySelectorAll("input.child-hidden-input"),a=e(i);try{for(a.s();!(c=a.n()).done;){var u=c.value;u.value==t.dataset.value&&u.remove()}}catch(e){a.e(e)}finally{a.f()}}}},{key:"handle",value:function(){var t=this;this.parentElement.addEventListener("click",(function(){t.watchCheckboxes(t.parentElement)}));var n,r=e(document.querySelectorAll(".form-check-child"));try{var o=function(){var e=n.value;e.addEventListener("click",(function(){t.processChildItem(e,t.parentForm)}))};for(r.s();!(n=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}}}],o&&n(r.prototype,o),c&&n(r,c),t}())).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!*********************************************************!*\
|
||||
!*** ./resources/js/clients/quotes/action-selectors.js ***!
|
||||
\*********************************************************/
|
||||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
||||
|
||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ActionSelectors = /*#__PURE__*/function () {
|
||||
function ActionSelectors() {
|
||||
_classCallCheck(this, ActionSelectors);
|
||||
|
||||
this.parentElement = document.querySelector('.form-check-parent');
|
||||
this.parentForm = document.getElementById('bulkActions');
|
||||
}
|
||||
|
||||
_createClass(ActionSelectors, [{
|
||||
key: "watchCheckboxes",
|
||||
value: function watchCheckboxes(parentElement) {
|
||||
var _this = this;
|
||||
|
||||
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
|
||||
return element.remove();
|
||||
});
|
||||
document.querySelectorAll('.form-check-child').forEach(function (child) {
|
||||
if (parentElement.checked) {
|
||||
child.checked = parentElement.checked;
|
||||
|
||||
_this.processChildItem(child, document.getElementById('bulkActions'));
|
||||
} else {
|
||||
child.checked = false;
|
||||
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
|
||||
return element.remove();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "processChildItem",
|
||||
value: function processChildItem(element, parent) {
|
||||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
|
||||
if (options.hasOwnProperty('single')) {
|
||||
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
|
||||
return element.remove();
|
||||
});
|
||||
}
|
||||
|
||||
if (element.checked === false) {
|
||||
var inputs = document.querySelectorAll('input.child-hidden-input');
|
||||
|
||||
var _iterator = _createForOfIteratorHelper(inputs),
|
||||
_step;
|
||||
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var i = _step.value;
|
||||
if (i.value == element.dataset.value) i.remove();
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var _temp = document.createElement('INPUT');
|
||||
|
||||
_temp.setAttribute('name', 'quotes[]');
|
||||
|
||||
_temp.setAttribute('value', element.dataset.value);
|
||||
|
||||
_temp.setAttribute('class', 'child-hidden-input');
|
||||
|
||||
_temp.hidden = true;
|
||||
parent.append(_temp);
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this2 = this;
|
||||
|
||||
this.parentElement.addEventListener('click', function () {
|
||||
_this2.watchCheckboxes(_this2.parentElement);
|
||||
});
|
||||
|
||||
var _iterator2 = _createForOfIteratorHelper(document.querySelectorAll('.form-check-child')),
|
||||
_step2;
|
||||
|
||||
try {
|
||||
var _loop = function _loop() {
|
||||
var child = _step2.value;
|
||||
child.addEventListener('click', function () {
|
||||
_this2.processChildItem(child, _this2.parentForm);
|
||||
});
|
||||
};
|
||||
|
||||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
||||
_loop();
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator2.e(err);
|
||||
} finally {
|
||||
_iterator2.f();
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return ActionSelectors;
|
||||
}();
|
||||
/** @handle **/
|
||||
|
||||
|
||||
new ActionSelectors().handle();
|
||||
/******/ })()
|
||||
;
|
108
public/js/clients/quotes/approve.js
vendored
108
public/js/clients/quotes/approve.js
vendored
@ -1,2 +1,106 @@
|
||||
/*! For license information please see approve.js.LICENSE.txt */
|
||||
(()=>{function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var t=function(){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.shouldDisplaySignature=e,this.shouldDisplayTerms=n,this.termsAccepted=!1}var n,a,u;return n=t,(a=[{key:"submitForm",value:function(){document.getElementById("approve-form").submit()}},{key:"displaySignature",value:function(){document.getElementById("displaySignatureModal").removeAttribute("style");var e=new SignaturePad(document.getElementById("signature-pad"),{penColor:"rgb(0, 0, 0)"});this.signaturePad=e}},{key:"displayTerms",value:function(){document.getElementById("displayTermsModal").removeAttribute("style")}},{key:"handle",value:function(){var e=this;document.getElementById("approve-button").addEventListener("click",(function(){e.shouldDisplaySignature&&e.shouldDisplayTerms&&(e.displaySignature(),document.getElementById("signature-next-step").addEventListener("click",(function(){e.displayTerms(),document.getElementById("accept-terms-button").addEventListener("click",(function(){document.querySelector('input[name="signature"').value=e.signaturePad.toDataURL(),e.termsAccepted=!0,e.submitForm()}))}))),e.shouldDisplaySignature&&!e.shouldDisplayTerms&&(e.displaySignature(),document.getElementById("signature-next-step").addEventListener("click",(function(){document.querySelector('input[name="signature"').value=e.signaturePad.toDataURL(),e.submitForm()}))),!e.shouldDisplaySignature&&e.shouldDisplayTerms&&(e.displayTerms(),document.getElementById("accept-terms-button").addEventListener("click",(function(){e.termsAccepted=!0,e.submitForm()}))),e.shouldDisplaySignature||e.shouldDisplayTerms||e.submitForm()}))}}])&&e(n.prototype,a),u&&e(n,u),t}(),n=document.querySelector('meta[name="require-quote-signature"]').content,a=document.querySelector('meta[name="show-quote-terms"]').content;new t(Boolean(+n),Boolean(+a)).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!************************************************!*\
|
||||
!*** ./resources/js/clients/quotes/approve.js ***!
|
||||
\************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var Approve = /*#__PURE__*/function () {
|
||||
function Approve(displaySignature, displayTerms) {
|
||||
_classCallCheck(this, Approve);
|
||||
|
||||
this.shouldDisplaySignature = displaySignature;
|
||||
this.shouldDisplayTerms = displayTerms;
|
||||
this.termsAccepted = false;
|
||||
}
|
||||
|
||||
_createClass(Approve, [{
|
||||
key: "submitForm",
|
||||
value: function submitForm() {
|
||||
document.getElementById('approve-form').submit();
|
||||
}
|
||||
}, {
|
||||
key: "displaySignature",
|
||||
value: function displaySignature() {
|
||||
var displaySignatureModal = document.getElementById('displaySignatureModal');
|
||||
displaySignatureModal.removeAttribute('style');
|
||||
var signaturePad = new SignaturePad(document.getElementById('signature-pad'), {
|
||||
penColor: 'rgb(0, 0, 0)'
|
||||
});
|
||||
this.signaturePad = signaturePad;
|
||||
}
|
||||
}, {
|
||||
key: "displayTerms",
|
||||
value: function displayTerms() {
|
||||
var displayTermsModal = document.getElementById("displayTermsModal");
|
||||
displayTermsModal.removeAttribute("style");
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this = this;
|
||||
|
||||
document.getElementById('approve-button').addEventListener('click', function () {
|
||||
if (_this.shouldDisplaySignature && _this.shouldDisplayTerms) {
|
||||
_this.displaySignature();
|
||||
|
||||
document.getElementById('signature-next-step').addEventListener('click', function () {
|
||||
_this.displayTerms();
|
||||
|
||||
document.getElementById('accept-terms-button').addEventListener('click', function () {
|
||||
document.querySelector('input[name="signature"').value = _this.signaturePad.toDataURL();
|
||||
_this.termsAccepted = true;
|
||||
|
||||
_this.submitForm();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (_this.shouldDisplaySignature && !_this.shouldDisplayTerms) {
|
||||
_this.displaySignature();
|
||||
|
||||
document.getElementById('signature-next-step').addEventListener('click', function () {
|
||||
document.querySelector('input[name="signature"').value = _this.signaturePad.toDataURL();
|
||||
|
||||
_this.submitForm();
|
||||
});
|
||||
}
|
||||
|
||||
if (!_this.shouldDisplaySignature && _this.shouldDisplayTerms) {
|
||||
_this.displayTerms();
|
||||
|
||||
document.getElementById('accept-terms-button').addEventListener('click', function () {
|
||||
_this.termsAccepted = true;
|
||||
|
||||
_this.submitForm();
|
||||
});
|
||||
}
|
||||
|
||||
if (!_this.shouldDisplaySignature && !_this.shouldDisplayTerms) {
|
||||
_this.submitForm();
|
||||
}
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return Approve;
|
||||
}();
|
||||
|
||||
var signature = document.querySelector('meta[name="require-quote-signature"]').content;
|
||||
var terms = document.querySelector('meta[name="show-quote-terms"]').content;
|
||||
new Approve(Boolean(+signature), Boolean(+terms)).handle();
|
||||
/******/ })()
|
||||
;
|
38
public/js/clients/shared/multiple-downloads.js
vendored
38
public/js/clients/shared/multiple-downloads.js
vendored
@ -1 +1,37 @@
|
||||
window.appendToElement=function(e,t){var n=document.getElementById(e),a=n.querySelector('input[value="'.concat(t,'"]'));if(a)return a.remove();var r=document.createElement("INPUT");r.setAttribute("name","file_hash[]"),r.setAttribute("value",t),r.hidden=!0,n.append(r)};
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!***********************************************************!*\
|
||||
!*** ./resources/js/clients/shared/multiple-downloads.js ***!
|
||||
\***********************************************************/
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var appendToElement = function appendToElement(parent, value) {
|
||||
var _parent = document.getElementById(parent);
|
||||
|
||||
var _possibleElement = _parent.querySelector("input[value=\"".concat(value, "\"]"));
|
||||
|
||||
if (_possibleElement) {
|
||||
return _possibleElement.remove();
|
||||
}
|
||||
|
||||
var _temp = document.createElement('INPUT');
|
||||
|
||||
_temp.setAttribute('name', 'file_hash[]');
|
||||
|
||||
_temp.setAttribute('value', value);
|
||||
|
||||
_temp.hidden = true;
|
||||
|
||||
_parent.append(_temp);
|
||||
};
|
||||
|
||||
window.appendToElement = appendToElement;
|
||||
/******/ })()
|
||||
;
|
1037
public/js/clients/shared/pdf.js
vendored
1037
public/js/clients/shared/pdf.js
vendored
File diff suppressed because one or more lines are too long
104
public/js/clients/statements/view.js
vendored
104
public/js/clients/statements/view.js
vendored
@ -1,2 +1,102 @@
|
||||
/*! For license information please see view.js.LICENSE.txt */
|
||||
(()=>{function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(new(function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.url=new URL(document.querySelector("meta[name=pdf-url]").content),this.startDate="",this.endDate="",this.showPaymentsTable=!1,this.showAgingTable=!1}var a,n,r;return a=t,(n=[{key:"bindEventListeners",value:function(){var e=this;["#date-from","#date-to","#show-payments-table","#show-aging-table"].forEach((function(t){document.querySelector(t).addEventListener("change",(function(t){return e.handleValueChange(t)}))}))}},{key:"handleValueChange",value:function(e){"checkbox"===e.target.type?this[e.target.dataset.field]=e.target.checked:this[e.target.dataset.field]=e.target.value,this.updatePdf()}},{key:"composedUrl",get:function(){return this.url.search="",this.startDate.length>0&&this.url.searchParams.append("start_date",this.startDate),this.endDate.length>0&&this.url.searchParams.append("end_date",this.endDate),this.url.searchParams.append("show_payments_table",+this.showPaymentsTable),this.url.searchParams.append("show_aging_table",+this.showAgingTable),this.url.href}},{key:"updatePdf",value:function(){document.querySelector("meta[name=pdf-url]").content=this.composedUrl;var e=document.querySelector("#pdf-iframe");e&&(e.src=this.composedUrl),document.querySelector("meta[name=pdf-url]").dispatchEvent(new Event("change"))}},{key:"handle",value:function(){var e=this;this.bindEventListeners(),document.querySelector("#pdf-download").addEventListener("click",(function(){var t=new URL(e.composedUrl);t.searchParams.append("download",1),window.location.href=t.href}))}}])&&e(a.prototype,n),r&&e(a,r),t}())).handle()})();
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!*************************************************!*\
|
||||
!*** ./resources/js/clients/statements/view.js ***!
|
||||
\*************************************************/
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
var Statement = /*#__PURE__*/function () {
|
||||
function Statement() {
|
||||
_classCallCheck(this, Statement);
|
||||
|
||||
this.url = new URL(document.querySelector('meta[name=pdf-url]').content);
|
||||
this.startDate = '';
|
||||
this.endDate = '';
|
||||
this.showPaymentsTable = false;
|
||||
this.showAgingTable = false;
|
||||
}
|
||||
|
||||
_createClass(Statement, [{
|
||||
key: "bindEventListeners",
|
||||
value: function bindEventListeners() {
|
||||
var _this = this;
|
||||
|
||||
['#date-from', '#date-to', '#show-payments-table', '#show-aging-table'].forEach(function (selector) {
|
||||
document.querySelector(selector).addEventListener('change', function (event) {
|
||||
return _this.handleValueChange(event);
|
||||
});
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handleValueChange",
|
||||
value: function handleValueChange(event) {
|
||||
if (event.target.type === 'checkbox') {
|
||||
this[event.target.dataset.field] = event.target.checked;
|
||||
} else {
|
||||
this[event.target.dataset.field] = event.target.value;
|
||||
}
|
||||
|
||||
this.updatePdf();
|
||||
}
|
||||
}, {
|
||||
key: "composedUrl",
|
||||
get: function get() {
|
||||
this.url.search = '';
|
||||
|
||||
if (this.startDate.length > 0) {
|
||||
this.url.searchParams.append('start_date', this.startDate);
|
||||
}
|
||||
|
||||
if (this.endDate.length > 0) {
|
||||
this.url.searchParams.append('end_date', this.endDate);
|
||||
}
|
||||
|
||||
this.url.searchParams.append('show_payments_table', +this.showPaymentsTable);
|
||||
this.url.searchParams.append('show_aging_table', +this.showAgingTable);
|
||||
return this.url.href;
|
||||
}
|
||||
}, {
|
||||
key: "updatePdf",
|
||||
value: function updatePdf() {
|
||||
document.querySelector('meta[name=pdf-url]').content = this.composedUrl;
|
||||
var iframe = document.querySelector('#pdf-iframe');
|
||||
|
||||
if (iframe) {
|
||||
iframe.src = this.composedUrl;
|
||||
}
|
||||
|
||||
document.querySelector('meta[name=pdf-url]').dispatchEvent(new Event('change'));
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this2 = this;
|
||||
|
||||
this.bindEventListeners();
|
||||
document.querySelector('#pdf-download').addEventListener('click', function () {
|
||||
var url = new URL(_this2.composedUrl);
|
||||
url.searchParams.append('download', 1);
|
||||
window.location.href = url.href;
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return Statement;
|
||||
}();
|
||||
|
||||
new Statement().handle();
|
||||
/******/ })()
|
||||
;
|
2274
public/js/setup/setup.js
vendored
2274
public/js/setup/setup.js
vendored
File diff suppressed because one or more lines are too long
@ -1,42 +1,42 @@
|
||||
{
|
||||
"/js/app.js": "/js/app.js?id=0d1e02ebdcc97462d422",
|
||||
"/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=de4468c682d6861847de",
|
||||
"/js/clients/payments/authorize-credit-card-payment.js": "/js/clients/payments/authorize-credit-card-payment.js?id=cfe5de1cf87a0b01568d",
|
||||
"/js/clients/payments/stripe-ach.js": "/js/clients/payments/stripe-ach.js?id=5e74bc0d346beeb57ee9",
|
||||
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=6b79265cbb8c963eef19",
|
||||
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=5b79f72432f92a85fefa",
|
||||
"/js/clients/payments/stripe-sofort.js": "/js/clients/payments/stripe-sofort.js?id=926c7b9d1ee48bbf786b",
|
||||
"/js/clients/payments/stripe-alipay.js": "/js/clients/payments/stripe-alipay.js?id=1e159400d6a5ca4662c1",
|
||||
"/js/clients/payments/checkout-credit-card.js": "/js/clients/payments/checkout-credit-card.js?id=0b47ce36fe20191adb33",
|
||||
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=63f0688329be80ee8693",
|
||||
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=795d2f44cf3d117a554e",
|
||||
"/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=ea4250be693260798735",
|
||||
"/js/setup/setup.js": "/js/setup/setup.js?id=6b870beeb350d83668c5",
|
||||
"/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=8ce33c3deae058ad314f",
|
||||
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=73a0d914ad3577f257f4",
|
||||
"/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=c2caa29f753ad1f3a12c",
|
||||
"/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=448d055fa1e8357130e6",
|
||||
"/js/clients/payments/braintree-credit-card.js": "/js/clients/payments/braintree-credit-card.js?id=a334dd9257dd510a1feb",
|
||||
"/js/clients/payments/braintree-paypal.js": "/js/clients/payments/braintree-paypal.js?id=37950e8a39281d2f596a",
|
||||
"/js/clients/payments/wepay-credit-card.js": "/js/clients/payments/wepay-credit-card.js?id=ba4d5b7175117ababdb2",
|
||||
"/js/clients/payment_methods/wepay-bank-account.js": "/js/clients/payment_methods/wepay-bank-account.js?id=b1704cb9bd7975605310",
|
||||
"/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=59d9913b746fe5a540ff",
|
||||
"/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=c2cf632fb3cc91b4ff7c",
|
||||
"/js/clients/payments/eway-credit-card.js": "/js/clients/payments/eway-credit-card.js?id=ff17e039dd15d505448f",
|
||||
"/js/clients/payment_methods/braintree-ach.js": "/js/clients/payment_methods/braintree-ach.js?id=656ad159838b726969f5",
|
||||
"/js/clients/payments/square-credit-card.js": "/js/clients/payments/square-credit-card.js?id=8f05ce6bd2d6cae7e5f2",
|
||||
"/js/clients/statements/view.js": "/js/clients/statements/view.js?id=ea3db0c04b4372f76735",
|
||||
"/js/clients/payments/razorpay-aio.js": "/js/clients/payments/razorpay-aio.js?id=1dae47a0b783814ce895",
|
||||
"/js/clients/payments/stripe-sepa.js": "/js/clients/payments/stripe-sepa.js?id=cbd7bb4c483ca75333f4",
|
||||
"/js/clients/payment_methods/authorize-checkout-card.js": "/js/clients/payment_methods/authorize-checkout-card.js?id=61becda97682c7909f29",
|
||||
"/js/clients/payments/stripe-giropay.js": "/js/clients/payments/stripe-giropay.js?id=cdf300d72a1564d19b72",
|
||||
"/js/clients/payments/stripe-acss.js": "/js/clients/payments/stripe-acss.js?id=ec4f85eaeacd1d2135f5",
|
||||
"/js/clients/payments/stripe-bancontact.js": "/js/clients/payments/stripe-bancontact.js?id=66bbac90bf652dd16313",
|
||||
"/js/clients/payments/stripe-becs.js": "/js/clients/payments/stripe-becs.js?id=46f2e5093f6c879f274e",
|
||||
"/js/clients/payments/stripe-eps.js": "/js/clients/payments/stripe-eps.js?id=1ed972f879869de66c8a",
|
||||
"/js/clients/payments/stripe-ideal.js": "/js/clients/payments/stripe-ideal.js?id=73ce56676f9252b0cecf",
|
||||
"/js/clients/payments/stripe-przelewy24.js": "/js/clients/payments/stripe-przelewy24.js?id=f3a14f78bec8209c30ba",
|
||||
"/js/clients/payments/stripe-browserpay.js": "/js/clients/payments/stripe-browserpay.js?id=71e49866d66a6d85b88a",
|
||||
"/css/app.css": "/css/app.css?id=6d7f6103a3a7738d363b",
|
||||
"/js/app.js": "/js/app.js?id=ecb0709b955154bbfdd0",
|
||||
"/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=2f131d5fa28de42755a3",
|
||||
"/js/clients/payments/authorize-credit-card-payment.js": "/js/clients/payments/authorize-credit-card-payment.js?id=fb9c4f3b7678c433d84d",
|
||||
"/js/clients/payments/stripe-ach.js": "/js/clients/payments/stripe-ach.js?id=cf0c69413b9cfe5c5087",
|
||||
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=638cdcf1df984365155f",
|
||||
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=d044ffe63eb54ccb67a4",
|
||||
"/js/clients/payments/stripe-sofort.js": "/js/clients/payments/stripe-sofort.js?id=fffe83f198ff2d95cf04",
|
||||
"/js/clients/payments/stripe-alipay.js": "/js/clients/payments/stripe-alipay.js?id=4b87dbc11b8e99fe7ba0",
|
||||
"/js/clients/payments/checkout-credit-card.js": "/js/clients/payments/checkout-credit-card.js?id=dfd49ca47294ea0fa4a5",
|
||||
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=dbdf50fa924618b72aed",
|
||||
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=4c37ce55f7ae30ccab7d",
|
||||
"/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=d57f84a2645ef30c8382",
|
||||
"/js/setup/setup.js": "/js/setup/setup.js?id=08507a1c9f569e808250",
|
||||
"/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=cf50b5ba1fcd1d184bf0",
|
||||
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=8a0df00732d6421c0f2a",
|
||||
"/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=70baf5bdbdb48adb05b8",
|
||||
"/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=c2719a701a0c694cce33",
|
||||
"/js/clients/payments/braintree-credit-card.js": "/js/clients/payments/braintree-credit-card.js?id=04c711654cec563659a8",
|
||||
"/js/clients/payments/braintree-paypal.js": "/js/clients/payments/braintree-paypal.js?id=cf489d15f1911f4c8b2d",
|
||||
"/js/clients/payments/wepay-credit-card.js": "/js/clients/payments/wepay-credit-card.js?id=22e7ca75d2bc50130715",
|
||||
"/js/clients/payment_methods/wepay-bank-account.js": "/js/clients/payment_methods/wepay-bank-account.js?id=b31d0ed14f244010b111",
|
||||
"/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=b013ff063eef2d091a1c",
|
||||
"/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=05c05bb8e9ed64eae37a",
|
||||
"/js/clients/payments/eway-credit-card.js": "/js/clients/payments/eway-credit-card.js?id=32c596a05785547a0902",
|
||||
"/js/clients/payment_methods/braintree-ach.js": "/js/clients/payment_methods/braintree-ach.js?id=9c1710222994eecb9bd0",
|
||||
"/js/clients/payments/square-credit-card.js": "/js/clients/payments/square-credit-card.js?id=2298d37de41798f27eaf",
|
||||
"/js/clients/statements/view.js": "/js/clients/statements/view.js?id=5bc233a304efc8a9b04f",
|
||||
"/js/clients/payments/razorpay-aio.js": "/js/clients/payments/razorpay-aio.js?id=5a3091a02be5b627dc1c",
|
||||
"/js/clients/payments/stripe-sepa.js": "/js/clients/payments/stripe-sepa.js?id=47dfaf343ceed193d656",
|
||||
"/js/clients/payment_methods/authorize-checkout-card.js": "/js/clients/payment_methods/authorize-checkout-card.js?id=ea74b46846e1720d40c6",
|
||||
"/js/clients/payments/stripe-giropay.js": "/js/clients/payments/stripe-giropay.js?id=8160bb93843131101958",
|
||||
"/js/clients/payments/stripe-acss.js": "/js/clients/payments/stripe-acss.js?id=b4624c64531474126954",
|
||||
"/js/clients/payments/stripe-bancontact.js": "/js/clients/payments/stripe-bancontact.js?id=d32d396d4777e75ce1e6",
|
||||
"/js/clients/payments/stripe-becs.js": "/js/clients/payments/stripe-becs.js?id=e5a905a998c33a32b95a",
|
||||
"/js/clients/payments/stripe-eps.js": "/js/clients/payments/stripe-eps.js?id=931615b2b2b2db8a8499",
|
||||
"/js/clients/payments/stripe-ideal.js": "/js/clients/payments/stripe-ideal.js?id=be6fdb9bee464f76e4b4",
|
||||
"/js/clients/payments/stripe-przelewy24.js": "/js/clients/payments/stripe-przelewy24.js?id=192de985bf3760040e5d",
|
||||
"/js/clients/payments/stripe-browserpay.js": "/js/clients/payments/stripe-browserpay.js?id=1e3834fa1a1cb5d2d192",
|
||||
"/css/app.css": "/css/app.css?id=0082f32acc108fdf80b3",
|
||||
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ad"
|
||||
}
|
||||
|
11
resources/js/clients/invoices/payment.js
vendored
11
resources/js/clients/invoices/payment.js
vendored
@ -13,6 +13,7 @@ class Payment {
|
||||
this.shouldDisplayTerms = displayTerms;
|
||||
this.shouldDisplaySignature = displaySignature;
|
||||
this.termsAccepted = false;
|
||||
this.submitting = false;
|
||||
}
|
||||
|
||||
handleMethodSelect(element) {
|
||||
@ -95,9 +96,13 @@ class Payment {
|
||||
document
|
||||
.querySelectorAll(".dropdown-gateway-button")
|
||||
.forEach(element => {
|
||||
element.addEventListener("click", () =>
|
||||
this.handleMethodSelect(element)
|
||||
);
|
||||
element.addEventListener("click", () => {
|
||||
if (!this.submitting) {
|
||||
this.handleMethodSelect(element)
|
||||
|
||||
this.submitting = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user