mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-05 18:52:44 +01:00
optimize card-js form
This commit is contained in:
parent
503e240629
commit
64b7884a83
186778
public/css/app.css
vendored
186778
public/css/app.css
vendored
File diff suppressed because one or more lines are too long
3311
public/js/app.js
vendored
3311
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
222
public/js/clients/invoices/action-selectors.js
vendored
222
public/js/clients/invoices/action-selectors.js
vendored
@ -1,220 +1,2 @@
|
||||
/******/ (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/action-selectors.js":
|
||||
/*!***********************************************************!*\
|
||||
!*** ./resources/js/clients/invoices/action-selectors.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) 2020. 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(".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();
|
||||
});
|
||||
}
|
||||
|
||||
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 _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
var _loop = function _loop() {
|
||||
var child = _step.value;
|
||||
child.addEventListener("click", function () {
|
||||
_this2.processChildItem(child, _this2.parentForm);
|
||||
});
|
||||
};
|
||||
|
||||
for (var _iterator = document.querySelectorAll(".form-check-child")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||
_loop();
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
||||
_iterator["return"]();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return ActionSelectors;
|
||||
}();
|
||||
/** @handle **/
|
||||
|
||||
|
||||
new ActionSelectors().handle();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5:
|
||||
/*!*****************************************************************!*\
|
||||
!*** multi ./resources/js/clients/invoices/action-selectors.js ***!
|
||||
\*****************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /home/david/Development/invoiceninja/resources/js/clients/invoices/action-selectors.js */"./resources/js/clients/invoices/action-selectors.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/*! 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=5)}({5:function(e,t,n){e.exports=n("Boob")},Boob: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.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var t,r,o;return t=e,(r=[{key:"watchCheckboxes",value:function(e){var t=this;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 n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.hasOwnProperty("single")&&document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()}));var r=document.createElement("INPUT");r.setAttribute("name","invoices[]"),r.setAttribute("value",e.dataset.value),r.setAttribute("class","child-hidden-input"),r.hidden=!0,t.append(r)}},{key:"handle",value:function(){var e=this;this.parentElement.addEventListener("click",(function(){e.watchCheckboxes(e.parentElement)}));var t=!0,n=!1,r=void 0;try{for(var o,c=function(){var t=o.value;t.addEventListener("click",(function(){e.processChildItem(t,e.parentForm)}))},u=document.querySelectorAll(".form-check-child")[Symbol.iterator]();!(t=(o=u.next()).done);t=!0)c()}catch(e){n=!0,r=e}finally{try{t||null==u.return||u.return()}finally{if(n)throw r}}}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}});
|
221
public/js/clients/invoices/payment.js
vendored
221
public/js/clients/invoices/payment.js
vendored
@ -1,219 +1,2 @@
|
||||
/******/ (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/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) 2020. 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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6:
|
||||
/*!********************************************************!*\
|
||||
!*** multi ./resources/js/clients/invoices/payment.js ***!
|
||||
\********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /home/david/Development/invoiceninja/resources/js/clients/invoices/payment.js */"./resources/js/clients/invoices/payment.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/*! 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=6)}({6: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()}});
|
196
public/js/clients/payment_methods/authorize-ach.js
vendored
196
public/js/clients/payment_methods/authorize-ach.js
vendored
@ -1,194 +1,2 @@
|
||||
/******/ (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/payment_methods/authorize-ach.js":
|
||||
/*!***************************************************************!*\
|
||||
!*** ./resources/js/clients/payment_methods/authorize-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) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var AuthorizeACH = /*#__PURE__*/function () {
|
||||
function AuthorizeACH() {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, AuthorizeACH);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
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) {
|
||||
_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) {
|
||||
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;
|
||||
}
|
||||
|
||||
_createClass(AuthorizeACH, [{
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this2 = this;
|
||||
|
||||
document.getElementById('token-form').addEventListener('submit', function (e) {
|
||||
return _this2.handleSubmit(e);
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return AuthorizeACH;
|
||||
}();
|
||||
|
||||
new AuthorizeACH().setupStripe().handle();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4:
|
||||
/*!*********************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payment_methods/authorize-ach.js ***!
|
||||
\*********************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /home/david/Development/invoiceninja/resources/js/clients/payment_methods/authorize-ach.js */"./resources/js/clients/payment_methods/authorize-ach.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/*! For license information please see authorize-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=4)}({4:function(e,t,n){e.exports=n("UWWK")},UWWK: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=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 t.stripe=Stripe(t.key),t})),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){t.errors.textContent="",t.errors.textContent=e,t.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){e.preventDefault(),t.errors.textContent="",t.errors.hidden=!0,t.stripe.createToken("bank_account",t.getFormData()).then((function(e){return e.hasOwnProperty("error")?t.handleError(e.error.message):t.handleSuccess(e)}))})),this.errors=document.getElementById("errors"),this.key=document.querySelector('meta[name="stripe-publishable-key"]').content}var t,o,u;return t=e,(o=[{key:"handle",value:function(){var e=this;document.getElementById("token-form").addEventListener("submit",(function(t){return e.handleSubmit(t)}))}}])&&n(t.prototype,o),u&&n(t,u),e}())).setupStripe().handle()}});
|
@ -1,249 +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 = 2);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./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; }
|
||||
|
||||
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) 2020. 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, "handleFormValidation", function () {
|
||||
document.getElementById("card_number").addEventListener('keyup', function (e) {
|
||||
var errors = document.getElementById('card_number_errors');
|
||||
|
||||
if (valid.number(e.target.value).isValid) {
|
||||
errors.hidden = true;
|
||||
_this.form.valid = true;
|
||||
} else {
|
||||
errors.textContent = _this.translations.invalidCard;
|
||||
errors.hidden = false;
|
||||
_this.form.valid = false;
|
||||
}
|
||||
});
|
||||
document.getElementById("expiration_month").addEventListener('keyup', function (e) {
|
||||
var errors = document.getElementById('expiration_month_errors');
|
||||
|
||||
if (valid.expirationMonth(e.target.value).isValid) {
|
||||
errors.hidden = true;
|
||||
_this.form.valid = true;
|
||||
} else {
|
||||
errors.textContent = _this.translations.invalidMonth;
|
||||
errors.hidden = false;
|
||||
_this.form.valid = false;
|
||||
}
|
||||
});
|
||||
document.getElementById("expiration_year").addEventListener('keyup', function (e) {
|
||||
var errors = document.getElementById('expiration_year_errors');
|
||||
|
||||
if (valid.expirationYear(e.target.value).isValid) {
|
||||
errors.hidden = true;
|
||||
_this.form.valid = true;
|
||||
} else {
|
||||
errors.textContent = _this.translations.invalidYear;
|
||||
errors.hidden = false;
|
||||
_this.form.valid = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
this.publicKey = publicKey;
|
||||
this.loginId = loginId;
|
||||
this.cardHolderName = document.getElementById("cardholder_name");
|
||||
this.cardButton = document.getElementById("card_button");
|
||||
this.form = {
|
||||
valid: false
|
||||
};
|
||||
this.translations = {
|
||||
invalidCard: document.querySelector('meta[name="credit-card-invalid"]').content,
|
||||
invalidMonth: document.querySelector('meta[name="month-invalid"]').content,
|
||||
invalidYear: document.querySelector('meta[name="year-invalid"]').content
|
||||
};
|
||||
}
|
||||
|
||||
_createClass(AuthorizeAuthorizeCard, [{
|
||||
key: "handleAuthorization",
|
||||
value: function handleAuthorization() {
|
||||
var authData = {};
|
||||
authData.clientKey = this.publicKey;
|
||||
authData.apiLoginID = this.loginId;
|
||||
var cardData = {};
|
||||
cardData.cardNumber = document.getElementById("card_number").value;
|
||||
cardData.month = document.getElementById("expiration_month").value;
|
||||
cardData.year = document.getElementById("expiration_year").value;
|
||||
cardData.cardCode = document.getElementById("cvv").value;
|
||||
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;
|
||||
|
||||
Accept.dispatchData(secureData, this.responseHandler);
|
||||
return false;
|
||||
}
|
||||
}, {
|
||||
key: "responseHandler",
|
||||
value: function responseHandler(response) {
|
||||
if (response.messages.resultCode === "Error") {
|
||||
var i = 0;
|
||||
|
||||
while (i < response.messages.message.length) {
|
||||
console.log(response.messages.message[i].code + ": " + response.messages.message[i].text);
|
||||
i = i + 1;
|
||||
}
|
||||
} 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 _this2 = this;
|
||||
|
||||
this.handleFormValidation(); // At this point as an small API you can request this.form.valid to check if input elements are valid.
|
||||
// Note: this.form.valid will not handle empty fields.
|
||||
|
||||
this.cardButton.addEventListener("click", function () {
|
||||
_this2.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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/*!********************************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payment_methods/authorize-authorize-card.js ***!
|
||||
\********************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /home/david/Development/invoiceninja/resources/js/clients/payment_methods/authorize-authorize-card.js */"./resources/js/clients/payment_methods/authorize-authorize-card.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
!function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},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("6vDv")},"6vDv":function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}new(function(){function e(t,n){var a,r,o,i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o=function(){document.getElementById("card_number").addEventListener("keyup",(function(e){var t=document.getElementById("card_number_errors");valid.number(e.target.value).isValid?(t.hidden=!0,i.form.valid=!0):(t.textContent=i.translations.invalidCard,t.hidden=!1,i.form.valid=!1)})),document.getElementById("expiration_month").addEventListener("keyup",(function(e){var t=document.getElementById("expiration_month_errors");valid.expirationMonth(e.target.value).isValid?(t.hidden=!0,i.form.valid=!0):(t.textContent=i.translations.invalidMonth,t.hidden=!1,i.form.valid=!1)})),document.getElementById("expiration_year").addEventListener("keyup",(function(e){var t=document.getElementById("expiration_year_errors");valid.expirationYear(e.target.value).isValid?(t.hidden=!0,i.form.valid=!0):(t.textContent=i.translations.invalidYear,t.hidden=!1,i.form.valid=!1)}))},(r="handleFormValidation")in(a=this)?Object.defineProperty(a,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):a[r]=o,this.publicKey=t,this.loginId=n,this.cardHolderName=document.getElementById("cardholder_name"),this.cardButton=document.getElementById("card_button"),this.form={valid:!1},this.translations={invalidCard:document.querySelector('meta[name="credit-card-invalid"]').content,invalidMonth:document.querySelector('meta[name="month-invalid"]').content,invalidYear:document.querySelector('meta[name="year-invalid"]').content}}var t,a,r;return t=e,(a=[{key:"handleAuthorization",value:function(){var e={};e.clientKey=this.publicKey,e.apiLoginID=this.loginId;var t={};t.cardNumber=document.getElementById("card_number").value,t.month=document.getElementById("expiration_month").value,t.year=document.getElementById("expiration_year").value,t.cardCode=document.getElementById("cvv").value;var n={};return n.authData=e,n.cardData=t,Accept.dispatchData(n,this.responseHandler),!1}},{key:"responseHandler",value:function(e){if("Error"===e.messages.resultCode)for(var t=0;t<e.messages.message.length;)console.log(e.messages.message[t].code+": "+e.messages.message[t].text),t+=1;else"Ok"===e.messages.resultCode&&(document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue,document.getElementById("server_response").submit());return!1}},{key:"handle",value:function(){var e=this;return this.handleFormValidation(),this.cardButton.addEventListener("click",(function(){e.cardButton.disabled=!e.cardButton.disabled})),this}}])&&n(t.prototype,a),r&&n(t,r),e}())(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()}});
|
@ -1,209 +1,2 @@
|
||||
/******/ (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-stripe-card.js":
|
||||
/*!***********************************************************************!*\
|
||||
!*** ./resources/js/clients/payment_methods/authorize-stripe-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) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var AuthorizeStripeCard = /*#__PURE__*/function () {
|
||||
function AuthorizeStripeCard(key) {
|
||||
_classCallCheck(this, AuthorizeStripeCard);
|
||||
|
||||
this.key = key;
|
||||
this.cardHolderName = document.getElementById("cardholder-name");
|
||||
this.cardButton = document.getElementById("card-button");
|
||||
this.clientSecret = this.cardButton.dataset.secret;
|
||||
}
|
||||
|
||||
_createClass(AuthorizeStripeCard, [{
|
||||
key: "setupStripe",
|
||||
value: function setupStripe() {
|
||||
this.stripe = Stripe(this.key);
|
||||
this.elements = this.stripe.elements();
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "createElement",
|
||||
value: function createElement() {
|
||||
this.cardElement = this.elements.create("card");
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "mountCardElement",
|
||||
value: function mountCardElement() {
|
||||
this.cardElement.mount("#card-element");
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "handleStripe",
|
||||
value: function handleStripe(stripe, cardHolderName) {
|
||||
var _this = this;
|
||||
|
||||
stripe.handleCardSetup(this.clientSecret, this.cardElement, {
|
||||
payment_method_data: {
|
||||
billing_details: {
|
||||
name: cardHolderName.value
|
||||
}
|
||||
}
|
||||
}).then(function (result) {
|
||||
if (result.error) {
|
||||
return _this.handleFailure(result);
|
||||
}
|
||||
|
||||
return _this.handleSuccess(result);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handleFailure",
|
||||
value: function handleFailure(result) {
|
||||
var errors = document.getElementById("errors");
|
||||
errors.textContent = "";
|
||||
errors.textContent = result.error.message;
|
||||
errors.hidden = false;
|
||||
}
|
||||
}, {
|
||||
key: "handleSuccess",
|
||||
value: function handleSuccess(result) {
|
||||
document.getElementById("gateway_response").value = JSON.stringify(result.setupIntent);
|
||||
document.getElementById("is_default").value = document.getElementById("proxy_is_default").checked;
|
||||
document.getElementById("server_response").submit();
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this2 = this;
|
||||
|
||||
this.setupStripe().createElement().mountCardElement();
|
||||
this.cardButton.addEventListener("click", function () {
|
||||
_this2.handleStripe(_this2.stripe, _this2.cardHolderName);
|
||||
});
|
||||
return this;
|
||||
}
|
||||
}]);
|
||||
|
||||
return AuthorizeStripeCard;
|
||||
}();
|
||||
|
||||
var publishableKey = document.querySelector('meta[name="stripe-publishable-key"]').content;
|
||||
/** @handle */
|
||||
|
||||
new AuthorizeStripeCard(publishableKey).handle();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/*!*****************************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payment_methods/authorize-stripe-card.js ***!
|
||||
\*****************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /home/david/Development/invoiceninja/resources/js/clients/payment_methods/authorize-stripe-card.js */"./resources/js/clients/payment_methods/authorize-stripe-card.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/*! For license information please see authorize-stripe-card.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=1)}({1:function(e,t,n){e.exports=n("jzun")},jzun: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){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.key=t,this.cardHolderName=document.getElementById("cardholder-name"),this.cardButton=document.getElementById("card-button"),this.clientSecret=this.cardButton.dataset.secret}var t,r,u;return t=e,(r=[{key:"setupStripe",value:function(){return this.stripe=Stripe(this.key),this.elements=this.stripe.elements(),this}},{key:"createElement",value:function(){return this.cardElement=this.elements.create("card"),this}},{key:"mountCardElement",value:function(){return this.cardElement.mount("#card-element"),this}},{key:"handleStripe",value:function(e,t){var n=this;e.handleCardSetup(this.clientSecret,this.cardElement,{payment_method_data:{billing_details:{name:t.value}}}).then((function(e){return e.error?n.handleFailure(e):n.handleSuccess(e)}))}},{key:"handleFailure",value:function(e){var t=document.getElementById("errors");t.textContent="",t.textContent=e.error.message,t.hidden=!1}},{key:"handleSuccess",value:function(e){document.getElementById("gateway_response").value=JSON.stringify(e.setupIntent),document.getElementById("is_default").value=document.getElementById("proxy_is_default").checked,document.getElementById("server_response").submit()}},{key:"handle",value:function(){var e=this;return this.setupStripe().createElement().mountCardElement(),this.cardButton.addEventListener("click",(function(){e.handleStripe(e.stripe,e.cardHolderName)})),this}}])&&n(t.prototype,r),u&&n(t,u),e}())(document.querySelector('meta[name="stripe-publishable-key"]').content).handle()}});
|
166
public/js/clients/payments/alipay.js
vendored
166
public/js/clients/payments/alipay.js
vendored
@ -1,164 +1,2 @@
|
||||
/******/ (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/alipay.js":
|
||||
/*!*************************************************!*\
|
||||
!*** ./resources/js/clients/payments/alipay.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 _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) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessAlipay = function ProcessAlipay(key) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ProcessAlipay);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
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('submit', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
_this.stripe.createSource(data).then(function (result) {
|
||||
if (result.hasOwnProperty('source')) {
|
||||
return window.location = result.source.redirect.url;
|
||||
}
|
||||
|
||||
this.errors.textContent = '';
|
||||
this.errors.textContent = result.error.message;
|
||||
this.errors.hidden = false;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.key = key;
|
||||
this.errors = document.getElementById('errors');
|
||||
};
|
||||
|
||||
var publishableKey = document.querySelector('meta[name="stripe-publishable-key"]').content;
|
||||
new ProcessAlipay(publishableKey).setupStripe().handle();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8:
|
||||
/*!*******************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/alipay.js ***!
|
||||
\*******************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /home/david/Development/invoiceninja/resources/js/clients/payments/alipay.js */"./resources/js/clients/payments/alipay.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/*! For license information please see alipay.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=8)}({8:function(e,t,r){e.exports=r("HToU")},HToU:function(e,t){function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}new function e(t){var 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})),r(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("submit",(function(t){t.preventDefault(),n.stripe.createSource(e).then((function(e){if(e.hasOwnProperty("source"))return window.location=e.source.redirect.url;this.errors.textContent="",this.errors.textContent=e.error.message,this.errors.hidden=!1}))}))})),this.key=t,this.errors=document.getElementById("errors")}(document.querySelector('meta[name="stripe-publishable-key"]').content).setupStripe().handle()}});
|
@ -1,243 +1,2 @@
|
||||
/******/ (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/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) 2020. 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');
|
||||
cardData.month = myCard.CardJs('expiryMonth');
|
||||
cardData.year = myCard.CardJs('expiryYear');
|
||||
;
|
||||
cardData.cardCode = document.getElementById("cvv").value;
|
||||
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;
|
||||
|
||||
Accept.dispatchData(secureData, _this.responseHandler);
|
||||
return false;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
if (_this.cardButton) {
|
||||
_this.cardButton.addEventListener("click", function () {
|
||||
_this.cardButton.disabled = true;
|
||||
|
||||
_this.handleAuthorization();
|
||||
});
|
||||
}
|
||||
|
||||
if (_this.payNowButton) {
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
var _loop = function _loop() {
|
||||
var item = _step.value;
|
||||
item.addEventListener('click', function () {
|
||||
item.disabled = true;
|
||||
|
||||
_this.handlePayNowAction(item.dataset.id);
|
||||
});
|
||||
};
|
||||
|
||||
for (var _iterator = _this.payNowButton[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||
_loop();
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
||||
_iterator["return"]();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _this;
|
||||
});
|
||||
|
||||
this.publicKey = publicKey;
|
||||
this.loginId = loginId;
|
||||
this.cardHolderName = document.getElementById("cardholder_name");
|
||||
this.cardButton = document.getElementById("card_button");
|
||||
this.payNowButton = document.getElementsByClassName("pay_now_button");
|
||||
}
|
||||
|
||||
_createClass(AuthorizeAuthorizeCard, [{
|
||||
key: "handlePayNowAction",
|
||||
value: function handlePayNowAction(token_hashed_id) {
|
||||
document.getElementById("token").value = token_hashed_id;
|
||||
document.getElementById("server_response").submit();
|
||||
}
|
||||
}, {
|
||||
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>");
|
||||
} else if (response.messages.resultCode === "Ok") {
|
||||
document.getElementById("dataDescriptor").value = response.opaqueData.dataDescriptor;
|
||||
document.getElementById("dataValue").value = response.opaqueData.dataValue;
|
||||
document.getElementById("store_card").value = document.getElementById("store_card_checkbox").checked;
|
||||
document.getElementById("server_response").submit();
|
||||
}
|
||||
|
||||
this.cardButton.disabled = false;
|
||||
return false;
|
||||
}
|
||||
}]);
|
||||
|
||||
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();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/*!******************************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/authorize-credit-card-payment.js ***!
|
||||
\******************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /home/david/Development/invoiceninja/resources/js/clients/payments/authorize-credit-card-payment.js */"./resources/js/clients/payments/authorize-credit-card-payment.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/*! 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=3)}({3: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"),n.month=e.CardJs("expiryMonth"),n.year=e.CardJs("expiryYear"),n.cardCode=document.getElementById("cvv").value;var r={};return r.authData=t,r.cardData=n,Accept.dispatchData(r,a.responseHandler),!1})),r(this,"handle",(function(){if(a.cardButton&&a.cardButton.addEventListener("click",(function(){a.cardButton.disabled=!0,a.handleAuthorization()})),a.payNowButton){var e=!0,t=!1,n=void 0;try{for(var r,o=function(){var e=r.value;e.addEventListener("click",(function(){e.disabled=!0,a.handlePayNowAction(e.dataset.id)}))},u=a.payNowButton[Symbol.iterator]();!(e=(r=u.next()).done);e=!0)o()}catch(e){t=!0,n=e}finally{try{e||null==u.return||u.return()}finally{if(t)throw n}}}return a})),this.publicKey=t,this.loginId=n,this.cardHolderName=document.getElementById("cardholder_name"),this.cardButton=document.getElementById("card_button"),this.payNowButton=document.getElementsByClassName("pay_now_button")}var t,a,o;return t=e,(a=[{key:"handlePayNowAction",value:function(e){document.getElementById("token").value=e,document.getElementById("server_response").submit()}},{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>"):"Ok"===e.messages.resultCode&&(document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue,document.getElementById("store_card").value=document.getElementById("store_card_checkbox").checked,document.getElementById("server_response").submit()),this.cardButton.disabled=!1,!1}}])&&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()}});
|
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
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
135
public/js/clients/payments/checkout.com.js
vendored
135
public/js/clients/payments/checkout.com.js
vendored
@ -1,133 +1,2 @@
|
||||
/******/ (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/payments/checkout.com.js":
|
||||
/*!*******************************************************!*\
|
||||
!*** ./resources/js/clients/payments/checkout.com.js ***!
|
||||
\*******************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
window.CKOConfig = {
|
||||
publicKey: document.querySelector('meta[name="public-key"]').content,
|
||||
customerEmail: document.querySelector('meta[name="customer-email"]').content,
|
||||
value: document.querySelector('meta[name="value"]').content,
|
||||
currency: document.querySelector('meta[name="currency"]').content,
|
||||
paymentMode: 'cards',
|
||||
cardFormMode: 'cardTokenisation',
|
||||
cardTokenised: function cardTokenised(event) {
|
||||
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(event.data);
|
||||
document.querySelector('input[name="store_card"]').value = document.getElementById('store-card-checkbox').checked ? 1 : 0;
|
||||
document.getElementById('server-response').submit();
|
||||
}
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 9:
|
||||
/*!*************************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/checkout.com.js ***!
|
||||
\*************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /home/david/Development/invoiceninja/resources/js/clients/payments/checkout.com.js */"./resources/js/clients/payments/checkout.com.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/*! For license information please see checkout.com.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("XYrq")},XYrq:function(e,t){window.CKOConfig={publicKey:document.querySelector('meta[name="public-key"]').content,customerEmail:document.querySelector('meta[name="customer-email"]').content,value:document.querySelector('meta[name="value"]').content,currency:document.querySelector('meta[name="currency"]').content,paymentMode:"cards",cardFormMode:"cardTokenisation",cardTokenised:function(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.data),document.querySelector('input[name="store_card"]').value=document.getElementById("store-card-checkbox").checked?1:0,document.getElementById("server-response").submit()}}}});
|
240
public/js/clients/payments/process.js
vendored
240
public/js/clients/payments/process.js
vendored
@ -1,238 +1,2 @@
|
||||
/******/ (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 = 12);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./resources/js/clients/payments/process.js":
|
||||
/*!**************************************************!*\
|
||||
!*** ./resources/js/clients/payments/process.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) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessStripePayment = /*#__PURE__*/function () {
|
||||
function ProcessStripePayment(key, usingToken) {
|
||||
_classCallCheck(this, ProcessStripePayment);
|
||||
|
||||
this.key = key;
|
||||
this.usingToken = usingToken;
|
||||
}
|
||||
|
||||
_createClass(ProcessStripePayment, [{
|
||||
key: "setupStripe",
|
||||
value: function setupStripe() {
|
||||
this.stripe = Stripe(this.key);
|
||||
this.elements = this.stripe.elements();
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "createElement",
|
||||
value: function createElement() {
|
||||
this.cardElement = this.elements.create("card");
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "mountCardElement",
|
||||
value: function mountCardElement() {
|
||||
this.cardElement.mount("#card-element");
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: "completePaymentUsingToken",
|
||||
value: function completePaymentUsingToken() {
|
||||
var _this = this;
|
||||
|
||||
var payNowButton = document.getElementById("pay-now-with-token");
|
||||
this.stripe.handleCardPayment(payNowButton.dataset.secret, {
|
||||
payment_method: payNowButton.dataset.token
|
||||
}).then(function (result) {
|
||||
if (result.error) {
|
||||
return _this.handleFailure(result.error.message);
|
||||
}
|
||||
|
||||
return _this.handleSuccess(result);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "completePaymentWithoutToken",
|
||||
value: function completePaymentWithoutToken() {
|
||||
var _this2 = this;
|
||||
|
||||
var payNowButton = document.getElementById("pay-now");
|
||||
var cardHolderName = document.getElementById("cardholder-name");
|
||||
this.stripe.handleCardPayment(payNowButton.dataset.secret, this.cardElement, {
|
||||
payment_method_data: {
|
||||
billing_details: {
|
||||
name: cardHolderName.value
|
||||
}
|
||||
}
|
||||
}).then(function (result) {
|
||||
if (result.error) {
|
||||
return _this2.handleFailure(result.error.message);
|
||||
}
|
||||
|
||||
return _this2.handleSuccess(result);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handleSuccess",
|
||||
value: function handleSuccess(result) {
|
||||
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(result.paymentIntent);
|
||||
var tokenBillingCheckbox = document.querySelector('input[name="token-billing-checkbox"]');
|
||||
|
||||
if (tokenBillingCheckbox) {
|
||||
document.querySelector('input[name="store_card"]').value = tokenBillingCheckbox.checked;
|
||||
}
|
||||
|
||||
document.getElementById("server-response").submit();
|
||||
}
|
||||
}, {
|
||||
key: "handleFailure",
|
||||
value: function handleFailure(message) {
|
||||
var errors = document.getElementById("errors");
|
||||
errors.textContent = "";
|
||||
errors.textContent = message;
|
||||
errors.hidden = false;
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this3 = this;
|
||||
|
||||
this.setupStripe();
|
||||
|
||||
if (this.usingToken) {
|
||||
document.getElementById("pay-now-with-token").addEventListener("click", function () {
|
||||
return _this3.completePaymentUsingToken();
|
||||
});
|
||||
}
|
||||
|
||||
if (!this.usingToken) {
|
||||
this.createElement().mountCardElement();
|
||||
document.getElementById("pay-now").addEventListener("click", function () {
|
||||
return _this3.completePaymentWithoutToken();
|
||||
});
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return ProcessStripePayment;
|
||||
}();
|
||||
|
||||
var publishableKey = document.querySelector('meta[name="stripe-publishable-key"]').content;
|
||||
var usingToken = document.querySelector('meta[name="using-token"]').content;
|
||||
new ProcessStripePayment(publishableKey, usingToken).handle();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 12:
|
||||
/*!********************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/process.js ***!
|
||||
\********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /home/david/Development/invoiceninja/resources/js/clients/payments/process.js */"./resources/js/clients/payments/process.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/*! For license information please see process.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=12)}({12:function(e,t,n){e.exports=n("OXGg")},OXGg: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.key=t,this.usingToken=n}var t,r,o;return t=e,(r=[{key:"setupStripe",value:function(){return this.stripe=Stripe(this.key),this.elements=this.stripe.elements(),this}},{key:"createElement",value:function(){return this.cardElement=this.elements.create("card"),this}},{key:"mountCardElement",value:function(){return this.cardElement.mount("#card-element"),this}},{key:"completePaymentUsingToken",value:function(){var e=this,t=document.getElementById("pay-now-with-token");this.stripe.handleCardPayment(t.dataset.secret,{payment_method:t.dataset.token}).then((function(t){return t.error?e.handleFailure(t.error.message):e.handleSuccess(t)}))}},{key:"completePaymentWithoutToken",value:function(){var e=this,t=document.getElementById("pay-now"),n=document.getElementById("cardholder-name");this.stripe.handleCardPayment(t.dataset.secret,this.cardElement,{payment_method_data:{billing_details:{name:n.value}}}).then((function(t){return t.error?e.handleFailure(t.error.message):e.handleSuccess(t)}))}},{key:"handleSuccess",value:function(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);var t=document.querySelector('input[name="token-billing-checkbox"]');t&&(document.querySelector('input[name="store_card"]').value=t.checked),document.getElementById("server-response").submit()}},{key:"handleFailure",value:function(e){var t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1}},{key:"handle",value:function(){var e=this;this.setupStripe(),this.usingToken&&document.getElementById("pay-now-with-token").addEventListener("click",(function(){return e.completePaymentUsingToken()})),this.usingToken||(this.createElement().mountCardElement(),document.getElementById("pay-now").addEventListener("click",(function(){return e.completePaymentWithoutToken()})))}}])&&n(t.prototype,r),o&&n(t,o),e}())(document.querySelector('meta[name="stripe-publishable-key"]').content,document.querySelector('meta[name="using-token"]').content).handle()}});
|
169
public/js/clients/payments/sofort.js
vendored
169
public/js/clients/payments/sofort.js
vendored
@ -1,167 +1,2 @@
|
||||
/******/ (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/sofort.js":
|
||||
/*!*************************************************!*\
|
||||
!*** ./resources/js/clients/payments/sofort.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 _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) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var ProcessSOFORT = function ProcessSOFORT(key) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ProcessSOFORT);
|
||||
|
||||
_defineProperty(this, "setupStripe", function () {
|
||||
_this.stripe = Stripe(_this.key);
|
||||
return _this;
|
||||
});
|
||||
|
||||
_defineProperty(this, "handle", function () {
|
||||
var data = {
|
||||
type: 'sofort',
|
||||
amount: document.querySelector('meta[name="amount"]').content,
|
||||
currency: 'eur',
|
||||
redirect: {
|
||||
return_url: document.querySelector('meta[name="return-url"]').content
|
||||
},
|
||||
sofort: {
|
||||
country: document.querySelector('meta[name="country"').content
|
||||
}
|
||||
};
|
||||
document.getElementById('pay-now').addEventListener('submit', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
_this.stripe.createSource(data).then(function (result) {
|
||||
if (result.hasOwnProperty('source')) {
|
||||
return window.location = result.source.redirect.url;
|
||||
}
|
||||
|
||||
this.errors.textContent = '';
|
||||
this.errors.textContent = result.error.message;
|
||||
this.errors.hidden = false;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.key = key;
|
||||
this.errors = document.getElementById('errors');
|
||||
};
|
||||
|
||||
var publishableKey = document.querySelector('meta[name="stripe-publishable-key"]').content;
|
||||
new ProcessSOFORT(publishableKey).setupStripe().handle();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 7:
|
||||
/*!*******************************************************!*\
|
||||
!*** multi ./resources/js/clients/payments/sofort.js ***!
|
||||
\*******************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /home/david/Development/invoiceninja/resources/js/clients/payments/sofort.js */"./resources/js/clients/payments/sofort.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/*! For license information please see sofort.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=7)}({7:function(e,t,r){e.exports=r("Zfcc")},Zfcc:function(e,t){function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}new function e(t){var 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})),r(this,"handle",(function(){var e={type:"sofort",amount:document.querySelector('meta[name="amount"]').content,currency:"eur",redirect:{return_url:document.querySelector('meta[name="return-url"]').content},sofort:{country:document.querySelector('meta[name="country"').content}};document.getElementById("pay-now").addEventListener("submit",(function(t){t.preventDefault(),n.stripe.createSource(e).then((function(e){if(e.hasOwnProperty("source"))return window.location=e.source.redirect.url;this.errors.textContent="",this.errors.textContent=e.error.message,this.errors.hidden=!1}))}))})),this.key=t,this.errors=document.getElementById("errors")}(document.querySelector('meta[name="stripe-publishable-key"]').content).setupStripe().handle()}});
|
222
public/js/clients/quotes/action-selectors.js
vendored
222
public/js/clients/quotes/action-selectors.js
vendored
@ -1,220 +1,2 @@
|
||||
/******/ (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/action-selectors.js":
|
||||
/*!*********************************************************!*\
|
||||
!*** ./resources/js/clients/quotes/action-selectors.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) 2020. 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(".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();
|
||||
});
|
||||
}
|
||||
|
||||
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 _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
var _loop = function _loop() {
|
||||
var child = _step.value;
|
||||
child.addEventListener("click", function () {
|
||||
_this2.processChildItem(child, _this2.parentForm);
|
||||
});
|
||||
};
|
||||
|
||||
for (var _iterator = document.querySelectorAll(".form-check-child")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||
_loop();
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
||||
_iterator["return"]();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return ActionSelectors;
|
||||
}();
|
||||
/** @handle **/
|
||||
|
||||
|
||||
new ActionSelectors().handle();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 10:
|
||||
/*!***************************************************************!*\
|
||||
!*** multi ./resources/js/clients/quotes/action-selectors.js ***!
|
||||
\***************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /home/david/Development/invoiceninja/resources/js/clients/quotes/action-selectors.js */"./resources/js/clients/quotes/action-selectors.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/*! 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=10)}({10:function(e,t,n){e.exports=n("ydWM")},ydWM: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.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var t,r,o;return t=e,(r=[{key:"watchCheckboxes",value:function(e){var t=this;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 n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.hasOwnProperty("single")&&document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()}));var r=document.createElement("INPUT");r.setAttribute("name","quotes[]"),r.setAttribute("value",e.dataset.value),r.setAttribute("class","child-hidden-input"),r.hidden=!0,t.append(r)}},{key:"handle",value:function(){var e=this;this.parentElement.addEventListener("click",(function(){e.watchCheckboxes(e.parentElement)}));var t=!0,n=!1,r=void 0;try{for(var o,c=function(){var t=o.value;t.addEventListener("click",(function(){e.processChildItem(t,e.parentForm)}))},u=document.querySelectorAll(".form-check-child")[Symbol.iterator]();!(t=(o=u.next()).done);t=!0)c()}catch(e){n=!0,r=e}finally{try{t||null==u.return||u.return()}finally{if(n)throw r}}}}])&&n(t.prototype,r),o&&n(t,o),e}())).handle()}});
|
174
public/js/clients/quotes/approve.js
vendored
174
public/js/clients/quotes/approve.js
vendored
@ -1,172 +1,2 @@
|
||||
/******/ (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 = 11);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./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) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
var Approve = /*#__PURE__*/function () {
|
||||
function Approve(displaySignature) {
|
||||
_classCallCheck(this, Approve);
|
||||
|
||||
this.shouldDisplaySignature = displaySignature;
|
||||
}
|
||||
|
||||
_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'), {
|
||||
backgroundColor: 'rgb(240,240,240)',
|
||||
penColor: 'rgb(0, 0, 0)'
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "handle",
|
||||
value: function handle() {
|
||||
var _this = this;
|
||||
|
||||
document.getElementById('approve-button').addEventListener('click', function () {
|
||||
if (_this.shouldDisplaySignature) {
|
||||
_this.displaySignature();
|
||||
|
||||
document.getElementById('signature-next-step').addEventListener('click', function () {
|
||||
_this.submitForm();
|
||||
});
|
||||
}
|
||||
|
||||
if (!_this.shouldDisplaySignature) _this.submitForm();
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return Approve;
|
||||
}();
|
||||
|
||||
var signature = document.querySelector('meta[name="require-quote-signature"]').content;
|
||||
new Approve(Boolean(+signature)).handle();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 11:
|
||||
/*!******************************************************!*\
|
||||
!*** multi ./resources/js/clients/quotes/approve.js ***!
|
||||
\******************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! /home/david/Development/invoiceninja/resources/js/clients/quotes/approve.js */"./resources/js/clients/quotes/approve.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/*! For license information please see approve.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=11)}({11: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){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.shouldDisplaySignature=t}var t,r,o;return t=e,(r=[{key:"submitForm",value:function(){document.getElementById("approve-form").submit()}},{key:"displaySignature",value:function(){document.getElementById("displaySignatureModal").removeAttribute("style"),new SignaturePad(document.getElementById("signature-pad"),{backgroundColor:"rgb(240,240,240)",penColor:"rgb(0, 0, 0)"})}},{key:"handle",value:function(){var e=this;document.getElementById("approve-button").addEventListener("click",(function(){e.shouldDisplaySignature&&(e.displaySignature(),document.getElementById("signature-next-step").addEventListener("click",(function(){e.submitForm()}))),e.shouldDisplaySignature||e.submitForm()}))}}])&&n(t.prototype,r),o&&n(t,o),e}(),o=document.querySelector('meta[name="require-quote-signature"]').content;new r(Boolean(+o)).handle()}});
|
1006
public/js/clients/shared/pdf.js
vendored
1006
public/js/clients/shared/pdf.js
vendored
File diff suppressed because one or more lines are too long
2224
public/js/setup/setup.js
vendored
2224
public/js/setup/setup.js
vendored
File diff suppressed because one or more lines are too long
@ -1,20 +1,20 @@
|
||||
{
|
||||
"/js/app.js": "/js/app.js?id=ff27ccddd30b0e7b4db9",
|
||||
"/css/app.css": "/css/app.css?id=b4f28bc71925ec9b1f74",
|
||||
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=563d7bee34bc37e1d3d6",
|
||||
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=d24207c686e5fce2ca0d",
|
||||
"/js/clients/payment_methods/authorize-ach.js": "/js/clients/payment_methods/authorize-ach.js?id=789fe0ea7dff85c943ad",
|
||||
"/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=7f63b5cd48631432a424",
|
||||
"/js/clients/payment_methods/authorize-stripe-card.js": "/js/clients/payment_methods/authorize-stripe-card.js?id=420e22ba244289dd75f8",
|
||||
"/js/clients/payments/alipay.js": "/js/clients/payments/alipay.js?id=cf114848ef8a3633a51b",
|
||||
"/js/clients/payments/authorize-credit-card-payment.js": "/js/clients/payments/authorize-credit-card-payment.js?id=a474e669b65198f7ce6f",
|
||||
"/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=3fe6822360e6c456d1a2",
|
||||
"/js/clients/payments/checkout.com.js": "/js/clients/payments/checkout.com.js?id=31df208670107e18f59d",
|
||||
"/js/clients/payments/process.js": "/js/clients/payments/process.js?id=f4c4b09d4454070a6db6",
|
||||
"/js/clients/payments/sofort.js": "/js/clients/payments/sofort.js?id=07f8d2205263058e5ba4",
|
||||
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=24201ac11ba77c6a6261",
|
||||
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=2cbf6713ca352ba18b03",
|
||||
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=bc40e9b54768213d34b9",
|
||||
"/js/setup/setup.js": "/js/setup/setup.js?id=276c75e51213f0cf5835",
|
||||
"/js/app.js": "/js/app.js?id=baf7fef12d5e65c3d9ff",
|
||||
"/css/app.css": "/css/app.css?id=8520caf5bca7a47876a2",
|
||||
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=0632d6281202800e0921",
|
||||
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=d7e708d66a9c769b4c6e",
|
||||
"/js/clients/payment_methods/authorize-ach.js": "/js/clients/payment_methods/authorize-ach.js?id=9e6495d9ae236b3cb5ad",
|
||||
"/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=3f6129bf10ff3bf20332",
|
||||
"/js/clients/payment_methods/authorize-stripe-card.js": "/js/clients/payment_methods/authorize-stripe-card.js?id=f4c45f0da9868d840799",
|
||||
"/js/clients/payments/alipay.js": "/js/clients/payments/alipay.js?id=428ac5b81ed722636e8f",
|
||||
"/js/clients/payments/authorize-credit-card-payment.js": "/js/clients/payments/authorize-credit-card-payment.js?id=3a74587f41c617a7cc81",
|
||||
"/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=7200ac43b87bddf1bedc",
|
||||
"/js/clients/payments/checkout.com.js": "/js/clients/payments/checkout.com.js?id=42d239882b80af83ad22",
|
||||
"/js/clients/payments/process.js": "/js/clients/payments/process.js?id=49b220081e0d7fa8140b",
|
||||
"/js/clients/payments/sofort.js": "/js/clients/payments/sofort.js?id=ff4ad07a93bd9fb327c1",
|
||||
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=2fe0ad3e46ead2edb8c3",
|
||||
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=1c5d76fb5f98bd49f6c8",
|
||||
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=b70e8547534a34ea85e2",
|
||||
"/js/setup/setup.js": "/js/setup/setup.js?id=87653cfb4084aadea7a2",
|
||||
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ad"
|
||||
}
|
||||
|
@ -116,7 +116,8 @@ class AuthorizeAuthorizeCard {
|
||||
// Note: this.form.valid will not handle empty fields.
|
||||
|
||||
this.cardButton.addEventListener("click", () => {
|
||||
this.handleAuthorization();
|
||||
this.cardButton.disabled = !this.cardButton.disabled;
|
||||
// this.handleAuthorization();
|
||||
});
|
||||
|
||||
|
||||
|
@ -2,74 +2,78 @@
|
||||
@section('meta_title', ctrans('texts.add_credit_card'))
|
||||
|
||||
@push('head')
|
||||
<meta name="authorize-public-key" content="{{ $public_client_id }}">
|
||||
<meta name="authorize-login-id" content="{{ $api_login_id }}">
|
||||
|
||||
<meta name="year-invalid" content="{{ ctrans('texts.year_invalid') }}">
|
||||
<meta name="month-invalid" content="{{ ctrans('texts.month_invalid') }}">
|
||||
<meta name="credit-card-invalid" content="{{ ctrans('texts.credit_card_invalid') }}">
|
||||
<meta name="authorize-public-key" content="{{ $public_client_id }}">
|
||||
<meta name="authorize-login-id" content="{{ $api_login_id }}">
|
||||
|
||||
<meta name="year-invalid" content="{{ ctrans('texts.year_invalid') }}">
|
||||
<meta name="month-invalid" content="{{ ctrans('texts.month_invalid') }}">
|
||||
<meta name="credit-card-invalid" content="{{ ctrans('texts.credit_card_invalid') }}">
|
||||
|
||||
|
||||
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
|
||||
<script src="{{ asset('js/clients/payments/card-js.min.js') }}"></script>
|
||||
<link href="{{ asset('css/card-js.min.css') }}" rel="stylesheet" type="text/css">
|
||||
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
|
||||
<script src="{{ asset('js/clients/payments/card-js.min.js') }}"></script>
|
||||
<link href="{{ asset('css/card-js.min.css') }}" rel="stylesheet" type="text/css">
|
||||
|
||||
@endpush
|
||||
|
||||
@section('body')
|
||||
<form action="{{ route('client.payment_methods.store') }}" method="post" id="server_response">
|
||||
@csrf
|
||||
<input type="hidden" name="company_gateway_id" value="{{ $gateway->id }}">
|
||||
<input type="hidden" name="payment_method_id" value="1">
|
||||
<input type="hidden" name="gateway_response" id="gateway_response">
|
||||
<input type="hidden" name="is_default" id="is_default">
|
||||
<input type="hidden" name="dataValue" id="dataValue" />
|
||||
<input type="hidden" name="dataDescriptor" id="dataDescriptor" />
|
||||
</form>
|
||||
<div class="container mx-auto">
|
||||
<div class="grid grid-cols-6 gap-4">
|
||||
<div class="col-span-6 md:col-start-2 md:col-span-4">
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
<div class="bg-white shadow overflow-hidden sm:rounded-lg">
|
||||
<div class="px-4 py-5 border-b border-gray-200 sm:px-6">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||
{{ ctrans('texts.add_credit_card') }}
|
||||
</h3>
|
||||
<p class="mt-1 max-w-2xl text-sm leading-5 text-gray-500" translate>
|
||||
{{ ctrans('texts.authorize_for_future_use') }}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<dl>
|
||||
@include('portal.ninja2020.gateways.authorize.credit_card')
|
||||
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||
{{ ctrans('texts.save_as_default') }}
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
|
||||
<input type="checkbox" class="form-checkbox cursor-pointer" name="proxy_is_default" id="proxy_is_default" />
|
||||
</dd>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-5 flex justify-end">
|
||||
<form action="{{ route('client.payment_methods.store') }}" method="post" id="server_response">
|
||||
@csrf
|
||||
<input type="hidden" name="company_gateway_id" value="{{ $gateway->id }}">
|
||||
<input type="hidden" name="payment_method_id" value="1">
|
||||
<input type="hidden" name="gateway_response" id="gateway_response">
|
||||
<input type="hidden" name="is_default" id="is_default">
|
||||
<input type="hidden" name="dataValue" id="dataValue" />
|
||||
<input type="hidden" name="dataDescriptor" id="dataDescriptor" />
|
||||
</form>
|
||||
<div class="container mx-auto">
|
||||
<div class="grid grid-cols-6 gap-4">
|
||||
<div class="col-span-6 md:col-start-2 md:col-span-3">
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
<div class="bg-white shadow overflow-hidden sm:rounded-lg">
|
||||
<div class="px-4 py-5 border-b border-gray-200 sm:px-6">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||
{{ ctrans('texts.add_credit_card') }}
|
||||
</h3>
|
||||
<p class="mt-1 max-w-2xl text-sm leading-5 text-gray-500" translate>
|
||||
{{ ctrans('texts.authorize_for_future_use') }}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<dl>
|
||||
<div class="bg-gray-50 px-4 py-5 sm:px-6">
|
||||
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 flex justify-center">
|
||||
@include('portal.ninja2020.gateways.authorize.credit_card')
|
||||
</dd>
|
||||
</div>
|
||||
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||
{{ ctrans('texts.save_as_default') }}
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
|
||||
<input type="checkbox" class="form-checkbox cursor-pointer" name="proxy_is_default" id="proxy_is_default" />
|
||||
</dd>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-5 flex justify-end">
|
||||
<div id="errors"></div>
|
||||
|
||||
<button type="primary" class="button button-primary" id="card_button">{{ ctrans('texts.add_payment_method') }}</button>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
<button type="primary" class="button button-primary" id="card_button">{{ ctrans('texts.add_payment_method') }}</button>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('footer')
|
||||
|
||||
@if($gateway->getConfigField('testMode'))
|
||||
<script src="https://jstest.authorize.net/v1/Accept.js" charset="utf-8"></script>
|
||||
<script src="https://jstest.authorize.net/v1/Accept.js" charset="utf-8"></script>
|
||||
@else
|
||||
<script src="https://js.authorize.net/v1/Accept.js" charset="utf-8"></script>
|
||||
<script src="https://js.authorize.net/v1/Accept.js" charset="utf-8"></script>
|
||||
@endif
|
||||
|
||||
<script src="{{ asset('js/clients/payment_methods/authorize-authorize-card.js') }}"></script>
|
||||
<script src="{{ asset('js/clients/payment_methods/authorize-authorize-card.js') }}"></script>
|
||||
@endpush
|
@ -1,4 +1,4 @@
|
||||
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 flex items-center flex items-center">
|
||||
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6" style="display: flex!important; justify-content: center!important;">
|
||||
<div class="card-js" id="my-card" data-capture-name="true">
|
||||
<input class="name" id="cardholder_name" name="card-holders-name" placeholder="{{ ctrans('texts.name')}}">
|
||||
<input class="card-number my-custom-class" id="card_number" name="card-number">
|
||||
|
Loading…
Reference in New Issue
Block a user