From c558e0df45a659c99ced7337c9dde029a996fc0c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 9 Jun 2020 22:54:22 +1000 Subject: [PATCH] authorize.net --- .../ClientPortal/PaymentMethodController.php | 23 +- app/PaymentDrivers/AuthorizePaymentDriver.php | 3 +- app/PaymentDrivers/BaseDriver.php | 2 +- public/css/app.css | 420 ------------------ .../js/clients/invoices/action-selectors.js | 27 +- .../authorize-authorize-card.js | 29 +- public/js/clients/quotes/action-selectors.js | 27 +- public/mix-manifest.json | 8 +- .../authorize-authorize-card.js | 20 +- .../authorize/add_credit_card.blade.php | 2 +- 10 files changed, 88 insertions(+), 473 deletions(-) diff --git a/app/Http/Controllers/ClientPortal/PaymentMethodController.php b/app/Http/Controllers/ClientPortal/PaymentMethodController.php index 892b40f11fc2..beccffe5c32f 100644 --- a/app/Http/Controllers/ClientPortal/PaymentMethodController.php +++ b/app/Http/Controllers/ClientPortal/PaymentMethodController.php @@ -15,6 +15,7 @@ use App\Events\Payment\Methods\MethodDeleted; use App\Http\Controllers\Controller; use App\Http\Requests\ClientPortal\CreatePaymentMethodRequest; use App\Models\ClientGatewayToken; +use App\PaymentDrivers\AuthorizePaymentDriver; use App\Utils\Traits\MakesDates; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; @@ -42,16 +43,20 @@ class PaymentMethodController extends Controller { $gateway = auth()->user()->client->getCreditCardGateway(); - $data = [ - 'gateway' => $gateway, - 'gateway_type_id' => 1, - 'token' => false, - ]; + $auth = new AuthorizePaymentDriver($gateway, auth()->user()->client); + + return $auth->authorizeView(); - return $gateway - ->driver(auth()->user()->client) - ->setPaymentMethod('App\\PaymentDrivers\\Stripe\\CreditCard') - ->authorizeView($data); + // $data = [ + // 'gateway' => $gateway, + // 'gateway_type_id' => 1, + // 'token' => false, + // ]; + + // return $gateway + // ->driver(auth()->user()->client) + // ->setPaymentMethod('App\\PaymentDrivers\\Stripe\\CreditCard') + // ->authorizeView($data); } /** diff --git a/app/PaymentDrivers/AuthorizePaymentDriver.php b/app/PaymentDrivers/AuthorizePaymentDriver.php index fa434e85b6ae..65ea829c2e32 100644 --- a/app/PaymentDrivers/AuthorizePaymentDriver.php +++ b/app/PaymentDrivers/AuthorizePaymentDriver.php @@ -65,8 +65,9 @@ class AuthorizePaymentDriver extends BaseDriver public function authorizeView() { - $data['gateway'] = $this->gateway; + $data['gateway'] = $this->company_gateway; $data['public_client_id'] = $this->init()->getPublicClientKey(); + $data['api_login_id'] = $this->company_gateway->getConfigField('apiLoginId'); return render('gateways.authorize.add_credit_card', $data); } diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index 27c71289823d..f6891d8da1d3 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -24,7 +24,7 @@ use Omnipay\Omnipay; * @package App\PaymentDrivers * */ -class BaseDriver implements AbstractPaymentDriver +class BaseDriver extends AbstractPaymentDriver { use SystemLogTrait; use MakesHash; diff --git a/public/css/app.css b/public/css/app.css index a54ac43147b9..240189d35193 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -27766,90 +27766,6 @@ video { box-shadow: 0 0 0 3px rgba(180, 198, 252, 0.45); } -.group:focus .group-focus\:shadow-xs { - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); -} - -.group:focus .group-focus\:shadow-sm { - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); -} - -.group:focus .group-focus\:shadow { - box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); -} - -.group:focus .group-focus\:shadow-md { - box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); -} - -.group:focus .group-focus\:shadow-lg { - box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); -} - -.group:focus .group-focus\:shadow-xl { - box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); -} - -.group:focus .group-focus\:shadow-2xl { - box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); -} - -.group:focus .group-focus\:shadow-inner { - box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); -} - -.group:focus .group-focus\:shadow-outline { - box-shadow: 0 0 0 3px rgba(118, 169, 250, 0.45); -} - -.group:focus .group-focus\:shadow-none { - box-shadow: none; -} - -.group:focus .group-focus\:shadow-solid { - box-shadow: 0 0 0 2px currentColor; -} - -.group:focus .group-focus\:shadow-outline-gray { - box-shadow: 0 0 0 3px rgba(159, 166, 178, 0.45); -} - -.group:focus .group-focus\:shadow-outline-blue { - box-shadow: 0 0 0 3px rgba(164, 202, 254, 0.45); -} - -.group:focus .group-focus\:shadow-outline-teal { - box-shadow: 0 0 0 3px rgba(126, 220, 226, 0.45); -} - -.group:focus .group-focus\:shadow-outline-green { - box-shadow: 0 0 0 3px rgba(132, 225, 188, 0.45); -} - -.group:focus .group-focus\:shadow-outline-yellow { - box-shadow: 0 0 0 3px rgba(250, 202, 21, 0.45); -} - -.group:focus .group-focus\:shadow-outline-orange { - box-shadow: 0 0 0 3px rgba(253, 186, 140, 0.45); -} - -.group:focus .group-focus\:shadow-outline-red { - box-shadow: 0 0 0 3px rgba(248, 180, 180, 0.45); -} - -.group:focus .group-focus\:shadow-outline-pink { - box-shadow: 0 0 0 3px rgba(248, 180, 217, 0.45); -} - -.group:focus .group-focus\:shadow-outline-purple { - box-shadow: 0 0 0 3px rgba(202, 191, 253, 0.45); -} - -.group:focus .group-focus\:shadow-outline-indigo { - box-shadow: 0 0 0 3px rgba(180, 198, 252, 0.45); -} - .hover\:shadow-xs:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); } @@ -64937,90 +64853,6 @@ video { box-shadow: 0 0 0 3px rgba(180, 198, 252, 0.45); } - .group:focus .sm\:group-focus\:shadow-xs { - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); - } - - .group:focus .sm\:group-focus\:shadow-sm { - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); - } - - .group:focus .sm\:group-focus\:shadow { - box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); - } - - .group:focus .sm\:group-focus\:shadow-md { - box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); - } - - .group:focus .sm\:group-focus\:shadow-lg { - box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); - } - - .group:focus .sm\:group-focus\:shadow-xl { - box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); - } - - .group:focus .sm\:group-focus\:shadow-2xl { - box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); - } - - .group:focus .sm\:group-focus\:shadow-inner { - box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); - } - - .group:focus .sm\:group-focus\:shadow-outline { - box-shadow: 0 0 0 3px rgba(118, 169, 250, 0.45); - } - - .group:focus .sm\:group-focus\:shadow-none { - box-shadow: none; - } - - .group:focus .sm\:group-focus\:shadow-solid { - box-shadow: 0 0 0 2px currentColor; - } - - .group:focus .sm\:group-focus\:shadow-outline-gray { - box-shadow: 0 0 0 3px rgba(159, 166, 178, 0.45); - } - - .group:focus .sm\:group-focus\:shadow-outline-blue { - box-shadow: 0 0 0 3px rgba(164, 202, 254, 0.45); - } - - .group:focus .sm\:group-focus\:shadow-outline-teal { - box-shadow: 0 0 0 3px rgba(126, 220, 226, 0.45); - } - - .group:focus .sm\:group-focus\:shadow-outline-green { - box-shadow: 0 0 0 3px rgba(132, 225, 188, 0.45); - } - - .group:focus .sm\:group-focus\:shadow-outline-yellow { - box-shadow: 0 0 0 3px rgba(250, 202, 21, 0.45); - } - - .group:focus .sm\:group-focus\:shadow-outline-orange { - box-shadow: 0 0 0 3px rgba(253, 186, 140, 0.45); - } - - .group:focus .sm\:group-focus\:shadow-outline-red { - box-shadow: 0 0 0 3px rgba(248, 180, 180, 0.45); - } - - .group:focus .sm\:group-focus\:shadow-outline-pink { - box-shadow: 0 0 0 3px rgba(248, 180, 217, 0.45); - } - - .group:focus .sm\:group-focus\:shadow-outline-purple { - box-shadow: 0 0 0 3px rgba(202, 191, 253, 0.45); - } - - .group:focus .sm\:group-focus\:shadow-outline-indigo { - box-shadow: 0 0 0 3px rgba(180, 198, 252, 0.45); - } - .sm\:hover\:shadow-xs:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); } @@ -102109,90 +101941,6 @@ video { box-shadow: 0 0 0 3px rgba(180, 198, 252, 0.45); } - .group:focus .md\:group-focus\:shadow-xs { - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); - } - - .group:focus .md\:group-focus\:shadow-sm { - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); - } - - .group:focus .md\:group-focus\:shadow { - box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); - } - - .group:focus .md\:group-focus\:shadow-md { - box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); - } - - .group:focus .md\:group-focus\:shadow-lg { - box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); - } - - .group:focus .md\:group-focus\:shadow-xl { - box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); - } - - .group:focus .md\:group-focus\:shadow-2xl { - box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); - } - - .group:focus .md\:group-focus\:shadow-inner { - box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); - } - - .group:focus .md\:group-focus\:shadow-outline { - box-shadow: 0 0 0 3px rgba(118, 169, 250, 0.45); - } - - .group:focus .md\:group-focus\:shadow-none { - box-shadow: none; - } - - .group:focus .md\:group-focus\:shadow-solid { - box-shadow: 0 0 0 2px currentColor; - } - - .group:focus .md\:group-focus\:shadow-outline-gray { - box-shadow: 0 0 0 3px rgba(159, 166, 178, 0.45); - } - - .group:focus .md\:group-focus\:shadow-outline-blue { - box-shadow: 0 0 0 3px rgba(164, 202, 254, 0.45); - } - - .group:focus .md\:group-focus\:shadow-outline-teal { - box-shadow: 0 0 0 3px rgba(126, 220, 226, 0.45); - } - - .group:focus .md\:group-focus\:shadow-outline-green { - box-shadow: 0 0 0 3px rgba(132, 225, 188, 0.45); - } - - .group:focus .md\:group-focus\:shadow-outline-yellow { - box-shadow: 0 0 0 3px rgba(250, 202, 21, 0.45); - } - - .group:focus .md\:group-focus\:shadow-outline-orange { - box-shadow: 0 0 0 3px rgba(253, 186, 140, 0.45); - } - - .group:focus .md\:group-focus\:shadow-outline-red { - box-shadow: 0 0 0 3px rgba(248, 180, 180, 0.45); - } - - .group:focus .md\:group-focus\:shadow-outline-pink { - box-shadow: 0 0 0 3px rgba(248, 180, 217, 0.45); - } - - .group:focus .md\:group-focus\:shadow-outline-purple { - box-shadow: 0 0 0 3px rgba(202, 191, 253, 0.45); - } - - .group:focus .md\:group-focus\:shadow-outline-indigo { - box-shadow: 0 0 0 3px rgba(180, 198, 252, 0.45); - } - .md\:hover\:shadow-xs:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); } @@ -139281,90 +139029,6 @@ video { box-shadow: 0 0 0 3px rgba(180, 198, 252, 0.45); } - .group:focus .lg\:group-focus\:shadow-xs { - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); - } - - .group:focus .lg\:group-focus\:shadow-sm { - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); - } - - .group:focus .lg\:group-focus\:shadow { - box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); - } - - .group:focus .lg\:group-focus\:shadow-md { - box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); - } - - .group:focus .lg\:group-focus\:shadow-lg { - box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); - } - - .group:focus .lg\:group-focus\:shadow-xl { - box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); - } - - .group:focus .lg\:group-focus\:shadow-2xl { - box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); - } - - .group:focus .lg\:group-focus\:shadow-inner { - box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); - } - - .group:focus .lg\:group-focus\:shadow-outline { - box-shadow: 0 0 0 3px rgba(118, 169, 250, 0.45); - } - - .group:focus .lg\:group-focus\:shadow-none { - box-shadow: none; - } - - .group:focus .lg\:group-focus\:shadow-solid { - box-shadow: 0 0 0 2px currentColor; - } - - .group:focus .lg\:group-focus\:shadow-outline-gray { - box-shadow: 0 0 0 3px rgba(159, 166, 178, 0.45); - } - - .group:focus .lg\:group-focus\:shadow-outline-blue { - box-shadow: 0 0 0 3px rgba(164, 202, 254, 0.45); - } - - .group:focus .lg\:group-focus\:shadow-outline-teal { - box-shadow: 0 0 0 3px rgba(126, 220, 226, 0.45); - } - - .group:focus .lg\:group-focus\:shadow-outline-green { - box-shadow: 0 0 0 3px rgba(132, 225, 188, 0.45); - } - - .group:focus .lg\:group-focus\:shadow-outline-yellow { - box-shadow: 0 0 0 3px rgba(250, 202, 21, 0.45); - } - - .group:focus .lg\:group-focus\:shadow-outline-orange { - box-shadow: 0 0 0 3px rgba(253, 186, 140, 0.45); - } - - .group:focus .lg\:group-focus\:shadow-outline-red { - box-shadow: 0 0 0 3px rgba(248, 180, 180, 0.45); - } - - .group:focus .lg\:group-focus\:shadow-outline-pink { - box-shadow: 0 0 0 3px rgba(248, 180, 217, 0.45); - } - - .group:focus .lg\:group-focus\:shadow-outline-purple { - box-shadow: 0 0 0 3px rgba(202, 191, 253, 0.45); - } - - .group:focus .lg\:group-focus\:shadow-outline-indigo { - box-shadow: 0 0 0 3px rgba(180, 198, 252, 0.45); - } - .lg\:hover\:shadow-xs:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); } @@ -176453,90 +176117,6 @@ video { box-shadow: 0 0 0 3px rgba(180, 198, 252, 0.45); } - .group:focus .xl\:group-focus\:shadow-xs { - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); - } - - .group:focus .xl\:group-focus\:shadow-sm { - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); - } - - .group:focus .xl\:group-focus\:shadow { - box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); - } - - .group:focus .xl\:group-focus\:shadow-md { - box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); - } - - .group:focus .xl\:group-focus\:shadow-lg { - box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); - } - - .group:focus .xl\:group-focus\:shadow-xl { - box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); - } - - .group:focus .xl\:group-focus\:shadow-2xl { - box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); - } - - .group:focus .xl\:group-focus\:shadow-inner { - box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); - } - - .group:focus .xl\:group-focus\:shadow-outline { - box-shadow: 0 0 0 3px rgba(118, 169, 250, 0.45); - } - - .group:focus .xl\:group-focus\:shadow-none { - box-shadow: none; - } - - .group:focus .xl\:group-focus\:shadow-solid { - box-shadow: 0 0 0 2px currentColor; - } - - .group:focus .xl\:group-focus\:shadow-outline-gray { - box-shadow: 0 0 0 3px rgba(159, 166, 178, 0.45); - } - - .group:focus .xl\:group-focus\:shadow-outline-blue { - box-shadow: 0 0 0 3px rgba(164, 202, 254, 0.45); - } - - .group:focus .xl\:group-focus\:shadow-outline-teal { - box-shadow: 0 0 0 3px rgba(126, 220, 226, 0.45); - } - - .group:focus .xl\:group-focus\:shadow-outline-green { - box-shadow: 0 0 0 3px rgba(132, 225, 188, 0.45); - } - - .group:focus .xl\:group-focus\:shadow-outline-yellow { - box-shadow: 0 0 0 3px rgba(250, 202, 21, 0.45); - } - - .group:focus .xl\:group-focus\:shadow-outline-orange { - box-shadow: 0 0 0 3px rgba(253, 186, 140, 0.45); - } - - .group:focus .xl\:group-focus\:shadow-outline-red { - box-shadow: 0 0 0 3px rgba(248, 180, 180, 0.45); - } - - .group:focus .xl\:group-focus\:shadow-outline-pink { - box-shadow: 0 0 0 3px rgba(248, 180, 217, 0.45); - } - - .group:focus .xl\:group-focus\:shadow-outline-purple { - box-shadow: 0 0 0 3px rgba(202, 191, 253, 0.45); - } - - .group:focus .xl\:group-focus\:shadow-outline-indigo { - box-shadow: 0 0 0 3px rgba(180, 198, 252, 0.45); - } - .xl\:hover\:shadow-xs:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); } diff --git a/public/js/clients/invoices/action-selectors.js b/public/js/clients/invoices/action-selectors.js index faac8c0c92f4..f905abb37247 100644 --- a/public/js/clients/invoices/action-selectors.js +++ b/public/js/clients/invoices/action-selectors.js @@ -93,12 +93,6 @@ /*! no static exports found */ /***/ (function(module, exports) { -function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } @@ -170,9 +164,9 @@ var ActionSelectors = /*#__PURE__*/function () { this.parentElement.addEventListener("click", function () { _this2.watchCheckboxes(_this2.parentElement); }); - - var _iterator = _createForOfIteratorHelper(document.querySelectorAll(".form-check-child")), - _step; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; try { var _loop = function _loop() { @@ -182,13 +176,22 @@ var ActionSelectors = /*#__PURE__*/function () { }); }; - for (_iterator.s(); !(_step = _iterator.n()).done;) { + for (var _iterator = document.querySelectorAll(".form-check-child")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { _loop(); } } catch (err) { - _iterator.e(err); + _didIteratorError = true; + _iteratorError = err; } finally { - _iterator.f(); + try { + if (!_iteratorNormalCompletion && _iterator["return"] != null) { + _iterator["return"](); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } } } }]); diff --git a/public/js/clients/payment_methods/authorize-authorize-card.js b/public/js/clients/payment_methods/authorize-authorize-card.js index 05671cc41f99..83c12f820dca 100644 --- a/public/js/clients/payment_methods/authorize-authorize-card.js +++ b/public/js/clients/payment_methods/authorize-authorize-card.js @@ -109,10 +109,11 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d * @license https://opensource.org/licenses/AAL */ var AuthorizeAuthorizeCard = /*#__PURE__*/function () { - function AuthorizeAuthorizeCard(key) { + function AuthorizeAuthorizeCard(publicKey, loginId) { _classCallCheck(this, AuthorizeAuthorizeCard); - this.key = key; + this.publicKey = publicKey; + this.loginId = loginId; this.cardHolderName = document.getElementById("cardholder_name"); this.cardButton = document.getElementById("card_button"); } @@ -121,8 +122,8 @@ var AuthorizeAuthorizeCard = /*#__PURE__*/function () { key: "handleAuthorization", value: function handleAuthorization() { var authData = {}; - authData.clientKey = this.key; - authData.apiLoginID = "YOUR API LOGIN ID"; + authData.clientKey = this.publicKey; + authData.apiLoginID = this.loginId; var cardData = {}; cardData.cardNumber = document.getElementById("card_number").value; cardData.month = document.getElementById("expiration_month").value; @@ -135,11 +136,14 @@ var AuthorizeAuthorizeCard = /*#__PURE__*/function () { // // secureData.bankData = bankData; - Accept.dispatchData(secureData, responseHandler); + Accept.dispatchData(secureData, this.responseHandler); + return false; } }, { key: "responseHandler", value: function responseHandler(response) { + console.log("responseHandler"); + if (response.messages.resultCode === "Error") { var i = 0; @@ -147,13 +151,21 @@ var AuthorizeAuthorizeCard = /*#__PURE__*/function () { console.log(response.messages.message[i].code + ": " + response.messages.message[i].text); i = i + 1; } - } else { - paymentFormUpdate(response.opaqueData); + } else if (response.messages.resultCode === "Ok") { + console.log("else"); // return this.paymentFormUpdate(response.opaqueData); + // + + document.getElementById("dataDescriptor").value = opaqueData.dataDescriptor; + document.getElementById("dataValue").value = opaqueData.dataValue; + document.getElementById("server_response").submit(); } + + return false; } }, { key: "paymentFormUpdate", value: function paymentFormUpdate(opaqueData) { + console.log("payment form update"); document.getElementById("dataDescriptor").value = opaqueData.dataDescriptor; document.getElementById("dataValue").value = opaqueData.dataValue; document.getElementById("server_response").submit(); @@ -174,9 +186,10 @@ var AuthorizeAuthorizeCard = /*#__PURE__*/function () { }(); var publicKey = document.querySelector('meta[name="authorize-public-key"]').content; +var loginId = document.querySelector('meta[name="authorize-login-id"]').content; /** @handle */ -new AuthorizeAuthorizeCard(publicKey).handle(); +new AuthorizeAuthorizeCard(publicKey, loginId).handle(); /***/ }), diff --git a/public/js/clients/quotes/action-selectors.js b/public/js/clients/quotes/action-selectors.js index 0591dc23b932..290e055fda95 100644 --- a/public/js/clients/quotes/action-selectors.js +++ b/public/js/clients/quotes/action-selectors.js @@ -93,12 +93,6 @@ /*! no static exports found */ /***/ (function(module, exports) { -function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } @@ -170,9 +164,9 @@ var ActionSelectors = /*#__PURE__*/function () { this.parentElement.addEventListener("click", function () { _this2.watchCheckboxes(_this2.parentElement); }); - - var _iterator = _createForOfIteratorHelper(document.querySelectorAll(".form-check-child")), - _step; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; try { var _loop = function _loop() { @@ -182,13 +176,22 @@ var ActionSelectors = /*#__PURE__*/function () { }); }; - for (_iterator.s(); !(_step = _iterator.n()).done;) { + for (var _iterator = document.querySelectorAll(".form-check-child")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { _loop(); } } catch (err) { - _iterator.e(err); + _didIteratorError = true; + _iteratorError = err; } finally { - _iterator.f(); + try { + if (!_iteratorNormalCompletion && _iterator["return"] != null) { + _iterator["return"](); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } } } }]); diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 79ae89aa3466..0aef4cd4c951 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,12 +1,12 @@ { "/js/app.js": "/js/app.js?id=f2e8918e01f1279fc8e1", - "/css/app.css": "/css/app.css?id=0c121bd8add5c55b5736", - "/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=6f135aee6afea4af6f0c", + "/css/app.css": "/css/app.css?id=b4f28bc71925ec9b1f74", + "/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=c67520bd431448c04e4d", "/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=03cd8e076e822e0a2ecc", - "/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=721a9b832849c20004a1", + "/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=1bb0d7320d7620a48ade", "/js/clients/payment_methods/authorize-stripe-card.js": "/js/clients/payment_methods/authorize-stripe-card.js?id=420e22ba244289dd75f8", "/js/clients/payments/process.js": "/js/clients/payments/process.js?id=16971f5d097fd5891500", - "/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=bc2947291aa9014f2854", + "/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=6c09099ad5510550993d", "/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=a6055367026d6299d8da", "/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=fdc8697ff6d3d6e3f068", "/js/setup/setup.js": "/js/setup/setup.js?id=c761366ca0acdd72cb95" diff --git a/resources/js/clients/payment_methods/authorize-authorize-card.js b/resources/js/clients/payment_methods/authorize-authorize-card.js index 7b9a0810e90f..aa01f9578322 100644 --- a/resources/js/clients/payment_methods/authorize-authorize-card.js +++ b/resources/js/clients/payment_methods/authorize-authorize-card.js @@ -38,11 +38,13 @@ class AuthorizeAuthorizeCard { // // secureData.bankData = bankData; - Accept.dispatchData(secureData, responseHandler); + Accept.dispatchData(secureData, this.responseHandler); + return false; + } responseHandler(response) { - +console.log("responseHandler"); if (response.messages.resultCode === "Error") { var i = 0; while (i < response.messages.message.length) { @@ -53,16 +55,24 @@ class AuthorizeAuthorizeCard { i = i + 1; } } - else { - paymentFormUpdate(response.opaqueData); + else if(response.messages.resultCode === "Ok"){ + console.log("else"); + // return this.paymentFormUpdate(response.opaqueData); + // + document.getElementById("dataDescriptor").value = opaqueData.dataDescriptor; + document.getElementById("dataValue").value = opaqueData.dataValue; + document.getElementById("server_response").submit(); } + return false; } paymentFormUpdate(opaqueData) { + console.log("payment form update"); document.getElementById("dataDescriptor").value = opaqueData.dataDescriptor; document.getElementById("dataValue").value = opaqueData.dataValue; document.getElementById("server_response").submit(); + } handle() { @@ -80,7 +90,7 @@ const publicKey = document.querySelector( ).content; const loginId = document.querySelector( - 'meta[name="api_login_id"]' + 'meta[name="authorize-login-id"]' ).content; /** @handle */ diff --git a/resources/views/portal/ninja2020/gateways/authorize/add_credit_card.blade.php b/resources/views/portal/ninja2020/gateways/authorize/add_credit_card.blade.php index af22be42736c..804b3b68528d 100644 --- a/resources/views/portal/ninja2020/gateways/authorize/add_credit_card.blade.php +++ b/resources/views/portal/ninja2020/gateways/authorize/add_credit_card.blade.php @@ -93,7 +93,7 @@ @push('footer') - @if($this->gateway->getConfigField('testMode')) + @if($gateway->getConfigField('testMode')) @else