mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Update formatting
This commit is contained in:
parent
e3385c7b08
commit
662bb66ce9
217622
public/css/app.css
vendored
217622
public/css/app.css
vendored
File diff suppressed because one or more lines are too long
3367
public/js/app.js
vendored
3367
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
242
public/js/clients/invoices/action-selectors.js
vendored
242
public/js/clients/invoices/action-selectors.js
vendored
@ -1,2 +1,240 @@
|
||||
/*! For license information please see action-selectors.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=4)}({4:function(e,t,n){e.exports=n("Boob")},Boob:function(e,t){function n(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);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 u,i=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,u=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw u}}}}function r(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 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)}}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var t,r,c;return t=e,(r=[{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(e,t){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!==e.checked){var o=document.createElement("INPUT");o.setAttribute("name","invoices[]"),o.setAttribute("value",e.dataset.value),o.setAttribute("class","child-hidden-input"),o.hidden=!0,t.append(o)}else{var c,u=document.querySelectorAll("input.child-hidden-input"),i=n(u);try{for(i.s();!(c=i.n()).done;){var l=c.value;l.value==e.dataset.value&&l.remove()}}catch(e){i.e(e)}finally{i.f()}}}},{key:"handle",value:function(){var e=this;this.parentElement.addEventListener("click",(function(){e.watchCheckboxes(e.parentElement)}));var t,r=n(document.querySelectorAll(".form-check-child"));try{var o=function(){var n=t.value;n.addEventListener("click",(function(){e.processChildItem(n,e.parentForm)}))};for(r.s();!(t=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}}}])&&o(t.prototype,r),c&&o(t,c),e}())).handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 4);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/invoices/action-selectors.js":
|
||||
/*!***********************************************************!*\
|
||||
!*** ./resources/js/clients/invoices/action-selectors.js ***!
|
||||
\***********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 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 = o[Symbol.iterator](); }, 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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4:
|
||||
/*!*****************************************************************!*\
|
||||
!*** multi ./resources/js/clients/invoices/action-selectors.js ***!
|
||||
\*****************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/invoices/action-selectors.js */"./resources/js/clients/invoices/action-selectors.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
221
public/js/clients/invoices/payment.js
vendored
221
public/js/clients/invoices/payment.js
vendored
@ -1,2 +1,219 @@
|
||||
/*! For license information please see payment.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=5)}({5:function(e,t,n){e.exports=n("FuOr")},FuOr:function(e,t){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)}}var r=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.shouldDisplayTerms=t,this.shouldDisplaySignature=n,this.termsAccepted=!1}var t,r,i;return t=e,(r=[{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)}))}))}}])&&n(t.prototype,r),i&&n(t,i),e}(),i=document.querySelector('meta[name="require-invoice-signature"]').content,u=document.querySelector('meta[name="show-invoice-terms"]').content;new r(Boolean(+i),Boolean(+u)).handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 5);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/invoices/payment.js":
|
||||
/*!**************************************************!*\
|
||||
!*** ./resources/js/clients/invoices/payment.js ***!
|
||||
\**************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
_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 () {
|
||||
return _this2.handleMethodSelect(element);
|
||||
});
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5:
|
||||
/*!********************************************************!*\
|
||||
!*** multi ./resources/js/clients/invoices/payment.js ***!
|
||||
\********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/invoices/payment.js */"./resources/js/clients/invoices/payment.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
347
public/js/clients/linkify-urls.js
vendored
347
public/js/clients/linkify-urls.js
vendored
@ -1,2 +1,345 @@
|
||||
/*! For license information please see linkify-urls.js.LICENSE.txt */
|
||||
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=16)}({16:function(e,t,r){e.exports=r("cN42")},Ievl:function(e,t,r){"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 n=1;n<arguments.length;n++)r=r+t.escape(arguments[n])+e[n];return r},t.unescapeTag=function(e){let r=e[0];for(let n=1;n<arguments.length;n++)r=r+t.unescape(arguments[n])+e[n];return r}},PoD1:function(e,t,r){"use strict";e.exports=r("sW1H")},YIIW:function(e,t,r){"use strict";const n=r("dBjz"),o=r("PoD1"),a=r("Ievl"),u=new Set(o);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?a.escape(e.text):e.html;let r=`<${e.name}${n(e.attributes)}>`;return u.has(e.name)||(r+=`${t}</${e.name}>`),r}},cN42:function(e,t,r){var n=r("jG5F");document.querySelectorAll("[data-ref=entity-terms]").forEach((function(e){e.innerHTML=n(e.innerText,{attributes:{target:"_blank",class:"text-primary"}})}))},dBjz:function(e,t,r){"use strict";const n=r("Ievl");e.exports=e=>{const t=[];for(const r of Object.keys(e)){let o=e[r];if(!1===o)continue;Array.isArray(o)&&(o=o.join(" "));let a=n.escape(r);!0!==o&&(a+=`="${n.escape(String(o))}"`),t.push(a)}return t.length>0?" "+t.join(" "):""}},jG5F:function(e,t,r){"use strict";const n=r("YIIW"),o=(e,t)=>n({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=>o(e,t)))(e,t);if("dom"===t.type)return((e,t)=>{const r=document.createDocumentFragment();for(const[a,u]of Object.entries(e.split(/((?<!\+)(?:https?(?::\/\/))(?:www\.)?(?:[a-zA-Z\d-_.]+(?:(?:\.|@)[a-zA-Z\d]{2,})|localhost)(?:(?:[-a-zA-Z\d:%_+.~#*$!?&//=@]*)(?:[,](?![\s]))*)*)/g)))a%2?r.append((n=o(u,t),document.createRange().createContextualFragment(n))):u.length>0&&r.append(u);var n;return r})(e,t);throw new Error("The type option must be either `dom` or `string`")}},sW1H:function(e){e.exports=JSON.parse('["area","base","br","col","embed","hr","img","input","link","menuitem","meta","param","source","track","wbr"]')}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 16);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./node_modules/create-html-element/index.js":
|
||||
/*!***************************************************!*\
|
||||
!*** ./node_modules/create-html-element/index.js ***!
|
||||
\***************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, 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/html-tags-void.json":
|
||||
/*!*************************************************************************************!*\
|
||||
!*** ./node_modules/create-html-element/node_modules/html-tags/html-tags-void.json ***!
|
||||
\*************************************************************************************/
|
||||
/*! exports provided: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, default */
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = JSON.parse("[\"area\",\"base\",\"br\",\"col\",\"embed\",\"hr\",\"img\",\"input\",\"link\",\"menuitem\",\"meta\",\"param\",\"source\",\"track\",\"wbr\"]");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/create-html-element/node_modules/html-tags/void.js":
|
||||
/*!*************************************************************************!*\
|
||||
!*** ./node_modules/create-html-element/node_modules/html-tags/void.js ***!
|
||||
\*************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, 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 ***!
|
||||
\*******************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"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 ***!
|
||||
\********************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, 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 ***!
|
||||
\****************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, 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(' ') : '';
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./resources/js/clients/linkify-urls.js":
|
||||
/*!**********************************************!*\
|
||||
!*** ./resources/js/clients/linkify-urls.js ***!
|
||||
\**********************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
/**
|
||||
* 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'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 16:
|
||||
/*!****************************************************!*\
|
||||
!*** multi ./resources/js/clients/linkify-urls.js ***!
|
||||
\****************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/linkify-urls.js */"./resources/js/clients/linkify-urls.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
@ -1,2 +1,199 @@
|
||||
/*! For license information please see authorize-authorize-card.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=1)}({1:function(e,t,n){e.exports=n("6vDv")},"6vDv":function(e,t){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 e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.publicKey=t,this.loginId=n,this.cardHolderName=document.getElementById("cardholder_name"),this.cardButton=document.getElementById("card_button")}var t,r,a;return t=e,(r=[{key:"handleAuthorization",value:function(){var e=$("#my-card"),t={};t.clientKey=this.publicKey,t.apiLoginID=this.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 r={};return r.authData=t,r.cardData=n,document.getElementById("card_button").disabled=!0,document.querySelector("#card_button > svg").classList.remove("hidden"),document.querySelector("#card_button > span").classList.add("hidden"),Accept.dispatchData(r,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}}])&&n(t.prototype,r),a&&n(t,a),e}())(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payment_methods/authorize-authorize-card.js":
|
||||
/*!**************************************************************************!*\
|
||||
!*** ./resources/js/clients/payment_methods/authorize-authorize-card.js ***!
|
||||
\**************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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:
|
||||
/*!********************************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payment_methods/authorize-authorize-card.js ***!
|
||||
\********************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payment_methods/authorize-authorize-card.js */"./resources/js/clients/payment_methods/authorize-authorize-card.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
@ -1,2 +1,163 @@
|
||||
/*! For license information please see authorize-checkout-card.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=29)}({29:function(e,t,n){e.exports=n("kduS")},kduS:function(e,t){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 e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.button=document.querySelector("#pay-button")}var t,r,o;return t=e,(r=[{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(t){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(t){e.button.disabled=!0,t.preventDefault(),Frames.submitCard()}))}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 29);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payment_methods/authorize-checkout-card.js":
|
||||
/*!*************************************************************************!*\
|
||||
!*** ./resources/js/clients/payment_methods/authorize-checkout-card.js ***!
|
||||
\*************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 29:
|
||||
/*!*******************************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payment_methods/authorize-checkout-card.js ***!
|
||||
\*******************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payment_methods/authorize-checkout-card.js */"./resources/js/clients/payment_methods/authorize-checkout-card.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
175
public/js/clients/payment_methods/braintree-ach.js
vendored
175
public/js/clients/payment_methods/braintree-ach.js
vendored
@ -1,2 +1,173 @@
|
||||
/*! For license information please see braintree-ach.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=24)}({24:function(e,t,n){e.exports=n("cGea")},cGea:function(e,t){var n;window.braintree.client.create({authorization:null===(n=document.querySelector('meta[name="client-token"]'))||void 0===n?void 0:n.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}))}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 24);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payment_methods/braintree-ach.js":
|
||||
/*!***************************************************************!*\
|
||||
!*** ./resources/js/clients/payment_methods/braintree-ach.js ***!
|
||||
\***************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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;
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 24:
|
||||
/*!*********************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payment_methods/braintree-ach.js ***!
|
||||
\*********************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payment_methods/braintree-ach.js */"./resources/js/clients/payment_methods/braintree-ach.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
@ -1,2 +1,178 @@
|
||||
/*! For license information please see wepay-bank-account.js.LICENSE.txt */
|
||||
!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/",t(t.s=20)}({20:function(e,n,t){e.exports=t("bIGw")},bIGw:function(e,n){function t(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var r=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,r,o;return n=e,(r=[{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()}}])&&t(n.prototype,r),o&&t(n,o),e}();document.addEventListener("DOMContentLoaded",(function(){(new r).handle()}))}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 20);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payment_methods/wepay-bank-account.js":
|
||||
/*!********************************************************************!*\
|
||||
!*** ./resources/js/clients/payment_methods/wepay-bank-account.js ***!
|
||||
\********************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 20:
|
||||
/*!**************************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payment_methods/wepay-bank-account.js ***!
|
||||
\**************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payment_methods/wepay-bank-account.js */"./resources/js/clients/payment_methods/wepay-bank-account.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
@ -1,2 +1,241 @@
|
||||
/*! For license information please see authorize-credit-card-payment.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=2)}({2:function(e,t,n){e.exports=n("hK5p")},hK5p:function(e,t){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)}}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}new(function(){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),r(this,"handleAuthorization",(function(){var e=$("#my-card"),t={};t.clientKey=a.publicKey,t.apiLoginID=a.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 r={};return r.authData=t,r.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(r,a.responseHandler),!1})),r(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})),r(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?a.handlePayNowAction(t.value):a.handleAuthorization()})),a})),this.publicKey=t,this.loginId=n,this.cardHolderName=document.getElementById("cardholder_name")}var t,a,o;return t=e,(a=[{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()}}])&&n(t.prototype,a),o&&n(t,o),e}())(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 2);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payments/authorize-credit-card-payment.js":
|
||||
/*!************************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/authorize-credit-card-payment.js ***!
|
||||
\************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/*!******************************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/authorize-credit-card-payment.js ***!
|
||||
\******************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payments/authorize-credit-card-payment.js */"./resources/js/clients/payments/authorize-credit-card-payment.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
223
public/js/clients/payments/braintree-credit-card.js
vendored
223
public/js/clients/payments/braintree-credit-card.js
vendored
@ -1,2 +1,221 @@
|
||||
/*! For license information please see braintree-credit-card.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=17)}({17:function(e,t,n){e.exports=n("jPAV")},jPAV:function(e,t){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 e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,o;return t=e,(r=[{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 r=document.querySelector('input[name="token-billing-checkbox"]:checked');r&&(document.querySelector('input[name="store_card"]').value=r.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()}))}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 17);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payments/braintree-credit-card.js":
|
||||
/*!****************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/braintree-credit-card.js ***!
|
||||
\****************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 17:
|
||||
/*!**********************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/braintree-credit-card.js ***!
|
||||
\**********************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payments/braintree-credit-card.js */"./resources/js/clients/payments/braintree-credit-card.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
236
public/js/clients/payments/braintree-paypal.js
vendored
236
public/js/clients/payments/braintree-paypal.js
vendored
@ -1,2 +1,234 @@
|
||||
/*! For license information please see braintree-paypal.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=18)}({18:function(e,t,n){e.exports=n("cZZG")},cZZG:function(e,t){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 e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,o;return t=e,o=[{key:"getPaymentDetails",value:function(){return{flow:"vault"}}},{key:"handleErrorMessage",value:function(e){var t=document.getElementById("errors");t.innerText=e,t.hidden=!1}}],(r=[{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:"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(t){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(t){return t.loadPayPalSDK({vault:!0}).then((function(t){return paypal.Buttons({fundingSource:paypal.FUNDING.PAYPAL,createBillingAgreement:function(){return t.createPayment(e.getPaymentDetails())},onApprove:function(e,n){return t.tokenizePayment(e).then((function(e){var t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.querySelector("input[name=gateway_response]").value=JSON.stringify(e),document.getElementById("server-response").submit()}))},onCancel:function(e){},onError:function(t){console.log(t.message),e.handleErrorMessage(t.message)}}).render("#paypal-button")}))})).catch((function(t){console.log(t.message),e.handleErrorMessage(t.message)}))}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 18);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payments/braintree-paypal.js":
|
||||
/*!***********************************************************!*\
|
||||
!*** ./resources/js/clients/payments/braintree-paypal.js ***!
|
||||
\***********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 18:
|
||||
/*!*****************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/braintree-paypal.js ***!
|
||||
\*****************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payments/braintree-paypal.js */"./resources/js/clients/payments/braintree-paypal.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
113
public/js/clients/payments/card-js.min.js
vendored
113
public/js/clients/payments/card-js.min.js
vendored
File diff suppressed because one or more lines are too long
205
public/js/clients/payments/checkout-credit-card.js
vendored
205
public/js/clients/payments/checkout-credit-card.js
vendored
@ -1,2 +1,203 @@
|
||||
/*! For license information please see checkout-credit-card.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=8)}({8:function(e,t,n){e.exports=n("fQHp")},fQHp:function(e,t){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 e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tokens=[]}var t,r,o;return t=e,(r=[{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 t;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 n=document.getElementById("pay-button"),r=null!==(t=document.querySelector('meta[name="public-key"]').content)&&void 0!==t?t:"",o=document.getElementById("payment-form");Frames.init(r),Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED,(function(e){n.disabled=!Frames.isCardValid()})),Frames.addEventHandler(Frames.Events.CARD_TOKENIZATION_FAILED,(function(e){pay.button.disabled=!1})),Frames.addEventHandler(Frames.Events.CARD_TOKENIZED,(function(e){n.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()})),o.addEventListener("submit",(function(e){e.preventDefault(),Frames.submitCard()}))}},{key:"completePaymentUsingToken",value:function(e){var t=document.getElementById("pay-now-with-token");t.disabled=!0,t.querySelector("svg").classList.remove("hidden"),t.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(t){return t.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)}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 8);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payments/checkout-credit-card.js":
|
||||
/*!***************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/checkout-credit-card.js ***!
|
||||
\***************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8:
|
||||
/*!*********************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/checkout-credit-card.js ***!
|
||||
\*********************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payments/checkout-credit-card.js */"./resources/js/clients/payments/checkout-credit-card.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
484
public/js/clients/payments/eway-credit-card.js
vendored
484
public/js/clients/payments/eway-credit-card.js
vendored
File diff suppressed because one or more lines are too long
261
public/js/clients/payments/mollie-credit-card.js
vendored
261
public/js/clients/payments/mollie-credit-card.js
vendored
@ -1,2 +1,259 @@
|
||||
/*! For license information please see mollie-credit-card.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=22)}({22:function(e,t,n){e.exports=n("i12I")},i12I:function(e,t){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 e(){var t,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mollie=Mollie(null===(t=document.querySelector("meta[name=mollie-profileId]"))||void 0===t?void 0:t.content,{testmode:null===(n=document.querySelector("meta[name=mollie-testmode]"))||void 0===n?void 0:n.content,locale:"en_US"})}var t,r,o;return t=e,(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()}))}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 22);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payments/mollie-credit-card.js":
|
||||
/*!*************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/mollie-credit-card.js ***!
|
||||
\*************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 22:
|
||||
/*!*******************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/mollie-credit-card.js ***!
|
||||
\*******************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payments/mollie-credit-card.js */"./resources/js/clients/payments/mollie-credit-card.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
280
public/js/clients/payments/paytrace-credit-card.js
vendored
280
public/js/clients/payments/paytrace-credit-card.js
vendored
@ -1,2 +1,278 @@
|
||||
/*! For license information please see paytrace-credit-card.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=21)}({"0Swb":function(e,t){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 e(){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.clientKey=null===(t=document.querySelector("meta[name=paytrace-client-key]"))||void 0===t?void 0:t.content}var t,r,o;return t=e,(r=[{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 r=document.getElementById("errors");return r.textContent=n[0].description,r.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)}))}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()},21:function(e,t,n){e.exports=n("0Swb")}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 21);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payments/paytrace-credit-card.js":
|
||||
/*!***************************************************************!*\
|
||||
!*** ./resources/js/clients/payments/paytrace-credit-card.js ***!
|
||||
\***************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 21:
|
||||
/*!*********************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/paytrace-credit-card.js ***!
|
||||
\*********************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payments/paytrace-credit-card.js */"./resources/js/clients/payments/paytrace-credit-card.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
138
public/js/clients/payments/razorpay-aio.js
vendored
138
public/js/clients/payments/razorpay-aio.js
vendored
@ -1,2 +1,136 @@
|
||||
/*! For license information please see razorpay-aio.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=27)}({27:function(e,t,n){e.exports=n("tIvh")},tIvh:function(e,t){var n,r=JSON.parse(null===(n=document.querySelector("meta[name=razorpay-options]"))||void 0===n?void 0:n.content);r.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 o=new Razorpay(r);document.getElementById("pay-now").onclick=function(e){e.target.parentElement.disabled=!0,o.open()}}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 27);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payments/razorpay-aio.js":
|
||||
/*!*******************************************************!*\
|
||||
!*** ./resources/js/clients/payments/razorpay-aio.js ***!
|
||||
\*******************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 27:
|
||||
/*!*************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/razorpay-aio.js ***!
|
||||
\*************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payments/razorpay-aio.js */"./resources/js/clients/payments/razorpay-aio.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
1206
public/js/clients/payments/square-credit-card.js
vendored
1206
public/js/clients/payments/square-credit-card.js
vendored
File diff suppressed because one or more lines are too long
205
public/js/clients/payments/stripe-ach.js
vendored
205
public/js/clients/payments/stripe-ach.js
vendored
@ -1,2 +1,203 @@
|
||||
/*! For license information please see stripe-ach.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=3)}({3:function(e,t,n){e.exports=n("M5il")},M5il:function(e,t){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)}}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}(new(function(){function e(){var t,n=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 n.stripe=Stripe(n.key),n.stripe_connect&&(n.stripe.stripeAccount=n.stripe_connect),n})),r(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}})),r(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"),n.errors.textContent="",n.errors.textContent=e,n.errors.hidden=!1})),r(this,"handleSuccess",(function(e){document.getElementById("gateway_response").value=JSON.stringify(e),document.getElementById("server_response").submit()})),r(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(),n.errors.textContent="",n.errors.hidden=!0,n.stripe.createToken("bank_account",n.getFormData()).then((function(e){return e.hasOwnProperty("error")?n.handleError(e.error.message):n.handleSuccess(e)}))})),this.errors=document.getElementById("errors"),this.key=document.querySelector('meta[name="stripe-publishable-key"]').content,this.stripe_connect=null===(t=document.querySelector('meta[name="stripe-account-id"]'))||void 0===t?void 0:t.content}var t,o,u;return t=e,(o=[{key:"handle",value:function(){var e=this;document.getElementById("save-button").addEventListener("click",(function(t){return e.handleSubmit(t)}))}}])&&n(t.prototype,o),u&&n(t,u),e}())).setupStripe().handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 3);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payments/stripe-ach.js":
|
||||
/*!*****************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-ach.js ***!
|
||||
\*****************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/*!***********************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/stripe-ach.js ***!
|
||||
\***********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payments/stripe-ach.js */"./resources/js/clients/payments/stripe-ach.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
176
public/js/clients/payments/stripe-alipay.js
vendored
176
public/js/clients/payments/stripe-alipay.js
vendored
@ -1,2 +1,174 @@
|
||||
/*! For license information please see stripe-alipay.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=7)}({"+keB":function(e,t){var n,r,o,u;function i(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),i(this,"setupStripe",(function(){return r.stripe=Stripe(r.key),r.stripeConnect&&(r.stripe.stripeAccount=r.stripeConnect),r})),i(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!==(n=null===(r=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"",null!==(o=null===(u=document.querySelector('meta[name="stripe-account-id"]'))||void 0===u?void 0:u.content)&&void 0!==o?o:"").setupStripe().handle()},7:function(e,t,n){e.exports=n("+keB")}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 7);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payments/stripe-alipay.js":
|
||||
/*!********************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-alipay.js ***!
|
||||
\********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 7:
|
||||
/*!**************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/stripe-alipay.js ***!
|
||||
\**************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payments/stripe-alipay.js */"./resources/js/clients/payments/stripe-alipay.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
325
public/js/clients/payments/stripe-credit-card.js
vendored
325
public/js/clients/payments/stripe-credit-card.js
vendored
File diff suppressed because one or more lines are too long
298
public/js/clients/payments/stripe-sepa.js
vendored
298
public/js/clients/payments/stripe-sepa.js
vendored
File diff suppressed because one or more lines are too long
164
public/js/clients/payments/stripe-sofort.js
vendored
164
public/js/clients/payments/stripe-sofort.js
vendored
@ -1,2 +1,162 @@
|
||||
/*! For license information please see stripe-sofort.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=6)}({6:function(e,t,n){e.exports=n("RFiP")},RFiP:function(e,t){var n,r,o,u;function i(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!==(n=null===(r=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"",l=null!==(o=null===(u=document.querySelector('meta[name="stripe-account-id"]'))||void 0===u?void 0:u.content)&&void 0!==o?o:"";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),i(this,"setupStripe",(function(){return r.stripe=Stripe(r.key),r.stripeConnect&&(r.stripe.stripeAccount=l),r})),i(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,l).setupStripe().handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 6);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payments/stripe-sofort.js":
|
||||
/*!********************************************************!*\
|
||||
!*** ./resources/js/clients/payments/stripe-sofort.js ***!
|
||||
\********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6:
|
||||
/*!**************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/stripe-sofort.js ***!
|
||||
\**************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/payments/stripe-sofort.js */"./resources/js/clients/payments/stripe-sofort.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
322
public/js/clients/payments/wepay-credit-card.js
vendored
322
public/js/clients/payments/wepay-credit-card.js
vendored
File diff suppressed because one or more lines are too long
242
public/js/clients/quotes/action-selectors.js
vendored
242
public/js/clients/quotes/action-selectors.js
vendored
@ -1,2 +1,240 @@
|
||||
/*! For license information please see action-selectors.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=9)}({9:function(e,t,n){e.exports=n("ydWM")},ydWM:function(e,t){function n(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,u=function(){};return{s:u,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:u}}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 c,i=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,c=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw c}}}}function r(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 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)}}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var t,r,u;return t=e,(r=[{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(e,t){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!==e.checked){var o=document.createElement("INPUT");o.setAttribute("name","quotes[]"),o.setAttribute("value",e.dataset.value),o.setAttribute("class","child-hidden-input"),o.hidden=!0,t.append(o)}else{var u,c=document.querySelectorAll("input.child-hidden-input"),i=n(c);try{for(i.s();!(u=i.n()).done;){var l=u.value;l.value==e.dataset.value&&l.remove()}}catch(e){i.e(e)}finally{i.f()}}}},{key:"handle",value:function(){var e=this;this.parentElement.addEventListener("click",(function(){e.watchCheckboxes(e.parentElement)}));var t,r=n(document.querySelectorAll(".form-check-child"));try{var o=function(){var n=t.value;n.addEventListener("click",(function(){e.processChildItem(n,e.parentForm)}))};for(r.s();!(t=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}}}])&&o(t.prototype,r),u&&o(t,u),e}())).handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 9);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/quotes/action-selectors.js":
|
||||
/*!*********************************************************!*\
|
||||
!*** ./resources/js/clients/quotes/action-selectors.js ***!
|
||||
\*********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 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 = o[Symbol.iterator](); }, 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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 9:
|
||||
/*!***************************************************************!*\
|
||||
!*** multi ./resources/js/clients/quotes/action-selectors.js ***!
|
||||
\***************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/quotes/action-selectors.js */"./resources/js/clients/quotes/action-selectors.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
212
public/js/clients/quotes/approve.js
vendored
212
public/js/clients/quotes/approve.js
vendored
@ -1,2 +1,210 @@
|
||||
/*! For license information please see approve.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var u=t[r]={i:r,l:!1,exports:{}};return e[r].call(u.exports,u,u.exports,n),u.l=!0,u.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var u in e)n.d(r,u,function(t){return e[t]}.bind(null,u));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=10)}({10:function(e,t,n){e.exports=n("WuMn")},WuMn:function(e,t){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)}}var r=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.shouldDisplaySignature=t,this.shouldDisplayTerms=n,this.termsAccepted=!1}var t,r,u;return t=e,(r=[{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()}))}}])&&n(t.prototype,r),u&&n(t,u),e}(),u=document.querySelector('meta[name="require-quote-signature"]').content,o=document.querySelector('meta[name="show-quote-terms"]').content;new r(Boolean(+u),Boolean(+o)).handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 10);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/quotes/approve.js":
|
||||
/*!************************************************!*\
|
||||
!*** ./resources/js/clients/quotes/approve.js ***!
|
||||
\************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 10:
|
||||
/*!******************************************************!*\
|
||||
!*** multi ./resources/js/clients/quotes/approve.js ***!
|
||||
\******************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/quotes/approve.js */"./resources/js/clients/quotes/approve.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
142
public/js/clients/shared/multiple-downloads.js
vendored
142
public/js/clients/shared/multiple-downloads.js
vendored
@ -1 +1,141 @@
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=15)}({15:function(e,t,n){e.exports=n("W54t")},W54t:function(e,t){window.appendToElement=function(e,t){var n=document.getElementById(e),r=n.querySelector('input[value="'.concat(t,'"]'));if(r)return r.remove();var o=document.createElement("INPUT");o.setAttribute("name","file_hash[]"),o.setAttribute("value",t),o.hidden=!0,n.append(o)}}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 15);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/shared/multiple-downloads.js":
|
||||
/*!***********************************************************!*\
|
||||
!*** ./resources/js/clients/shared/multiple-downloads.js ***!
|
||||
\***********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 15:
|
||||
/*!*****************************************************************!*\
|
||||
!*** multi ./resources/js/clients/shared/multiple-downloads.js ***!
|
||||
\*****************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/shared/multiple-downloads.js */"./resources/js/clients/shared/multiple-downloads.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
1063
public/js/clients/shared/pdf.js
vendored
1063
public/js/clients/shared/pdf.js
vendored
File diff suppressed because one or more lines are too long
208
public/js/clients/statements/view.js
vendored
208
public/js/clients/statements/view.js
vendored
@ -1,2 +1,206 @@
|
||||
/*! For license information please see view.js.LICENSE.txt */
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=26)}({26:function(e,t,n){e.exports=n("LcZE")},LcZE:function(e,t){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 e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=new URL(document.querySelector("meta[name=pdf-url]").content),this.startDate="",this.endDate="",this.showPaymentsTable=!1,this.showAgingTable=!1}var t,r,a;return t=e,(r=[{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}))}}])&&n(t.prototype,r),a&&n(t,a),e}())).handle()}});
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 26);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/statements/view.js":
|
||||
/*!*************************************************!*\
|
||||
!*** ./resources/js/clients/statements/view.js ***!
|
||||
\*************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 26:
|
||||
/*!*******************************************************!*\
|
||||
!*** multi ./resources/js/clients/statements/view.js ***!
|
||||
\*******************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /var/www/html/resources/js/clients/statements/view.js */"./resources/js/clients/statements/view.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
2332
public/js/setup/setup.js
vendored
2332
public/js/setup/setup.js
vendored
File diff suppressed because one or more lines are too long
@ -1,34 +1,34 @@
|
||||
{
|
||||
"/js/app.js": "/js/app.js?id=696e8203d5e8e7cf5ff5",
|
||||
"/css/app.css": "/css/app.css?id=f7f7b35aa3f417a3eca3",
|
||||
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=a09bb529b8e1826f13b4",
|
||||
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=8ce8955ba775ea5f47d1",
|
||||
"/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=0dc8c34010d09195d2f7",
|
||||
"/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=f7f4ecfb1771951b91e7",
|
||||
"/js/clients/payment_methods/authorize-checkout-card.js": "/js/clients/payment_methods/authorize-checkout-card.js?id=d23f32f956a8c8927339",
|
||||
"/js/clients/payment_methods/braintree-ach.js": "/js/clients/payment_methods/braintree-ach.js?id=9fb7941baba1f9645ed9",
|
||||
"/js/clients/payment_methods/wepay-bank-account.js": "/js/clients/payment_methods/wepay-bank-account.js?id=8fea0be371d430064a89",
|
||||
"/js/clients/payments/authorize-credit-card-payment.js": "/js/clients/payments/authorize-credit-card-payment.js?id=7c2cbef525868592f42e",
|
||||
"/js/clients/payments/braintree-credit-card.js": "/js/clients/payments/braintree-credit-card.js?id=81957e7cb1cb49f23b90",
|
||||
"/js/clients/payments/braintree-paypal.js": "/js/clients/payments/braintree-paypal.js?id=c35db3cbb65806ab6a8a",
|
||||
"/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=5469146cd629ea1b5c20",
|
||||
"/js/clients/payments/checkout-credit-card.js": "/js/clients/payments/checkout-credit-card.js?id=065e5450233cc5b47020",
|
||||
"/js/clients/payments/eway-credit-card.js": "/js/clients/payments/eway-credit-card.js?id=08ea84e9451abd434cff",
|
||||
"/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=73b66e88e2daabcd6549",
|
||||
"/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=c2b5f7831e1a46dd5fb2",
|
||||
"/js/clients/payments/razorpay-aio.js": "/js/clients/payments/razorpay-aio.js?id=817ab3b2b94ee37b14eb",
|
||||
"/js/clients/payments/square-credit-card.js": "/js/clients/payments/square-credit-card.js?id=070c86b293b532c5a56c",
|
||||
"/js/clients/payments/stripe-ach.js": "/js/clients/payments/stripe-ach.js?id=81c2623fc1e5769b51c7",
|
||||
"/js/clients/payments/stripe-alipay.js": "/js/clients/payments/stripe-alipay.js?id=665ddf663500767f1a17",
|
||||
"/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=a30464874dee84678344",
|
||||
"/js/clients/payments/stripe-sepa.js": "/js/clients/payments/stripe-sepa.js?id=3f2fa0857dc804a85dcb",
|
||||
"/js/clients/payments/stripe-sofort.js": "/js/clients/payments/stripe-sofort.js?id=231571942310348aa616",
|
||||
"/js/clients/payments/wepay-credit-card.js": "/js/clients/payments/wepay-credit-card.js?id=f51400e03c5fdb6cdabe",
|
||||
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=1b8f9325aa6e8595e7fa",
|
||||
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=85bcae0a646882e56b12",
|
||||
"/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=5c35d28cf0a3286e7c45",
|
||||
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=2a99d83305ba87bfa6cc",
|
||||
"/js/clients/statements/view.js": "/js/clients/statements/view.js?id=ca3ec4cea0de824f3a36",
|
||||
"/js/setup/setup.js": "/js/setup/setup.js?id=8d454e7090f119552a6c",
|
||||
"/js/app.js": "/js/app.js?id=00999970742958982e12",
|
||||
"/css/app.css": "/css/app.css?id=cee8baa9e09f36367e67",
|
||||
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=2e676a48bf8e78899716",
|
||||
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=dd2c51f347b035a32a21",
|
||||
"/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=c44c5620858931f5a9f0",
|
||||
"/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=7dd89f439ccfadaebcba",
|
||||
"/js/clients/payment_methods/authorize-checkout-card.js": "/js/clients/payment_methods/authorize-checkout-card.js?id=de35304f74687ab9df10",
|
||||
"/js/clients/payment_methods/braintree-ach.js": "/js/clients/payment_methods/braintree-ach.js?id=81ecc5e0ebe945770844",
|
||||
"/js/clients/payment_methods/wepay-bank-account.js": "/js/clients/payment_methods/wepay-bank-account.js?id=b2f7c520de39cb4ced58",
|
||||
"/js/clients/payments/authorize-credit-card-payment.js": "/js/clients/payments/authorize-credit-card-payment.js?id=097123e197fc7f71e425",
|
||||
"/js/clients/payments/braintree-credit-card.js": "/js/clients/payments/braintree-credit-card.js?id=33b264212c5f1dbf095d",
|
||||
"/js/clients/payments/braintree-paypal.js": "/js/clients/payments/braintree-paypal.js?id=85f745ed485549a34a4d",
|
||||
"/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=a666548bb8ea61f0920a",
|
||||
"/js/clients/payments/checkout-credit-card.js": "/js/clients/payments/checkout-credit-card.js?id=c38bbc9192ab4f0bca92",
|
||||
"/js/clients/payments/eway-credit-card.js": "/js/clients/payments/eway-credit-card.js?id=acf6710138604cceb752",
|
||||
"/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=8c0ee07810bfd384f70a",
|
||||
"/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=93ecbc0536768961e890",
|
||||
"/js/clients/payments/razorpay-aio.js": "/js/clients/payments/razorpay-aio.js?id=f0780bf44439d5351bf7",
|
||||
"/js/clients/payments/square-credit-card.js": "/js/clients/payments/square-credit-card.js?id=9c3f6eca61d5b2499d47",
|
||||
"/js/clients/payments/stripe-ach.js": "/js/clients/payments/stripe-ach.js?id=547850ac2ef249d98dd6",
|
||||
"/js/clients/payments/stripe-alipay.js": "/js/clients/payments/stripe-alipay.js?id=f90c67035beae6b413b2",
|
||||
"/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=5786f64f60777280c8f8",
|
||||
"/js/clients/payments/stripe-sepa.js": "/js/clients/payments/stripe-sepa.js?id=081daef0b46c8402c061",
|
||||
"/js/clients/payments/stripe-sofort.js": "/js/clients/payments/stripe-sofort.js?id=66e6b9920671e5052979",
|
||||
"/js/clients/payments/wepay-credit-card.js": "/js/clients/payments/wepay-credit-card.js?id=919fd2d30ae73b06bc5c",
|
||||
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=aefe765385333ad2d478",
|
||||
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=2fbbbbcf46307c49310a",
|
||||
"/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=00ee4c22e75c6b755217",
|
||||
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=70ccdc356599c679cf26",
|
||||
"/js/clients/statements/view.js": "/js/clients/statements/view.js?id=895706b7de80bf22dde5",
|
||||
"/js/setup/setup.js": "/js/setup/setup.js?id=693d38ec20f1f313f879",
|
||||
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ad"
|
||||
}
|
||||
|
@ -57,47 +57,49 @@ class SquareCreditCard {
|
||||
// die("verify buyer");
|
||||
// }
|
||||
|
||||
|
||||
async completePaymentWithoutToken(e) {
|
||||
document.getElementById('errors').hidden = true;
|
||||
e.target.parentElement.disabled = true;
|
||||
|
||||
let result = await this.card.tokenize();
|
||||
|
||||
console.log("square token = " + result.token);
|
||||
console.log('square token = ' + result.token);
|
||||
|
||||
/* SCA */
|
||||
let verificationToken;
|
||||
let verificationToken;
|
||||
|
||||
try {
|
||||
const verificationDetails = {
|
||||
amount: document.querySelector('meta[name=amount]').content,
|
||||
billingContact: JSON.parse(document.querySelector('meta[name=square_contact]').content),
|
||||
currencyCode: document.querySelector('meta[name=currencyCode]').content,
|
||||
intent: 'CHARGE'
|
||||
};
|
||||
try {
|
||||
const verificationDetails = {
|
||||
amount: document.querySelector('meta[name=amount]').content,
|
||||
billingContact: JSON.parse(
|
||||
document.querySelector('meta[name=square_contact]').content
|
||||
),
|
||||
currencyCode: document.querySelector('meta[name=currencyCode]')
|
||||
.content,
|
||||
intent: 'CHARGE',
|
||||
};
|
||||
|
||||
console.log(verificationDetails);
|
||||
console.log(verificationDetails);
|
||||
|
||||
const verificationResults = await this.payments.verifyBuyer(
|
||||
result.token,
|
||||
verificationDetails
|
||||
result.token,
|
||||
verificationDetails
|
||||
);
|
||||
|
||||
verificationToken = verificationResults.token;
|
||||
}
|
||||
catch(typeError){
|
||||
console.log(typeError);
|
||||
die("failed in the catch");
|
||||
} catch (typeError) {
|
||||
console.log(typeError);
|
||||
die('failed in the catch');
|
||||
}
|
||||
// console.log(" verification tokem = " + verificationToken.token);
|
||||
|
||||
// verificationToken = verificationResults.token;
|
||||
|
||||
console.debug('Verification Token:', verificationToken);
|
||||
|
||||
document.querySelector('input[name="verificationToken"]').value =
|
||||
verificationToken;
|
||||
console.debug('Verification Token:', verificationToken);
|
||||
|
||||
document.querySelector(
|
||||
'input[name="verificationToken"]'
|
||||
).value = verificationToken;
|
||||
|
||||
if (result.status === 'OK') {
|
||||
document.getElementById('sourceId').value = result.token;
|
||||
@ -129,22 +131,23 @@ class SquareCreditCard {
|
||||
|
||||
/* SCA */
|
||||
async verifyBuyer(token) {
|
||||
|
||||
console.log("in verify buyer");
|
||||
console.log('in verify buyer');
|
||||
|
||||
const verificationDetails = {
|
||||
amount: document.querySelector('meta[name=amount]').content,
|
||||
billingContact: document.querySelector('meta[name=square_contact]').content,
|
||||
currencyCode: document.querySelector('meta[name=currencyCode]').content,
|
||||
intent: 'CHARGE'
|
||||
amount: document.querySelector('meta[name=amount]').content,
|
||||
billingContact: document.querySelector('meta[name=square_contact]')
|
||||
.content,
|
||||
currencyCode: document.querySelector('meta[name=currencyCode]')
|
||||
.content,
|
||||
intent: 'CHARGE',
|
||||
};
|
||||
|
||||
const verificationResults = await this.payments.verifyBuyer(
|
||||
token,
|
||||
verificationDetails
|
||||
token,
|
||||
verificationDetails
|
||||
);
|
||||
|
||||
console.log(" verification toke = " + verificationResults.token);
|
||||
console.log(' verification toke = ' + verificationResults.token);
|
||||
|
||||
return verificationResults.token;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user