1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Merge pull request #3815 from turbo124/v2

Fixes for CORS
This commit is contained in:
David Bomba 2020-06-18 20:53:34 +10:00 committed by GitHub
commit 5e0fb4c774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 191624 additions and 41 deletions

View File

@ -29,6 +29,8 @@ class Kernel extends HttpKernel
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\TrustProxies::class,
\App\Http\Middleware\Cors::class,
];
/**
@ -53,7 +55,7 @@ class Kernel extends HttpKernel
'bindings',
'query_logging',
\App\Http\Middleware\StartupCheck::class,
\App\Http\Middleware\Cors::class,
# \App\Http\Middleware\Cors::class,
],
'contact' => [
'throttle:60,1',

View File

@ -50,14 +50,14 @@ class CreateCompanyPaymentTerms
{
$paymentTerms = [
['num_days' => 0, 'name' => 'Net 0', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
['num_days' => 7, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
['num_days' => 10, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
['num_days' => 14, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
['num_days' => 15, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
['num_days' => 30, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
['num_days' => 60, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
['num_days' => 90, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id],
['num_days' => 0, 'name' => 'Net 0', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
['num_days' => 7, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
['num_days' => 10, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
['num_days' => 14, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
['num_days' => 15, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
['num_days' => 30, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
['num_days' => 60, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
['num_days' => 90, 'name' => '', 'company_id' => $this->company->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now()],
];
PaymentTerm::insert($paymentTerms);

20
composer.lock generated
View File

@ -1086,20 +1086,6 @@
"sqlserver",
"sqlsrv"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal",
"type": "tidelift"
}
],
"time": "2020-04-20T17:19:26+00:00"
},
{
@ -5880,12 +5866,6 @@
"screenshot",
"webpage"
],
"funding": [
{
"url": "https://www.patreon.com/spatie",
"type": "patreon"
}
],
"time": "2020-04-20T10:33:41+00:00"
},
{

186778
public/css/app.css vendored

File diff suppressed because one or more lines are too long

3311
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1 +1,249 @@
!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.handleAuthorization()})),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()}});
/******/ (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");
/***/ })
/******/ });

View File

@ -1,2 +1,243 @@
/*! 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()}});
/******/ (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");
/***/ })
/******/ });

File diff suppressed because one or more lines are too long

View File

@ -1,20 +1,20 @@
{
"/js/app.js": "/js/app.js?id=baf7fef12d5e65c3d9ff",
"/css/app.css": "/css/app.css?id=71354b23d8e01ffccfe0",
"/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=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=1db80c8670affed9909b",
"/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=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/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=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=ba1182244cda0e0ffbeb",
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=fbf3650f8238a7a878e9",
"/js/setup/setup.js": "/js/setup/setup.js?id=87653cfb4084aadea7a2",
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ad"
}