diff --git a/cartridges/app_adyen_SFRA/.project b/cartridges/app_adyen_SFRA/.project index e15f5633f..0729c058a 100644 --- a/cartridges/app_adyen_SFRA/.project +++ b/cartridges/app_adyen_SFRA/.project @@ -1,7 +1,7 @@ app_adyen_SFRA - v24.3.0 + v24.3.1 diff --git a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js index be090cef1..2d2b8d09e 100644 --- a/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js +++ b/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js @@ -89,7 +89,10 @@ function displaySelectedMethod(type) { store.brand = (_document$querySelect2 = document.querySelector("#component_".concat(type, " .brand"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value; } function displayValidationErrors() { - store.selectedPayment.node.showValidation(); + var _store$selectedMethod; + if ((_store$selectedMethod = store.selectedMethod) !== null && _store$selectedMethod !== void 0 && _store$selectedMethod.node) { + store.selectedPayment.node.showValidation(); + } return false; } var selectedMethods = {}; diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenAccount.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenAccount.js index bfb56edc6..0120352c9 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenAccount.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenAccount.js @@ -130,7 +130,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n if (!this.componentsObj[method]) {\n this.componentsObj[method] = {};\n }\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenCheckout.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenCheckout.js index e1c923464..52d5c1860 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenCheckout.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/adyenCheckout.js @@ -118,7 +118,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n var _store$selectedMethod;\n if ((_store$selectedMethod = store.selectedMethod) !== null && _store$selectedMethod !== void 0 && _store$selectedMethod.node) {\n store.selectedPayment.node.showValidation();\n }\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -226,7 +226,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n if (!this.componentsObj[method]) {\n this.componentsObj[method] = {};\n }\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayCheckout.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayCheckout.js index 810367bbc..5f682ff09 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayCheckout.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayCheckout.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n var _store$selectedMethod;\n if ((_store$selectedMethod = store.selectedMethod) !== null && _store$selectedMethod !== void 0 && _store$selectedMethod.node) {\n store.selectedPayment.node.showValidation();\n }\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -130,7 +130,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n if (!this.componentsObj[method]) {\n this.componentsObj[method] = {};\n }\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart1.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart1.js index 4d7b86646..93dc38b5e 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart1.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart1.js @@ -130,7 +130,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n if (!this.componentsObj[method]) {\n this.componentsObj[method] = {};\n }\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart2.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart2.js index a754825df..713513e41 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart2.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/amazonPayExpressPart2.js @@ -130,7 +130,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n if (!this.componentsObj[method]) {\n this.componentsObj[method] = {};\n }\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/applePayExpress.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/applePayExpress.js index c53470ea7..c6a062386 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/applePayExpress.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/applePayExpress.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n var _store$selectedMethod;\n if ((_store$selectedMethod = store.selectedMethod) !== null && _store$selectedMethod !== void 0 && _store$selectedMethod.node) {\n store.selectedPayment.node.showValidation();\n }\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -142,7 +142,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n if (!this.componentsObj[method]) {\n this.componentsObj[method] = {};\n }\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/checkout.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/checkout.js index 9c4854904..31ce3a879 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/checkout.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/checkout.js @@ -262,7 +262,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n var _store$selectedMethod;\n if ((_store$selectedMethod = store.selectedMethod) !== null && _store$selectedMethod !== void 0 && _store$selectedMethod.node) {\n store.selectedPayment.node.showValidation();\n }\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -418,7 +418,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n if (!this.componentsObj[method]) {\n this.componentsObj[method] = {};\n }\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/checkoutReviewButtons.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/checkoutReviewButtons.js index afa949a04..5da79b6ec 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/checkoutReviewButtons.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/checkoutReviewButtons.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n var _store$selectedMethod;\n if ((_store$selectedMethod = store.selectedMethod) !== null && _store$selectedMethod !== void 0 && _store$selectedMethod.node) {\n store.selectedPayment.node.showValidation();\n }\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -130,7 +130,7 @@ eval("\n\n// Adyen constants\n\nmodule.exports = {\n METHOD_ADYEN: 'Adyen',\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n if (!this.componentsObj[method]) {\n this.componentsObj[method] = {};\n }\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/expressPaymentMethodsVisibility.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/expressPaymentMethodsVisibility.js index 060b98b30..27f4175a5 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/expressPaymentMethodsVisibility.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/expressPaymentMethodsVisibility.js @@ -130,7 +130,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n if (!this.componentsObj[method]) {\n this.componentsObj[method] = {};\n }\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/static/default/js/paypalExpress.js b/cartridges/app_adyen_SFRA/cartridge/static/default/js/paypalExpress.js index c3b28e11b..fce37e142 100644 --- a/cartridges/app_adyen_SFRA/cartridge/static/default/js/paypalExpress.js +++ b/cartridges/app_adyen_SFRA/cartridge/static/default/js/paypalExpress.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n store.selectedPayment.node.showValidation();\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar store = __webpack_require__(/*! ../../../../store */ \"./cartridges/app_adyen_SFRA/cartridge/store/index.js\");\nvar constants = __webpack_require__(/*! ../constants */ \"./cartridges/app_adyen_SFRA/cartridge/client/default/js/constants.js\");\nfunction assignPaymentMethodValue() {\n var adyenPaymentMethod = document.querySelector('#adyenPaymentMethodName');\n // if currently selected paymentMethod contains a brand it will be part of the label ID\n var paymentMethodlabelId = \"#lb_\".concat(store.selectedMethod);\n if (adyenPaymentMethod) {\n var _document$querySelect;\n adyenPaymentMethod.value = store.brand ? store.brand : (_document$querySelect = document.querySelector(paymentMethodlabelId)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.innerHTML;\n }\n}\nfunction setOrderFormData(response) {\n if (response.orderNo) {\n document.querySelector('#merchantReference').value = response.orderNo;\n }\n if (response.orderToken) {\n document.querySelector('#orderToken').value = response.orderToken;\n }\n}\n\n/**\n * Makes an ajax call to the controller function PaymentFromComponent.\n * Used by certain payment methods like paypal\n */\nfunction paymentFromComponent(data) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var requestData = store.partialPaymentsOrderObj ? _objectSpread(_objectSpread({}, data), {}, {\n partialPaymentsOrder: store.partialPaymentsOrderObj\n }) : data;\n $.ajax({\n url: window.paymentFromComponentURL,\n type: 'post',\n data: {\n data: JSON.stringify(requestData),\n paymentMethod: document.querySelector('#adyenPaymentMethodName').value\n },\n success: function success(response) {\n var _response$fullRespons;\n setOrderFormData(response);\n if ((_response$fullRespons = response.fullResponse) !== null && _response$fullRespons !== void 0 && _response$fullRespons.action) {\n component.handleAction(response.fullResponse.action);\n } else if (response.skipSummaryPage) {\n document.querySelector('#result').value = JSON.stringify(response);\n document.querySelector('#showConfirmationForm').submit();\n } else if (response.paymentError || response.error) {\n component.handleError();\n }\n }\n });\n}\nfunction resetPaymentMethod() {\n $('#requiredBrandCode').hide();\n $('#selectedIssuer').val('');\n $('#adyenIssuerName').val('');\n $('#dateOfBirth').val('');\n $('#telephoneNumber').val('');\n $('#gender').val('');\n $('#bankAccountOwnerName').val('');\n $('#bankAccountNumber').val('');\n $('#bankLocationId').val('');\n $('.additionalFields').hide();\n}\n\n/**\n * Changes the \"display\" attribute of the selected method from hidden to visible\n */\nfunction displaySelectedMethod(type) {\n var _document$querySelect2;\n // If 'type' input field is present use this as type, otherwise default to function input param\n store.selectedMethod = document.querySelector(\"#component_\".concat(type, \" .type\")) ? document.querySelector(\"#component_\".concat(type, \" .type\")).value : type;\n resetPaymentMethod();\n var disabledSubmitButtonMethods = constants.DISABLED_SUBMIT_BUTTON_METHODS;\n if (window.klarnaWidgetEnabled) {\n disabledSubmitButtonMethods.push('klarna');\n }\n document.querySelector('button[value=\"submit-payment\"]').disabled = disabledSubmitButtonMethods.findIndex(function (pm) {\n return type.includes(pm);\n }) > -1;\n document.querySelector(\"#component_\".concat(type)).setAttribute('style', 'display:block');\n // set brand for giftcards if hidden inputfield is present\n store.brand = (_document$querySelect2 = document.querySelector(\"#component_\".concat(type, \" .brand\"))) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.value;\n}\nfunction displayValidationErrors() {\n var _store$selectedMethod;\n if ((_store$selectedMethod = store.selectedMethod) !== null && _store$selectedMethod !== void 0 && _store$selectedMethod.node) {\n store.selectedPayment.node.showValidation();\n }\n return false;\n}\nvar selectedMethods = {};\nfunction doCustomValidation() {\n return store.selectedMethod in selectedMethods ? selectedMethods[store.selectedMethod]() : true;\n}\nfunction showValidation() {\n return store.selectedPaymentIsValid ? doCustomValidation() : displayValidationErrors();\n}\nfunction getInstallmentValues(maxValue) {\n var values = [];\n for (var i = 1; i <= maxValue; i += 1) {\n values.push(i);\n }\n return values;\n}\nfunction createShowConfirmationForm(action) {\n if (document.querySelector('#showConfirmationForm')) {\n return;\n }\n var template = document.createElement('template');\n var form = \"
\\n \\n \\n \\n \\n
\");\n template.innerHTML = form;\n document.querySelector('body').appendChild(template.content);\n}\nmodule.exports = {\n setOrderFormData: setOrderFormData,\n assignPaymentMethodValue: assignPaymentMethodValue,\n paymentFromComponent: paymentFromComponent,\n resetPaymentMethod: resetPaymentMethod,\n displaySelectedMethod: displaySelectedMethod,\n showValidation: showValidation,\n createShowConfirmationForm: createShowConfirmationForm,\n getInstallmentValues: getInstallmentValues\n};\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js?"); /***/ }), @@ -142,7 +142,7 @@ eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \" /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); +eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer && (Object.defineProperty(i, e, a), a = null), a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\n// eslint-disable-next-line\nvar _require = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\"),\n observable = _require.observable,\n computed = _require.computed;\nvar Store = (_class = /*#__PURE__*/function () {\n function Store() {\n _classCallCheck(this, Store);\n _defineProperty(this, \"MASKED_CC_PREFIX\", '************');\n _initializerDefineProperty(this, \"checkout\", _descriptor, this);\n _initializerDefineProperty(this, \"endDigits\", _descriptor2, this);\n _initializerDefineProperty(this, \"selectedMethod\", _descriptor3, this);\n _initializerDefineProperty(this, \"componentsObj\", _descriptor4, this);\n _initializerDefineProperty(this, \"checkoutConfiguration\", _descriptor5, this);\n _initializerDefineProperty(this, \"formErrorsExist\", _descriptor6, this);\n _initializerDefineProperty(this, \"isValid\", _descriptor7, this);\n _initializerDefineProperty(this, \"paypalTerminatedEarly\", _descriptor8, this);\n _initializerDefineProperty(this, \"componentState\", _descriptor9, this);\n _initializerDefineProperty(this, \"brand\", _descriptor10, this);\n _initializerDefineProperty(this, \"partialPaymentsOrderObj\", _descriptor11, this);\n _initializerDefineProperty(this, \"giftCardComponentListenersAdded\", _descriptor12, this);\n _initializerDefineProperty(this, \"addedGiftCards\", _descriptor13, this);\n }\n return _createClass(Store, [{\n key: \"maskedCardNumber\",\n get: function get() {\n return \"\".concat(this.MASKED_CC_PREFIX).concat(this.endDigits);\n }\n }, {\n key: \"selectedPayment\",\n get: function get() {\n return this.componentsObj[this.selectedMethod];\n }\n }, {\n key: \"selectedPaymentIsValid\",\n get: function get() {\n var _this$selectedPayment;\n return !!((_this$selectedPayment = this.selectedPayment) !== null && _this$selectedPayment !== void 0 && _this$selectedPayment.isValid);\n }\n }, {\n key: \"stateData\",\n get: function get() {\n var _this$selectedPayment2;\n return ((_this$selectedPayment2 = this.selectedPayment) === null || _this$selectedPayment2 === void 0 ? void 0 : _this$selectedPayment2.stateData) || {\n paymentMethod: _objectSpread({\n type: this.selectedMethod\n }, this.brand ? {\n brand: this.brand\n } : undefined)\n };\n }\n }, {\n key: \"updateSelectedPayment\",\n value: function updateSelectedPayment(method, key, val) {\n if (!this.componentsObj[method]) {\n this.componentsObj[method] = {};\n }\n this.componentsObj[method][key] = val;\n }\n }]);\n}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"checkout\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"endDigits\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"selectedMethod\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"componentsObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"checkoutConfiguration\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return window.Configuration || {};\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"formErrorsExist\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, \"isValid\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, \"paypalTerminatedEarly\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return false;\n }\n}), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, \"componentState\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: function initializer() {\n return {};\n }\n}), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, \"brand\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, \"partialPaymentsOrderObj\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, \"giftCardComponentListenersAdded\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, \"addedGiftCards\", [observable], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _applyDecoratedDescriptor(_class.prototype, \"maskedCardNumber\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"maskedCardNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPayment\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPayment\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"selectedPaymentIsValid\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"selectedPaymentIsValid\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"stateData\", [computed], Object.getOwnPropertyDescriptor(_class.prototype, \"stateData\"), _class.prototype)), _class);\nmodule.exports = new Store();\n\n//# sourceURL=webpack:///./cartridges/app_adyen_SFRA/cartridge/store/index.js?"); /***/ }), diff --git a/cartridges/app_adyen_SFRA/cartridge/store/index.js b/cartridges/app_adyen_SFRA/cartridge/store/index.js index 4be419096..134577634 100644 --- a/cartridges/app_adyen_SFRA/cartridge/store/index.js +++ b/cartridges/app_adyen_SFRA/cartridge/store/index.js @@ -66,6 +66,9 @@ var Store = (_class = /*#__PURE__*/function () { }, { key: "updateSelectedPayment", value: function updateSelectedPayment(method, key, val) { + if (!this.componentsObj[method]) { + this.componentsObj[method] = {}; + } this.componentsObj[method][key] = val; } }]); diff --git a/cartridges/bm_adyen/.project b/cartridges/bm_adyen/.project index f9a0ed99f..7b80ec85a 100644 --- a/cartridges/bm_adyen/.project +++ b/cartridges/bm_adyen/.project @@ -1,7 +1,7 @@ bm_adyen - v24.3.0 + v24.3.1 diff --git a/cartridges/int_adyen_SFRA/.project b/cartridges/int_adyen_SFRA/.project index f5ed18ecf..9cd71635c 100644 --- a/cartridges/int_adyen_SFRA/.project +++ b/cartridges/int_adyen_SFRA/.project @@ -1,7 +1,7 @@ int_adyen_SFRA - v24.3.0 + v24.3.1 diff --git a/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js b/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js index 7051d2c1a..6010ceef6 100644 --- a/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js +++ b/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js @@ -86,5 +86,5 @@ module.exports = { EXTERNAL_PLATFORM_VERSION: 'SFRA', APPLE_DOMAIN_URL: '/.well-known/apple-developer-merchantid-domain-association', CHECKOUT_COMPONENT_VERSION: '5.65.0', - VERSION: '24.3.0' + VERSION: '24.3.1' }; \ No newline at end of file diff --git a/cartridges/int_custom_cartridge/.project b/cartridges/int_custom_cartridge/.project index 50dba4cae..8042153bf 100644 --- a/cartridges/int_custom_cartridge/.project +++ b/cartridges/int_custom_cartridge/.project @@ -1,7 +1,7 @@ int_custom_cartridge - v24.3.0 + v24.3.1 diff --git a/package-lock.json b/package-lock.json index c45e34b4d..b55c5632d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "app_adyen_SFRA", - "version": "24.3.0", + "version": "24.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b097bfe9a..e129e00a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app_adyen_SFRA", - "version": "24.3.0", + "version": "24.3.1", "description": "Adyen's official cartridge for SFRA", "main": "index.js", "paths": { diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js index 6f803dacb..91865dbc1 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js @@ -187,8 +187,9 @@ function getGiftCardConfig() { async: false, success: (data) => { giftcardBalance = data.balance; - document.querySelector('button[value="submit-payment"]').disabled = - false; + document.querySelector( + 'button[value="submit-payment"]', + ).disabled = false; if (data.resultCode === constants.SUCCESS) { const { giftCardsInfoMessageContainer, @@ -214,8 +215,9 @@ function getGiftCardConfig() { initialPartialObject.totalDiscountedAmount; }); - document.querySelector('button[value="submit-payment"]').disabled = - true; + document.querySelector( + 'button[value="submit-payment"]', + ).disabled = true; giftCardsInfoMessageContainer.innerHTML = ''; giftCardsInfoMessageContainer.classList.remove( 'gift-cards-info-message-container', diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js index 7851666a5..cd3956990 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/helpers.js @@ -88,7 +88,9 @@ function displaySelectedMethod(type) { } function displayValidationErrors() { - store.selectedPayment.node.showValidation(); + if (store.selectedMethod?.node) { + store.selectedPayment.node.showValidation(); + } return false; } diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js index 2f4401f6c..ed41bb58e 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js @@ -96,8 +96,9 @@ function removeGiftCards() { giftCardsInfoMessageContainer.classList.remove( 'gift-cards-info-message-container', ); - document.querySelector('button[value="submit-payment"]').disabled = - false; + document.querySelector( + 'button[value="submit-payment"]', + ).disabled = false; if (res.resultCode === constants.RECEIVED) { document diff --git a/src/cartridges/app_adyen_SFRA/cartridge/store/index.js b/src/cartridges/app_adyen_SFRA/cartridge/store/index.js index 9825c6693..4bd696671 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/store/index.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/store/index.js @@ -54,6 +54,9 @@ class Store { } updateSelectedPayment(method, key, val) { + if (!this.componentsObj[method]) { + this.componentsObj[method] = {}; + } this.componentsObj[method][key] = val; } } diff --git a/src/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js b/src/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js index c0f418e29..1eeb45f28 100644 --- a/src/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js +++ b/src/cartridges/int_adyen_SFRA/cartridge/adyen/config/constants.js @@ -101,5 +101,5 @@ module.exports = { '/.well-known/apple-developer-merchantid-domain-association', CHECKOUT_COMPONENT_VERSION: '5.65.0', - VERSION: '24.3.0', + VERSION: '24.3.1', }; diff --git a/tests/playwright/fixtures/BRL.spec.mjs b/tests/playwright/fixtures/BRL.spec.mjs index 813d0efbd..5d90b9717 100644 --- a/tests/playwright/fixtures/BRL.spec.mjs +++ b/tests/playwright/fixtures/BRL.spec.mjs @@ -26,7 +26,7 @@ for (const environment of environments) { await checkoutPage.setShopperDetails(shopperData.BR); if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('Card payment 3DS2 installments success @quick', async () => { diff --git a/tests/playwright/fixtures/DKK.spec.mjs b/tests/playwright/fixtures/DKK.spec.mjs index e24b70422..984da3441 100644 --- a/tests/playwright/fixtures/DKK.spec.mjs +++ b/tests/playwright/fixtures/DKK.spec.mjs @@ -19,7 +19,7 @@ for (const environment of environments) { await checkoutPage.setShopperDetails(shopperData.DK); if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('MobilePay', async ({ page }) => { diff --git a/tests/playwright/fixtures/INR.spec.mjs b/tests/playwright/fixtures/INR.spec.mjs index b8cdb4371..c93be8e8d 100644 --- a/tests/playwright/fixtures/INR.spec.mjs +++ b/tests/playwright/fixtures/INR.spec.mjs @@ -19,7 +19,7 @@ for (const environment of environments) { await checkoutPage.setShopperDetails(shopperData.IN); if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('UPI Success', async ({ page }) => { diff --git a/tests/playwright/fixtures/JPY.spec.mjs b/tests/playwright/fixtures/JPY.spec.mjs index abd8dad8e..5bf7350ef 100644 --- a/tests/playwright/fixtures/JPY.spec.mjs +++ b/tests/playwright/fixtures/JPY.spec.mjs @@ -18,7 +18,7 @@ for (const environment of environments) { await checkoutPage.setShopperDetails(shopperData.JP); if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('konbini Success', async ({ page }) => { diff --git a/tests/playwright/fixtures/NOK.spec.mjs b/tests/playwright/fixtures/NOK.spec.mjs index 65f9c7c7a..4efa26a5b 100644 --- a/tests/playwright/fixtures/NOK.spec.mjs +++ b/tests/playwright/fixtures/NOK.spec.mjs @@ -19,7 +19,7 @@ for (const environment of environments) { await checkoutPage.setShopperDetails(shopperData.NO); if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('Vipps Success', async ({ page }) => { diff --git a/tests/playwright/fixtures/SEK.spec.mjs b/tests/playwright/fixtures/SEK.spec.mjs index 60a48c0c0..7e8cf4be6 100644 --- a/tests/playwright/fixtures/SEK.spec.mjs +++ b/tests/playwright/fixtures/SEK.spec.mjs @@ -22,7 +22,7 @@ for (const environment of environments) { await checkoutPage.setShopperDetails(shopperData.SE); if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('Swish success', async ({ page }) => { pendingPaymentsPage = new PendingPayments(page); diff --git a/tests/playwright/fixtures/USD.spec.mjs b/tests/playwright/fixtures/USD.spec.mjs index 41e3a262b..3a51a9de0 100644 --- a/tests/playwright/fixtures/USD.spec.mjs +++ b/tests/playwright/fixtures/USD.spec.mjs @@ -1,10 +1,10 @@ -import { test } from '@playwright/test'; -import { regionsEnum } from '../data/enums.mjs'; -import { environments } from '../data/environments.mjs'; -import { RedirectShopper } from '../paymentFlows/redirectShopper.mjs'; -import { Cards } from '../paymentFlows/cards.mjs'; -import { ShopperData } from '../data/shopperData.mjs'; -import { CardData } from '../data/cardData.mjs'; +import {test} from '@playwright/test'; +import {regionsEnum} from '../data/enums.mjs'; +import {environments} from '../data/environments.mjs'; +import {RedirectShopper} from '../paymentFlows/redirectShopper.mjs'; +import {Cards} from '../paymentFlows/cards.mjs'; +import {ShopperData} from '../data/shopperData.mjs'; +import {CardData} from '../data/cardData.mjs'; import PaymentMethodsPage from '../pages/PaymentMethodsPage.mjs'; const shopperData = new ShopperData(); @@ -29,7 +29,7 @@ const goToBillingWithFullCartLoggedInUser = async () => { for (const environment of environments) { test.describe.parallel(`${environment.name} USD`, () => { - test.beforeEach(async ({ page }) => { + test.beforeEach(async ({page}) => { checkoutPage = new environment.CheckoutPage(page); accountPage = new environment.AccountPage(page); cards = new Cards(page); @@ -78,7 +78,7 @@ for (const environment of environments) { await checkoutPage.expectRefusal(); }); - test('PayPal Success @quick', async ({ page }) => { + test('PayPal Success @quick', async ({page}) => { redirectShopper = new RedirectShopper(page); await redirectShopper.doPayPalPayment(false, false, true); await checkoutPage.expectSuccess(); @@ -86,65 +86,65 @@ for (const environment of environments) { }); test.describe.parallel(`${environment.name} USD`, () => { - test.beforeEach(async ({ page }) => { - checkoutPage = new environment.CheckoutPage(page); - accountPage = new environment.AccountPage(page); - cards = new Cards(page); - await page.goto(`${environment.urlExtension}`); - }); - - test('GiftCard Only Success @quick', async () => { - await goToBillingWithFullCartGuestUser(); - if (environment.name.indexOf('v5') !== -1) { - await checkoutPage.setEmail(); - }; - await cards.doGiftCardPayment(cardData.giftCard); - await checkoutPage.placeOrder(); - await checkoutPage.expectSuccess(); - }); - - test('GiftCard & Card Success @quick', async () => { - await goToBillingWithFullCartGuestUser(3); - if (environment.name.indexOf('v5') !== -1) { - await checkoutPage.setEmail(); - }; - await cards.doGiftCardPayment(cardData.giftCard); - await cards.doCardPayment(cardData.noThreeDs); - await checkoutPage.completeCheckout(); - await checkoutPage.expectSuccess(); - }); - - test('Remove Gift Card', async ({ page }) => { - await goToBillingWithFullCartGuestUser(3); - if (environment.name.indexOf('v5') !== -1) { - await checkoutPage.setEmail(); - } - await cards.doGiftCardPayment(cardData.giftCard); - await page.locator('#giftCardCancelButton').click(); - // Wait for components to re-render after cancelling the giftcard - await new Promise(r => setTimeout(r, 2000)); - - await cards.doCardPayment(cardData.noThreeDs); - await checkoutPage.completeCheckout(); - await checkoutPage.expectSuccess(); - }); - - test('Gift Card Fail', async ({ page, locale }) => { - await goToBillingWithFullCartGuestUser(3); - await cards.doGiftCardPayment(cardData.giftCard); - await page.goto(`/s/RefArch/25720033M.html?lang=${locale}`); - await page.locator('.add-to-cart').click(); - await checkoutPage.navigateToCheckout(regionsEnum.US); - if (environment.name.indexOf('v5') !== -1) { - await checkoutPage.checkoutGuest.click(); - } - await checkoutPage.submitShipping(); - await checkoutPage.expectGiftCardWarning(); - }); + test.beforeEach(async ({page}) => { + checkoutPage = new environment.CheckoutPage(page); + accountPage = new environment.AccountPage(page); + cards = new Cards(page); + await page.goto(`${environment.urlExtension}`); + }); + + test('GiftCard Only Success @quick', async () => { + await goToBillingWithFullCartGuestUser(); + if (environment.name.indexOf('v5') !== -1) { + await checkoutPage.setEmail(); + } + await cards.doGiftCardPayment(cardData.giftCard); + await checkoutPage.placeOrder(); + await checkoutPage.expectSuccess(); + }); + + test('GiftCard & Card Success @quick', async () => { + await goToBillingWithFullCartGuestUser(3); + if (environment.name.indexOf('v5') !== -1) { + await checkoutPage.setEmail(); + } + await cards.doGiftCardPayment(cardData.giftCard); + await cards.doCardPayment(cardData.noThreeDs); + await checkoutPage.completeCheckout(); + await checkoutPage.expectSuccess(); + }); + + test('Remove Gift Card', async ({page}) => { + await goToBillingWithFullCartGuestUser(3); + if (environment.name.indexOf('v5') !== -1) { + await checkoutPage.setEmail(); + } + await cards.doGiftCardPayment(cardData.giftCard); + await page.locator('#giftCardCancelButton').click(); + // Wait for components to re-render after cancelling the giftcard + await new Promise(r => setTimeout(r, 2000)); + + await cards.doCardPayment(cardData.noThreeDs); + await checkoutPage.completeCheckout(); + await checkoutPage.expectSuccess(); + }); + + test('Gift Card Fail', async ({page, locale}) => { + await goToBillingWithFullCartGuestUser(3); + await cards.doGiftCardPayment(cardData.giftCard); + await page.goto(`/s/RefArch/25720033M.html?lang=${locale}`); + await page.locator('.add-to-cart').click(); + await checkoutPage.navigateToCheckout(regionsEnum.US); + if (environment.name.indexOf('v5') !== -1) { + await checkoutPage.checkoutGuest.click(); + } + await checkoutPage.submitShipping(); + await checkoutPage.expectGiftCardWarning(); + }); }); test.describe.parallel(`${environment.name} USD`, () => { - test.beforeEach(async ({ page }) => { + test.beforeEach(async ({page}) => { checkoutPage = new environment.CheckoutPage(page); accountPage = new environment.AccountPage(page); cards = new Cards(page); @@ -153,27 +153,27 @@ for (const environment of environments) { await goToBillingWithFullCartGuestUser(5); }); - test('Affirm Fail', async ({ page }) => { + test('Affirm Fail', async ({page}) => { redirectShopper = new RedirectShopper(page); if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } await redirectShopper.doAffirmPayment(shopperData.US); await checkoutPage.completeCheckout(); await redirectShopper.completeAffirmRedirect(false); await checkoutPage.expectRefusal(); }); - test.skip('CashApp Renders', async ({ page }) => { + test.skip('CashApp Renders', async ({page}) => { if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } await new PaymentMethodsPage(page).initiateCashAppPayment(); }); }); test.describe(`${environment.name} USD Card logged in user `, () => { - test.beforeEach(async ({ page }) => { + test.beforeEach(async ({page}) => { await page.goto(`${environment.urlExtension}`); checkoutPage = new environment.CheckoutPage(page); @@ -182,7 +182,7 @@ for (const environment of environments) { await goToBillingWithFullCartLoggedInUser(); if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('3DS2 oneClick test success @quick', async () => { @@ -210,7 +210,7 @@ for (const environment of environments) { }); test.describe(`${environment.name} USD`, () => { - test.beforeEach(async ({ page }) => { + test.beforeEach(async ({page}) => { await page.goto(`${environment.urlExtension}`); checkoutPage = new environment.CheckoutPage(page); @@ -253,46 +253,44 @@ for (const environment of environments) { }); test.describe.parallel(`${environment.name} USD`, () => { - test.beforeEach(async ({ page }) => { - await page.goto(`${environment.urlExtension}`); + test.beforeEach(async ({page}) => { + await page.goto(`${environment.urlExtension}`); }); - test('PayPal Express @quick', async ({ page }) => { - checkoutPage = new environment.CheckoutPage(page); - await checkoutPage.addProductToCart(); - await checkoutPage.navigateToCart(regionsEnum.US); - redirectShopper = new RedirectShopper(page); - await redirectShopper.doPayPalPayment(true, false, true); - if (environment.name.indexOf('v5') !== -1) { - await page.locator("button[value='place-order']").click(); - await page.locator(".order-thank-you-msg").isVisible({ timeout: 20000 }); - } - else { - await checkoutPage.expectSuccess(); - } + test('PayPal Express @quick', async ({page}) => { + checkoutPage = new environment.CheckoutPage(page); + await checkoutPage.addProductToCart(); + await checkoutPage.navigateToCart(regionsEnum.US); + redirectShopper = new RedirectShopper(page); + await redirectShopper.doPayPalPayment(true, false, true); + if (environment.name.indexOf('v5') !== -1) { + await page.locator("button[value='place-order']").click(); + await page.locator(".order-thank-you-msg").isVisible({timeout: 20000}); + } else { + await checkoutPage.expectSuccess(); + } }); - test('PayPal Express shipping change @quick', async ({ page }) => { - checkoutPage = new environment.CheckoutPage(page); - await checkoutPage.addProductToCart(); - await checkoutPage.navigateToCart(regionsEnum.US); - redirectShopper = new RedirectShopper(page); - await redirectShopper.doPayPalPayment(true, true, true); - if (environment.name.indexOf('v5') !== -1) { - await page.locator("button[value='place-order']").click(); - await page.locator(".order-thank-you-msg").isVisible({ timeout: 20000 }); - } - else { - await checkoutPage.expectSuccess(); - } + test('PayPal Express shipping change @quick', async ({page}) => { + checkoutPage = new environment.CheckoutPage(page); + await checkoutPage.addProductToCart(); + await checkoutPage.navigateToCart(regionsEnum.US); + redirectShopper = new RedirectShopper(page); + await redirectShopper.doPayPalPayment(true, true, true); + if (environment.name.indexOf('v5') !== -1) { + await page.locator("button[value='place-order']").click(); + await page.locator(".order-thank-you-msg").isVisible({timeout: 20000}); + } else { + await checkoutPage.expectSuccess(); + } }); - test('PayPal Express Cancellation @quick', async ({ page }) => { - checkoutPage = new environment.CheckoutPage(page); - await checkoutPage.addProductToCart(); - await checkoutPage.navigateToCart(regionsEnum.US); - redirectShopper = new RedirectShopper(page); - await redirectShopper.doPayPalPayment(true, false, false); + test('PayPal Express Cancellation @quick', async ({page}) => { + checkoutPage = new environment.CheckoutPage(page); + await checkoutPage.addProductToCart(); + await checkoutPage.navigateToCart(regionsEnum.US); + redirectShopper = new RedirectShopper(page); + await redirectShopper.doPayPalPayment(true, false, false); }); }); } diff --git a/tests/playwright/fixtures/countriesEUR/AT.spec.mjs b/tests/playwright/fixtures/countriesEUR/AT.spec.mjs index 2527fc5ac..d46c694eb 100644 --- a/tests/playwright/fixtures/countriesEUR/AT.spec.mjs +++ b/tests/playwright/fixtures/countriesEUR/AT.spec.mjs @@ -19,7 +19,7 @@ for (const environment of environments) { // SFRA 5 email setting flow is different if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('EPS Success', async ({ page }) => { redirectShopper = new RedirectShopper(page); diff --git a/tests/playwright/fixtures/countriesEUR/BE.spec.mjs b/tests/playwright/fixtures/countriesEUR/BE.spec.mjs index f6ab2ce97..33e506df0 100644 --- a/tests/playwright/fixtures/countriesEUR/BE.spec.mjs +++ b/tests/playwright/fixtures/countriesEUR/BE.spec.mjs @@ -24,7 +24,7 @@ for (const environment of environments) { // SFRA 5 email setting flow is different if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('bcmc mobile renders @quick', async ({ page }) => { pendingPayments = new PendingPayments(page); diff --git a/tests/playwright/fixtures/countriesEUR/DE.spec.mjs b/tests/playwright/fixtures/countriesEUR/DE.spec.mjs index 1100ce836..7f932114f 100644 --- a/tests/playwright/fixtures/countriesEUR/DE.spec.mjs +++ b/tests/playwright/fixtures/countriesEUR/DE.spec.mjs @@ -21,7 +21,7 @@ for (const environment of environments) { // SFRA 5 email setting flow is different if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('Klarna Success @quick', async ({ page }) => { diff --git a/tests/playwright/fixtures/countriesEUR/FR.spec.mjs b/tests/playwright/fixtures/countriesEUR/FR.spec.mjs index ee2be5245..976c932ea 100644 --- a/tests/playwright/fixtures/countriesEUR/FR.spec.mjs +++ b/tests/playwright/fixtures/countriesEUR/FR.spec.mjs @@ -37,7 +37,7 @@ for (const environment of environments) { // SFRA 5 email setting flow is different if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } redirectShopper = new RedirectShopper(page); await redirectShopper.doOneyPayment(shopperData.FR); await checkoutPage.completeCheckout(); @@ -60,7 +60,9 @@ test.describe.parallel(`${environment.name} EUR FR`, () => { } redirectShopper = new RedirectShopper(page); const result = await redirectShopper.doAmazonPayment(); - if(result != true){test.skip()}; + if (!result) { + test.skip(); + } await checkoutPage.expectSuccess(); }); @@ -72,7 +74,9 @@ test.describe.parallel(`${environment.name} EUR FR`, () => { } redirectShopper = new RedirectShopper(page); const result = await redirectShopper.doAmazonPayment(true, true, '3ds2_card'); - if(result != true){test.skip()}; + if (!result) { + test.skip(); + } await cards.do3Ds2Verification(); await checkoutPage.expectSuccess(); }); @@ -83,7 +87,9 @@ test.describe.parallel(`${environment.name} EUR FR`, () => { await checkoutPage.navigateToCart(regionsEnum.EU); await redirectShopper.doAmazonPayment(false); const result = await redirectShopper.doAmazonExpressPayment(); - if(result != true){test.skip()}; + if (!result) { + test.skip(); + } await checkoutPage.expectSuccess(); }); @@ -95,9 +101,11 @@ test.describe.parallel(`${environment.name} EUR FR`, () => { } redirectShopper = new RedirectShopper(page); const result = await redirectShopper.doAmazonPayment(true, false); - if(result != true){test.skip()}; + if (!result) { + test.skip(); + } await checkoutPage.expectRefusal(); }); }); -} \ No newline at end of file +} diff --git a/tests/playwright/fixtures/countriesEUR/NL.spec.mjs b/tests/playwright/fixtures/countriesEUR/NL.spec.mjs index 13f07f79d..bb22aef1a 100644 --- a/tests/playwright/fixtures/countriesEUR/NL.spec.mjs +++ b/tests/playwright/fixtures/countriesEUR/NL.spec.mjs @@ -20,7 +20,7 @@ for (const environment of environments) { await checkoutPage.setShopperDetails(shopperData.NL); if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('iDeal Success @quick', async ({ page }) => { @@ -61,7 +61,7 @@ for (const environment of environments) { await checkoutPage.setShopperDetails(shopperData.NL); if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('iDeal with restored cart Fail', async ({ page, context }) => { redirectShopper = new RedirectShopper(page); diff --git a/tests/playwright/fixtures/countriesEUR/PT.spec.mjs b/tests/playwright/fixtures/countriesEUR/PT.spec.mjs index f0711cb7e..0137610e9 100644 --- a/tests/playwright/fixtures/countriesEUR/PT.spec.mjs +++ b/tests/playwright/fixtures/countriesEUR/PT.spec.mjs @@ -20,7 +20,7 @@ for (const environment of environments) { await checkoutPage.setShopperDetails(shopperData.PT); if (environment.name.indexOf('v5') !== -1) { await checkoutPage.setEmail(); - }; + } }); test('MultiBanco Success', async ({ page }) => { diff --git a/tests/playwright/pages/PaymentMethodsPage.mjs b/tests/playwright/pages/PaymentMethodsPage.mjs index cdf64f94b..f006363f8 100644 --- a/tests/playwright/pages/PaymentMethodsPage.mjs +++ b/tests/playwright/pages/PaymentMethodsPage.mjs @@ -191,7 +191,7 @@ export default class PaymentMethodsPage { submitSimulator = async (testSuccess) => { await this.page.locator('button[data-testid="payment-action-button"]').click(); - await this.page.locator('div[id="bank-item-TESTNL2A"]').click(); + await this.page.locator('button[id="bank-item-TESTNL2A"]').click(); const actionButton = testSuccess ? this.page.getByRole('button', { name: 'Success', exact: true }) : this.page.getByRole('button', { name: 'Cancellation', exact: true }); await actionButton.click(); };