diff --git a/Bootstrap.php b/Bootstrap.php index a8137e5..7cc21d3 100644 --- a/Bootstrap.php +++ b/Bootstrap.php @@ -51,7 +51,6 @@ class Bootstrap extends Bootstrapper implements BootstrapperInterface public function boot(Dispatcher $dispatcher): void { parent::boot($dispatcher); - require_once __DIR__ . '/vendor/autoload.php'; /** * Register Services diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fe31d6..0a8c68d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.8.1] (June 2025) +### Added +- added JTL 5.5 and PHP 8.4 compatability + ## [1.8.0] (February 2025) ### Added - added new Unzer Direct Bank Transfer diff --git a/adminmenu/template/partials/_order_item.tpl b/adminmenu/template/partials/_order_item.tpl index 6aa1843..c8386b7 100644 --- a/adminmenu/template/partials/_order_item.tpl +++ b/adminmenu/template/partials/_order_item.tpl @@ -5,17 +5,17 @@ {if isset($hpOrder->getOrder()->cStatus)} - {if $hpOrder->getOrder()->cStatus === "-1"} + {if $hpOrder->getOrder()->cStatus == "-1"} {__('hpStateCanceled')} - {elseif $hpOrder->getOrder()->cStatus === "1"} + {elseif $hpOrder->getOrder()->cStatus == "1"} {__('hpStateOpen')} - {elseif $hpOrder->getOrder()->cStatus === "2"} + {elseif $hpOrder->getOrder()->cStatus == "2"} {__('hpStateInProgress')} - {elseif $hpOrder->getOrder()->cStatus === "3"} + {elseif $hpOrder->getOrder()->cStatus == "3"} {__('hpStatePaid')} - {elseif $hpOrder->getOrder()->cStatus === "4"} + {elseif $hpOrder->getOrder()->cStatus == "4"} {__('hpStateShipped')} - {elseif $hpOrder->getOrder()->cStatus === "5"} + {elseif $hpOrder->getOrder()->cStatus == "5"} {__('hpStatePartlyShipped')} {else} {$hpOrder->getOrder()->cStatus} diff --git a/checksums.csv b/checksums.csv index 772ee02..5523e84 100644 --- a/checksums.csv +++ b/checksums.csv @@ -1,18 +1,18 @@ 4db0ef5803b943bc62cf9a6e0f7b40b5;Seeders/Shop4PluginMigrationSeeder.php e1b9ba833fa2eae5ce86ea735f13d3ad;.babelrc -0a341f37810d33c6345ba571e2f24485;CHANGELOG.md +0d6ba0f68cb7716a858dd8be454fabe6;CHANGELOG.md c9f6e33220cf462393c7070cffcfff1a;NOTICE bdab240d9f8ee3c00116400e934ca225;locale/de-DE/base.mo efdf0b7b90984a3a2edb35a789f88248;locale/de-DE/base.po a0445456d7fdf6274dc3f36d6c85b64d;locale/en-GB/base.mo f36b138cb92f15ae3826dd31855d53e8;locale/en-GB/base.po c466bfceae7a1c850f00a4bd2c8400db;composer.json -0c7d14f4b8923e90f70291f86ef0092e;src/Orders/OrderMappingModel.php +bcc814dcdea7b1904456777943f2b18f;src/Orders/OrderMappingModel.php 3da45aa29a08f869b95627a6e46e5f9a;src/Orders/OrderViewStruct.php c1f8da0ce57d62d455c5e259c24685d0;src/Orders/OrderMappingEntity.php 8e0682ac5c506aa7ed6bc23a06970633;src/KeyPairs/KeyPairService.php 4a6bd5f25d0487b44b664403d6b0315c;src/KeyPairs/KeyPairModel.php -9762d228da7aed20ba5f75aa3aa1fe66;src/KeyPairs/KeyPairEntity.php +02ead16397ed114e97dc4a017cf2b30e;src/KeyPairs/KeyPairEntity.php a3255fc904b7509e171553ea009c9c82;src/ApplePay/ActivateCertificateResource.php 1c8b2fa06b94c2fd1fd098791cb30b60;src/ApplePay/PrivateKeysResource.php 4ad80bac1bc3c0c244426c6dd6279a96;src/ApplePay/CertificateException.php @@ -36,14 +36,14 @@ a73ea5c19bab6939e41d81018eb6c8e4;src/Charges/ChargeHandler.php 24bea0a602bf575ea6c7d432587c4fba;src/Charges/ChargeMappingModel.php 20db0d8770933362b0b8b7fa32c18494;src/Charges/ChargeMappingEntity.php cdd8473949f46c33f6eda27bf3df5df5;src/Utils/Config.php -a55391fc76b21e41d4f183d808064bd6;src/Utils/TranslatorTrait.php +48830baed39f5710178337ad6d6f8444;src/Utils/TranslatorTrait.php ff2e8ea1952f33020fe432ab359624d6;src/Utils/JtlLinkHelper.php 8f2caa19fb7682dcb18361609d625d05;src/Utils/Compatibility.php d46480f934c97334f23fae23b7343deb;src/Utils/SessionHelper.php d5d5d79ab6d86b5a965cf17240ff601e;src/Utils/JtlLoggerTrait.php -e82f4155e818503fe1e24b9fb8d5fbc7;src/Utils/Logger.php +521e61755ca1485bfe834b40a50ac426;src/Utils/Logger.php a78e5bba0c2635642ab607fbf73b0cea;src/Foundation/EventPayload.php -1a8a935e77ddae51a25cfed6f9139bb9;src/Foundation/ServiceProvider.php +666e75baf5eddfcf0c50e83a5386bb5d;src/Foundation/ServiceProvider.php b93684508161f05d1e5ab245170921cf;src/Foundation/EventSubscriber.php a09b4b6da00f1cd498ddbac5b8c4d051;src/Foundation/Entity.php fda45f203428056c6676cf83a15b4387;src/Foundation/Seeder.php @@ -52,9 +52,9 @@ fda45f203428056c6676cf83a15b4387;src/Foundation/Seeder.php 07e542740aeb10d40b387b86ff17ca15;src/Foundation/Struct.php 8670bbececd78c3c6a8e52dd9105dc1d;src/Webhooks/PaymentEventSubscriber.php 6f67c55f48343fe977839454503b419a;src/Payments/PaymentMethodModuleFactory.php -c4990e7a6fb98a12c8914953fa146fe9;src/Payments/PaymentHandler.php +c9906b5bb77b052053d6f30197354631;src/Payments/PaymentHandler.php d78c74c0918be9b079a8cf4655446589;src/Payments/Traits/HasState.php -e4bd8a246a535ec52a7b3f14c6b8369d;src/Payments/Traits/HasCustomer.php +1dc91617834a5b508913f5266b6e509a;src/Payments/Traits/HasCustomer.php 54f0fff5386a4145ce981a2c4e24d576;src/Payments/Traits/SupportsB2B.php aa1212a34a1c3b4f1475e6b439603404;src/Payments/Traits/HasMetadata.php 5aefd466eee6fd9307f5a4226fc9a4ec;src/Payments/Traits/HasBasket.php @@ -62,7 +62,7 @@ aa1212a34a1c3b4f1475e6b439603404;src/Payments/Traits/HasMetadata.php eafbb3fd550ede774e80f963759e71ea;src/Payments/Traits/HasPayStatus.php 4358bf25129c1cb3615eb2d37fc63285;src/Payments/Traits/CancelPaymentTransaction.php 7e92f962e6b3493af18618d393feb691;src/Payments/HeidelpayApiAdapter.php -82b5f8220dd91549d98371aaed0ab134;src/Payments/HeidelpayPaymentMethod.php +f39b9c7f0a70380be58eb6873474cd22;src/Payments/HeidelpayPaymentMethod.php b40a39212fa05718f866b4326766043c;src/Payments/Interfaces/RedirectPaymentInterface.php ab1b1e5c0f257e793786fd8f49b3a9b7;src/Payments/Interfaces/NotificationInterface.php 04525b7293527904b5c527dd5aecbd9b;src/Payments/Interfaces/HandleStepReviewOrderInterface.php @@ -70,12 +70,12 @@ ab1b1e5c0f257e793786fd8f49b3a9b7;src/Payments/Interfaces/NotificationInterface.p 5a17589c176c45aedb1879dc120fcf86;src/Payments/Interfaces/CancelableInterface.php ac4adca913172393fba84fda8c388a10;src/Payments/Interfaces/PaymentStatusInterface.php d98195f0c1485f6412b599b3f1581902;src/Payments/Interfaces/HasPayButton.php -92e796942e3b2ad8e3cc475be2d0cc39;info.xml +bbc9c3875307fcc8ac77578d80d67bb9;info.xml 780b2b8990e8dba5534b2d1fa468c6f3;frontend/webhook.php -408da6438974a122f4853b7986b631b7;frontend/js/unzer.js -0c2c1c12f8530542f8ee1e8a0d429cb7;frontend/js/unzer.min.js -6cd3f625b82e162b2ee4358f6843a4ef;frontend/js/unzer.min.js.map -cecb744ed9a6b7959198eff97b76d930;frontend/js/unzer.js.map +d1cefc6592de8b40196a42fe29bf0b90;frontend/js/unzer.js +14347895d75c97975bd9fb96b1045f45;frontend/js/unzer.min.js +31b71988e4e9842199662383cd53004f;frontend/js/unzer.min.js.map +0a55c155b365f45e44a746fb9fadb0c0;frontend/js/unzer.js.map 7d33252335a08f70cdcf96bf75198070;frontend/src/scss/unzer.scss 15112aab51c1133c80096c05759e4008;frontend/src/js/utils/errors.js cf44e5fa2ae44e1a9756651963bfe755;frontend/src/js/utils/debugging.js @@ -83,7 +83,7 @@ cf44e5fa2ae44e1a9756651963bfe755;frontend/src/js/utils/debugging.js e0f7fef48cb41f84f48b8d74c4e65700;frontend/src/js/payments/applepay.js 2d7423cbab40b379c86b8e7a55c5747b;frontend/src/js/payments/googlepay.js ec006ece0868adb711ee2fd5dbbbd966;frontend/src/js/payments/applepay_v2.js -32d90d846d14068cc4ea89b75d903a03;frontend/src/js/payments/general.js +af6ab64577fa45987da4b50631d1f8e6;frontend/src/js/payments/general.js c0d6fea5b6f79b94d5f15234cec4e856;frontend/src/js/payments/instalment.js 58f523f49a1d7f9eafaac13f17f847c5;frontend/src/js/app.js 69e55611331387e2c73e9562b7491fe3;frontend/template/dummy.tpl @@ -112,7 +112,7 @@ ec0675d513fe14aa3766347ab3fe45ba;paymentmethod/UnzerDirectBankTransfer.php dbcc0575277980988db941ad8c5119fb;paymentmethod/UnzerPaylaterInstallment.php 48bd0bd6ada6c60c68be29f98872022b;paymentmethod/UnzerPaylaterDirectDebit.php b620607859a543b6b39a4dd0f8713d10;paymentmethod/HeidelpayInvoice.php -a9414b8a4fbc4e3b5c4de0ec01900841;paymentmethod/UnzerPaylaterInvoice.php +ef681dfaf1a3d16adb00a24d90c9c8f2;paymentmethod/UnzerPaylaterInvoice.php b4e9f466cbc90886f8b05b52f0d656f3;paymentmethod/HeidelpayPayPal.php cdb6414c94813a842353d8a5e249b9a6;paymentmethod/template/flexipay_direct_form.tpl de71ef7ad1d74778d6aefa06353ea7c1;paymentmethod/template/ideal_form.tpl @@ -154,7 +154,7 @@ c65a3c33c1ee600a39978def51d21510;paymentmethod/HeidelpayInvoiceGuaranteed.php 1f91db143a39995cc686619f6c4a882c;paymentmethod/HeidelpaySEPADirectDebitGuaranteed.php e569da9af0bcb8225ff8f3d6c949f418;apple-developer-merchantid-domain-association e73740baa8bcab9ac6d47b2a95daa826;jsconfig.json -cd9775fda8778662a3f19f373df9467c;Bootstrap.php +dc1c2234c6d677f57fab5413554bdc95;Bootstrap.php c2405627e35992f208ba7281a6490256;adminmenu/scss/admin.scss ef5d72b877de66653e21bf6cafd03bd5;adminmenu/js/keypairs.js 593e3e1024084fc1ee04e38a3a2e3ad7;adminmenu/js/admin.js @@ -167,7 +167,7 @@ e0b9e6894421345360862d2571283a23;adminmenu/template/partials/_header.tpl e68888b6874c60a42db48e2ead9dba40;adminmenu/template/partials/_keypair_item.tpl 94692a0334d6eeefe4b4806fc5832914;adminmenu/template/partials/_includes.tpl 7fce418366a4acd0f313f00ac2a48901;adminmenu/template/partials/_order_detail.tpl -cd49f410d8c6d8176702d879b5a72e34;adminmenu/template/partials/_order_item.tpl +b7e308e5ff89b5c6d00956183db19a2d;adminmenu/template/partials/_order_item.tpl 50329cc04d18170a2e8f086579a67366;adminmenu/template/partials/_keypair_list.tpl 746bd73bf157393d5d55f4b559a8c6e5;adminmenu/css/admin.css.map 7597a877c5a0775fbaddce1b2ab27eb8;adminmenu/css/admin.css diff --git a/frontend/js/unzer.js b/frontend/js/unzer.js index ffa27fd..659a540 100644 --- a/frontend/js/unzer.js +++ b/frontend/js/unzer.js @@ -795,6 +795,8 @@ var UnzerPayment = /*#__PURE__*/function () { }, { key: "hideFormFields", value: function hideFormFields(paymentMethodName) { + var _this = this; + var field = $('#customer'); field.find('.field').filter('.city, .company, :has(.country), .street, .zip, .firstname, .lastname').hide(); field.find('.salutation-customer').hide(); @@ -808,6 +810,10 @@ var UnzerPayment = /*#__PURE__*/function () { field.find('.unzerUI.form>.checkboxLabel').hide(); field.find('.unzerUI.form>.salutation-unzer-' + paymentMethodName + '-customer').hide(); } + + field.find('.companyType').on('change', function (e) { + return _this.hideFormFields(paymentMethodName); + }); } /** * Create Paylayter Installment Payment Type @@ -819,7 +825,7 @@ var UnzerPayment = /*#__PURE__*/function () { }, { key: "createPaylaterInstallment", value: function createPaylaterInstallment() { - var _this = this; + var _this2 = this; this.customerResource = this.createCustomer('paylater-installment', true); var continueButton = this.settings.submitButton || document.getElementById("submit-button"); @@ -847,7 +853,7 @@ var UnzerPayment = /*#__PURE__*/function () { var isValid = e.action === 'validate' && e.success; - _this.onPaylaterInputValidation(e, isValid, 'paylater-installment', continueButton); + _this2.onPaylaterInputValidation(e, isValid, 'paylater-installment', continueButton); }); return paylaterInstallment; } @@ -861,7 +867,7 @@ var UnzerPayment = /*#__PURE__*/function () { }, { key: "createPaylaterInvoice", value: function createPaylaterInvoice() { - var _this2 = this; + var _this3 = this; this.customerResource = this.createCustomer('paylater-invoice', true); var continueButton = this.settings.submitButton || document.getElementById("submit-button"); @@ -872,7 +878,7 @@ var UnzerPayment = /*#__PURE__*/function () { customerType: this.settings.isB2B ? 'B2B' : 'B2C' }); paylaterInvoice.addEventListener('change', function (e) { - return _this2.onPaylaterInputValidation(e, e.success, 'paylater-invoice', continueButton); + return _this3.onPaylaterInputValidation(e, e.success, 'paylater-invoice', continueButton); }); return paylaterInvoice; } @@ -886,7 +892,7 @@ var UnzerPayment = /*#__PURE__*/function () { }, { key: "createPaylaterDirectDebit", value: function createPaylaterDirectDebit() { - var _this3 = this; + var _this4 = this; this.customerResource = this.createCustomer('paylater-direct-debit', true); var continueButton = this.settings.submitButton || document.getElementById("submit-button"); @@ -897,7 +903,7 @@ var UnzerPayment = /*#__PURE__*/function () { customerType: this.settings.isB2B ? 'B2B' : 'B2C' }); paylaterDirectDebit.addEventListener('change', function (e) { - return _this3.onPaylaterInputValidation(e, e.success, 'paylater-direct-debit', continueButton); + return _this4.onPaylaterInputValidation(e, e.success, 'paylater-direct-debit', continueButton); }); return paylaterDirectDebit; } @@ -942,7 +948,7 @@ var UnzerPayment = /*#__PURE__*/function () { }, { key: "createCard", value: function createCard() { - var _this4 = this; + var _this5 = this; var Card = this.unzerInstance.Card(); var styling = { @@ -995,13 +1001,13 @@ var UnzerPayment = /*#__PURE__*/function () { if (e.success) { formFieldValid[e.type] = true; - _this4.errorHandler.hide(); + _this5.errorHandler.hide(); } if (e.error) { formFieldValid[e.type] = false; - _this4.errorHandler.show(e.error); + _this5.errorHandler.show(e.error); } if (e.reset) { @@ -1065,7 +1071,7 @@ var UnzerPayment = /*#__PURE__*/function () { }, { key: "createSepa", value: function createSepa() { - var _this5 = this; + var _this6 = this; var Sepa = this.unzerInstance.SepaDirectDebit(); Sepa.create('sepa-direct-debit', { @@ -1079,7 +1085,7 @@ var UnzerPayment = /*#__PURE__*/function () { if (e.success) { continueButton.removeAttribute('disabled'); - _this5.errorHandler.hide(); + _this6.errorHandler.hide(); return; } @@ -1098,7 +1104,7 @@ var UnzerPayment = /*#__PURE__*/function () { }, { key: "createSepaGuaranteed", value: function createSepaGuaranteed() { - var _this6 = this; + var _this7 = this; var SepaGuaranteed = this.unzerInstance.SepaDirectDebitSecured(); SepaGuaranteed.create('sepa-direct-debit-guaranteed', { @@ -1112,7 +1118,7 @@ var UnzerPayment = /*#__PURE__*/function () { if (e.success) { continueButton.removeAttribute('disabled'); - _this6.errorHandler.hide(); + _this7.errorHandler.hide(); return; } @@ -1184,7 +1190,7 @@ var UnzerPayment = /*#__PURE__*/function () { }, { key: "createIdeal", value: function createIdeal() { - var _this7 = this; + var _this8 = this; var Ideal = this.unzerInstance.Ideal(); Ideal.create('ideal', { @@ -1198,7 +1204,7 @@ var UnzerPayment = /*#__PURE__*/function () { if (e.value) { continueButton.removeAttribute('disabled'); - _this7.errorHandler.hide(); + _this8.errorHandler.hide(); return; } diff --git a/frontend/js/unzer.js.map b/frontend/js/unzer.js.map index 6d3f7d5..aef1b0d 100644 --- a/frontend/js/unzer.js.map +++ b/frontend/js/unzer.js.map @@ -19,7 +19,7 @@ "node_modules/@babel/runtime/helpers/interopRequireDefault.js" ], "names": [], - "mappings": "AAAA;;;;;ACAA;;AACA;;AACA;;AACA;;AACA;;AAEA,MAAM,CAAC,SAAP,GAAmB,mBAAnB;AACA,MAAM,CAAC,YAAP,GAAsB,sBAAtB;AACA,MAAM,CAAC,aAAP,GAAuB,oBAAvB;AACA,MAAM,CAAC,eAAP,GAAyB,sBAAzB;AACA,MAAM,CA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AAf,EAAsB,IAAtB,EAA4B,IAA5B,CAA9C,GAAmF,aADvF;IAGH;;;WAED,6BAAoB;MAChB,KAAK,UAAL,CAAgB,MAAhB,CACI,CAAC,CAAC,sFAAD,CADL;MAGA,KAAK,IAAL,GAAY,KAAK,UAAL,CAAgB,IAAhB,CAAqB,iBAArB,CAAZ;IACH;;;;;;;;;;;;;;;;;;;;;IC/BgB,Y;EACjB;AACJ;AACA;AACA;EACI,sBAAY,QAAZ,EAAsB,OAAtB,EAA+B;IAAA;IAC3B,KAAK,QAAL,GAAgB,QAAQ,IAAI,CAAC,CAAC,kBAAD,CAA7B;IACA,KAAK,OAAL,GAAe,OAAO,IAAI,KAAK,QAAL,CAAc,IAAd,CAAmB,QAAnB,CAA1B;EACH;EAED;AACJ;AACA;AACA;;;;;WACI,cAAK,OAAL,EAAc;MACV,KAAK,QAAL,CAAc,IAAd;MACA,KAAK,OAAL,CAAa,IAAb,CAAkB,OAAlB;IACH;IAED;AACJ;AACA;;;;WACI,gBAAO;MACH,KAAK,QAAL,CAAc,IAAd;MACA,KAAK,OAAL,CAAa,IAAb;IACH;;;;;;;;ACzBL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA", + "mappings": "AAAA;;;;;ACAA;;AACA;;AACA;;AACA;;AACA;;AAEA,MAAM,CAAC,SAAP,GAAmB,mBAAnB;AACA,MAAM,CAAC,YAAP,GAAsB,sBAAtB;AACA,MAAM,C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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA", "file": "unzer.js", "sourceRoot": "", "sourcesContent": [ @@ -27,7 +27,7 @@ "import ApplePay from './payments/applepay';\nimport ApplePayV2 from './payments/applepay_v2';\nimport UnzerPayment from \"./payments/general\";\nimport GooglePay from './payments/googlepay';\nimport Installment from \"./payments/instalment\";\n\nwindow.HpPayment = UnzerPayment;\nwindow.HpInstalment = Installment;\nwindow.UnzerApplePay = ApplePay;\nwindow.UnzerApplePayV2 = ApplePayV2;\nwindow.UnzerGooglePay = GooglePay;\n", "import ErrorHandler from \"../utils/errors\";\nimport Debugging from \"../utils/debugging\";\n\n/** @type {ApplePaySnippets} */\nconst ApplePaySnippetsDefaults = {\n NOT_SUPPORTED: \"This device does not support Apple Pay!\",\n CANCEL_BY_USER: \"Canceled payment process by user!\"\n};\n\nexport default class ApplePay {\n /**\n * Similiar to the HeidelpayPayment class but slightly differently\n * (apple pay works differently, so yeah, custom class it is :D)\n *\n * @class\n * @param {String} pubKey\n * @param {ApplePayPaymentRequest} applePayPaymentRequest\n * @param {ApplePaySnippets} snippets\n * @param {ApplePaySettings} settings\n */\n constructor(pubKey, applePayPaymentRequest, snippets, settings) {\n /** @type {ApplePaySettings} */\n this.settings = settings || {};\n\n /** @type {ApplePaySnippets} */\n this.snippets = Object.assign(ApplePaySnippetsDefaults, snippets);\n\n var options = {\n locale: this.settings.locale || 'de-DE'\n };\n\n /** @type {ApplePayPaymentRequest} */\n this.applePayPaymentRequest = applePayPaymentRequest;\n this.unzerInstance = new unzer(pubKey, options);\n this.errorHandler = new ErrorHandler(this.settings.$errorContainer, this.settings.$errorMessage);\n this.debugging = new Debugging($('.unzerUI'));\n window.UNZER_DEBUG = !!this.unzerInstance._isSandbox || this.unzerInstance.config.hasSandboxKey; // Enable Debugging in sandbox mode\n\n if (!window.ApplePaySession|| !window.ApplePaySession.canMakePayments()) {\n this.unsupportedDevice();\n return;\n }\n\n /** @type {HTMLElement} form Form in which the customer enters additional details */\n this.form = this.settings.form || document.getElementById('form_payment_extra');\n\n // Register Events\n this.initPaymentType = this.initPaymentType.bind(this); // it's a trick! needed in order to overcome the remove event listener\n this.form.addEventListener('submit', this.initPaymentType);\n $('.apple-pay-button').on('click', this.initPaymentType.bind(this));\n }\n\n /**\n * Init the payment type in this case means starting the apple pay session\n * @param {Event} event\n */\n initPaymentType(event) {\n event.preventDefault();\n\n if (!window.ApplePaySession || !window.ApplePaySession.canMakePayments()) {\n this.unsupportedDevice();\n return;\n }\n\n // We adhere to Apple Pay version 6 to handle the payment request.\n const session = new ApplePaySession(3, this.applePayPaymentRequest);\n this.debugging.log('[> Init Payment Type]', {paymentRequest: this.applePayPaymentRequest});\n\n session.onvalidatemerchant = (event) => {\n this.merchantValidationCallback(event, session);\n };\n\n session.onpaymentauthorized = (event) => {\n this.applePayAuthorizedCallback(event, session);\n };\n\n session.oncancel = (event) => {\n this.debugging.log('[> Cancel]', {event});\n this.errorHandler.show(this.snippets.CANCEL_BY_USER);\n };\n\n session.begin();\n }\n\n /**\n * Call the merchant validation in the server-side integration (apple_pay_merchantvalidation)\n * @param {Event} event\n * @param {ApplePaySession} session\n */\n merchantValidationCallback(event, session) {\n var validationUrl = JSON.stringify(event.validationURL);\n\n this.debugging.log('[> Merchant Validation]', {event});\n\n $.ajax({\n 'url': $.evo.io().options.ioUrl,\n 'method': 'POST',\n 'dataType': 'json',\n 'data': 'io={\"name\":\"apple_pay_merchantvalidation\", \"params\":[' + validationUrl + ']}',\n }).done((validationResponse) => {\n this.debugging.log('[> Merchant Validation Response]', validationResponse);\n\n try {\n session.completeMerchantValidation(validationResponse);\n } catch (e) {\n alert(e.message);\n }\n })\n .fail((error) => {\n this.debugging.log('[> Merchant Validation Error]', error);\n this.errorHandler.show(JSON.stringify(error.statusText));\n session.abort();\n });\n }\n\n /**\n * Create Apple Pay resource with unzer and save the resource id to charge it later.\n *\n * We do this here via AJAX instead of the validateAdditional method in the payment method to set the apple pay\n * session state accordingly.\n *\n * @param {Event} event\n * @param {ApplePaySession} session\n */\n applePayAuthorizedCallback(event, session) {\n // Get payment data from event.\n // \"event.payment\" also contains contact information, if they were set via Apple Pay.\n var self = this;\n var unzerApplePayInstance = this.unzerInstance.ApplePay();\n var paymentData = event.payment.token.paymentData;\n\n this.debugging.log('[> Payment Authorization]', {unzerApplePayInstance, event, paymentData});\n\n // Create an Unzer instance with your public key\n unzerApplePayInstance.createResource(paymentData)\n .then(function (createdResource) {\n // Hand over the type ID to your backend.\n var typeId = JSON.stringify(createdResource.id);\n $.ajax({\n 'url': $.evo.io().options.ioUrl,\n 'method': 'POST',\n 'dataType': 'json',\n 'data': 'io={\"name\":\"apple_pay_payment_authorized\", \"params\":[' + typeId + ']}',\n }).done(function (result) {\n // Handle the transaction respone from backend.\n self.debugging.log('[> Payment Authorization Response]', {result, typeId});\n var status = result.transactionStatus;\n if (status === 'success' || status === 'pending') {\n session.completePayment({ status: window.ApplePaySession.STATUS_SUCCESS });\n\n // Append Payment Resource Id\n const hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'paymentData[resourceId]');\n hiddenInput.setAttribute('value', typeId);\n self.form.appendChild(hiddenInput);\n\n // Submitting the form\n self.form.removeEventListener('submit', self.initPaymentType);\n self.form.submit();\n } else {\n self.abortPaymentSession(session);\n }\n }).fail(function (error) {\n self.errorHandler.show(error.statusText);\n self.abortPaymentSession(session);\n });\n })\n .catch(function (error) {\n self.debugging.log('[> Payment Authorization Error]', error);\n self.errorHandler.show(error.message);\n self.abortPaymentSession(session);\n });\n }\n\n /**\n * Handle Unsupported devices\n */\n unsupportedDevice() {\n this.settings.submitButton.disabled = true;\n this.settings.submitButton.ariaDisabled = true;\n this.errorHandler.show(this.snippets.NOT_SUPPORTED);\n }\n\n /**\n * abort current payment session.\n * @param {ApplePaySession} session\n */\n abortPaymentSession(session) {\n this.debugging.log('[> Abort Payment Session]', { status: window.ApplePaySession.STATUS_FAILURE });\n session.completePayment({ status: window.ApplePaySession.STATUS_FAILURE });\n session.abort();\n }\n}\n", "import ErrorHandler from \"../utils/errors\";\nimport Debugging from \"../utils/debugging\";\n\n/** @type {ApplePaySnippets} */\nconst ApplePaySnippetsDefaults = {\n NOT_SUPPORTED: \"This device does not support Apple Pay!\",\n CANCEL_BY_USER: \"Canceled payment process by user!\"\n};\n\nexport default class ApplePayV2 {\n /** @type {ApplePaySettings} */\n settings;\n\n /** @type {ApplePaySnippets} */\n snippets;\n\n /** @type {HTMLFormElement} */\n form;\n\n /** @type {ApplePayPaymentRequest} */\n applePayPaymentRequest;\n\n #errorHandler = new ErrorHandler();\n #debugging = new Debugging($('.unzerUI'));\n\n /**\n * @class\n * @param {String} pubKey\n * @param {ApplePayPaymentRequest} applePayPaymentRequest\n * @param {ApplePaySnippets} snippets\n * @param {ApplePaySettings} settings\n */\n constructor(pubKey, applePayPaymentRequest, snippets, settings) {\n this.settings = settings;\n this.snippets = Object.assign(ApplePaySnippetsDefaults, snippets);\n this.form = this.settings.form || document.getElementById('complete_order');\n this.applePayPaymentRequest = applePayPaymentRequest;\n this.unzerInstance = new unzer(pubKey, {\n locale: this.settings.locale || 'de-DE'\n });\n window.UNZER_DEBUG = !!this.unzerInstance._isSandbox || this.unzerInstance.config.hasSandboxKey; // Enable Debugging in sandbox mode\n\n if (!window.ApplePaySession || !window.ApplePaySession.canMakePayments()) {\n this.#unsupportedDevice();\n return;\n }\n\n // Register Events\n this.initPaymentType = this.initPaymentType.bind(this); // it's a trick! needed in order to overcome the remove event listener\n this.form.addEventListener('submit', this.initPaymentType);\n $('.apple-pay-button').on('click', this.initPaymentType.bind(this));\n }\n\n /**\n * @param {Event} event\n */\n initPaymentType(event) {\n event.preventDefault();\n const applePayInstance = this.unzerInstance.ApplePay();\n const session = applePayInstance.initApplePaySession(this.applePayPaymentRequest); // setup session with default merchant validation\n\n this.#debugging.log('[> Init Payment Type]', { paymentRequest: this.applePayPaymentRequest });\n\n if (!window.ApplePaySession || !window.ApplePaySession.canMakePayments()) {\n this.#unsupportedDevice();\n return;\n }\n\n /** @param {Event} event */\n session.onpaymentauthorized = (event) => {\n this.#applePayAuthorizedCallback(event, applePayInstance, session);\n };\n\n /** @param {Event} event */\n session.oncancel = (event) => {\n this.#debugging.log('[> Cancel]', {event});\n this.#errorHandler.show(this.snippets.CANCEL_BY_USER);\n };\n\n session.begin();\n }\n\n /**\n * Create Apple Pay resource with unzer and save the resource id to charge it later.\n *\n * @param {Event & {payment: {token: {paymentData: object}}}} event\n * @param {Object} applePayInstance\n * @param {ApplePaySession} session\n */\n #applePayAuthorizedCallback(event, applePayInstance, session) {\n const paymentData = event.payment.token.paymentData;\n\n this.#debugging.log('[> Payment Authorization]', { applePayInstance, event, paymentData });\n\n // Create an Unzer instance with your public key\n applePayInstance.createResource(paymentData)\n .then((createdResource) => {\n this.#debugging.log('[> Payment Authorization Resource]', { createdResource });\n session.completePayment({ status: window.ApplePaySession.STATUS_SUCCESS });\n\n // Hand over the payment type ID (createdResource.id)\n const typeId = JSON.stringify(createdResource.id);\n const hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'unzer-payment-type-id');\n hiddenInput.setAttribute('value', typeId);\n\n this.form.appendChild(hiddenInput);\n this.form.removeEventListener('submit', this.initPaymentType);\n this.form.submit();\n })\n .catch(error => {\n this.#debugging.log('[> Payment Authorization Error]', error);\n this.#errorHandler.show(error.message);\n this.#abortPaymentSession(session);\n })\n }\n\n /**\n * abort current payment session.\n * @param {ApplePaySession} session\n */\n #abortPaymentSession(session) {\n this.#debugging.log('[> Abort Payment Session]', { status: window.ApplePaySession.STATUS_FAILURE });\n session.completePayment({ status: window.ApplePaySession.STATUS_FAILURE });\n session.abort();\n }\n\n /**\n * Handle Unsupported devices\n */\n #unsupportedDevice() {\n this.#errorHandler.show(this.snippets.NOT_SUPPORTED);\n console.error(this.snippets.NOT_SUPPORTED);\n }\n}", - "import ErrorHandler from \"../utils/errors\";\n\nexport default class UnzerPayment {\n static PAYMENT_TYPES = {\n ALIPAY: 'Alipay',\n CARD: 'Card',\n EPS: 'EPS',\n FLEXIPAY_DIRECT: 'FlexiPay Direct',\n HIRE_PURCHASE: 'Hire Purchase',\n PAYPAL: 'Paypal',\n INVOICE: 'Invoice',\n INVOICE_FACTORING: 'Invoice Factoring',\n INVOICE_GUARANTEED: 'Invoice Guaranteed',\n SEPA: 'SEPA',\n SEPA_GUARANTEED: 'SEPA (guaranteed)',\n SOFORT: 'SOFORT',\n GIROPAY: 'Giropay',\n PRZELEWY24: 'Przelewy24',\n IDEAL: 'iDEAL',\n PREPAYMENT: 'Prepayment',\n WECHAT_PAY: 'WeChat Pay',\n PAYLATER_INVOICE: 'Paylater Invoice',\n BANCONTACT: 'Bancontact',\n PAYLATER_INSTALLMENT: 'Paylater Installment',\n PAYLATER_DIRECT_DEBIT: 'Paylater Direct Debit',\n TWINT: 'Twint',\n OPEN_BANKING: 'Open Banking',\n };\n\n /**\n * Heidelpay Payment Class\n *\n * @param {string} pubKey Public Key\n * @param {string} type Payment Type\n * @param {PaymentSettings} settings\n */\n constructor(pubKey, type, settings) {\n /** @type {PaymentSettings} */\n this.settings = settings || {};\n\n var options = {\n locale: this.settings.locale || 'de-DE'\n };\n\n this.unzerInstance = new unzer(pubKey, options);\n this.errorHandler = new ErrorHandler(this.settings.$errorContainer, this.settings.$errorMessage);\n\n /** @type {?string} customerId */\n this.customerId = settings.customerId || null;\n\n /** @type {{createCustomer: Function, updateCustomer: Function}|null} customerResource */\n this.customerResource = null;\n\n /** @type {{createResource: Function}} paymentType */\n this.paymentType = this.initPaymentType(type);\n\n /** @type {HTMLElement} form Form in which the customer enters additional details */\n this.form = this.settings.form || document.getElementById('form_payment_extra');\n\n // Register Events\n this.handleFormSubmit = this.handleFormSubmit.bind(this); // it's a trick! needed in order to overcome the remove event listener\n this.form.addEventListener('submit', this.handleFormSubmit);\n\n if (this.settings.autoSubmit) {\n // this.form.dispatchEvent(new Event('submit')); // Causes endless redirects in some browsers like FF, so we call the callback directly...\n this.handleFormSubmit(new Event('submit'));\n }\n }\n\n /**\n * Init Payment Type\n *\n * @param {string} type\n * @returns {object} payment type\n * @throws Error if there is an unkown payment type\n */\n initPaymentType(type) {\n switch (type) {\n case UnzerPayment.PAYMENT_TYPES.CARD:\n return this.createCard();\n\n case UnzerPayment.PAYMENT_TYPES.INVOICE:\n return this.createInvoice();\n\n case UnzerPayment.PAYMENT_TYPES.INVOICE_GUARANTEED:\n return this.createInvoiceGuaranteed();\n\n case UnzerPayment.PAYMENT_TYPES.INVOICE_FACTORING:\n return this.createInvoiceFactoring();\n\n case UnzerPayment.PAYMENT_TYPES.SEPA:\n return this.createSepa();\n\n case UnzerPayment.PAYMENT_TYPES.SEPA_GUARANTEED:\n return this.createSepaGuaranteed();\n\n case UnzerPayment.PAYMENT_TYPES.PAYPAL:\n return this.createPaypal();\n\n case UnzerPayment.PAYMENT_TYPES.SOFORT:\n return this.createSofort();\n\n case UnzerPayment.PAYMENT_TYPES.GIROPAY:\n return this.createGiropay();\n\n case UnzerPayment.PAYMENT_TYPES.PRZELEWY24:\n return this.createPrzelewy24();\n\n case UnzerPayment.PAYMENT_TYPES.IDEAL:\n return this.createIdeal();\n\n case UnzerPayment.PAYMENT_TYPES.PREPAYMENT:\n return this.createPrepayment();\n\n case UnzerPayment.PAYMENT_TYPES.EPS:\n return this.createEPS();\n\n case UnzerPayment.PAYMENT_TYPES.FLEXIPAY_DIRECT:\n return this.createFlexiPayDirect();\n\n case UnzerPayment.PAYMENT_TYPES.ALIPAY:\n return this.createAlipay();\n\n case UnzerPayment.PAYMENT_TYPES.TWINT:\n return this.createTwint();\n\n case UnzerPayment.PAYMENT_TYPES.WECHAT_PAY:\n return this.createWeChatPay();\n\n case UnzerPayment.PAYMENT_TYPES.HIRE_PURCHASE:\n return this.createHirePurchase();\n\n case UnzerPayment.PAYMENT_TYPES.PAYLATER_INVOICE:\n return this.createPaylaterInvoice();\n\n case UnzerPayment.PAYMENT_TYPES.BANCONTACT:\n return this.createBancontact();\n\n case UnzerPayment.PAYMENT_TYPES.PAYLATER_INSTALLMENT:\n return this.createPaylaterInstallment();\n\n case UnzerPayment.PAYMENT_TYPES.PAYLATER_DIRECT_DEBIT:\n return this.createPaylaterDirectDebit();\n\n case UnzerPayment.PAYMENT_TYPES.OPEN_BANKING:\n return this.createOpenBanking();\n\n default:\n throw new Error('Unkown Payment Type: ' + type);\n }\n }\n\n /**\n * Handle the form submit\n *\n * @param {Event} event Submit Event\n */\n handleFormSubmit(event) {\n var self = this;\n event.preventDefault();\n\n // Creating a Payment resource and (optional) Customer Resource\n var resources = [this.paymentType.createResource()];\n\n if (this.customerResource) {\n resources.push(this.customerId ? this.customerResource.updateCustomer() : this.customerResource.createCustomer());\n }\n\n Promise.all(resources).then(function (result) {\n // Append Payment Resource Id\n var hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'paymentData[resourceId]');\n hiddenInput.setAttribute('value', result[0].id);\n self.form.appendChild(hiddenInput);\n\n // Append Customer Id\n if (result.length >= 2) {\n var hiddenCstInput = document.createElement('input');\n hiddenCstInput.setAttribute('type', 'hidden');\n hiddenCstInput.setAttribute('name', 'paymentData[customerId]');\n hiddenCstInput.setAttribute('value', result[1].id);\n self.form.appendChild(hiddenCstInput);\n }\n\n // Submitting the form\n self.form.removeEventListener('submit', self.handleFormSubmit);\n self.form.submit();\n })\n .catch(function (error) {\n self.errorHandler.show(error.message);\n });\n }\n\n /**\n * Handle Paylater Input Validation\n * @param {Event} event\n * @param {boolean} isValid\n * @param {String} paymentMethodName\n * @param {HTMLElement} continueButton\n * @returns\n */\n onPaylaterInputValidation(event, isValid, paymentMethodName, continueButton) {\n // console.log(paymentMethodName, { event, isValid, continueButton, 's360-valid': continueButton.getAttribute('data-s360-valid') });\n\n if (isValid) {\n // everything is still valid\n if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n // Customer is already valid -> everything is valid\n if (continueButton.getAttribute('data-s360-valid') == 'customer') {\n continueButton.setAttribute('data-s360-valid', 'all');\n continueButton.removeAttribute('disabled');\n return;\n }\n\n // mark payment method as valid\n continueButton.setAttribute('data-s360-valid', paymentMethodName);\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n\n // only invalidate if the paymentMethodName was valid before\n if (continueButton.getAttribute('data-s360-valid') == paymentMethodName) {\n continueButton.setAttribute('data-s360-valid', 0);\n } else if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.setAttribute('data-s360-valid', 'customer');\n }\n }\n\n /**\n * Create (or update) customer resource.\n *\n * @param {?String} paymentTypeName\n * @param {?String} multipleValidation\n * @see https://docs.heidelpay.com/docs/customer-ui-integration\n * @returns {{createCustomer: Function, updateCustomer: Function}} Customer Resource\n */\n createCustomer(paymentTypeName = null, multipleValidation = false) {\n var Customer = this.settings.isB2B ? this.unzerInstance.B2BCustomer() : this.unzerInstance.Customer();\n var customerObj = this.settings.customer || {};\n var continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n let options = {\n containerId: 'customer',\n showInfoBox: false,\n showHeader: false,\n fields: ['name', 'birthdate']\n };\n\n if (paymentTypeName) {\n options.paymentTypeName = paymentTypeName;\n }\n\n Customer.initFormFields(customerObj);\n if (multipleValidation) {\n continueButton.setAttribute('data-s360-valid', 0);\n\n Customer.addEventListener('validate', (e) => {\n // console.log('customer validate', e, continueButton, continueButton.getAttribute('data-s360-valid'));\n continueButton.setAttribute('disabled', true);\n\n if (e.success) {\n // everything is still valid\n if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n // payment method is already valid -> everything is valid\n if (continueButton.getAttribute('data-s360-valid') == paymentTypeName) {\n continueButton.setAttribute('data-s360-valid', 'all');\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('data-s360-valid', 'customer');\n return;\n }\n\n // only invalidate if the customer was valid before\n if (continueButton.getAttribute('data-s360-valid') == 'customer') {\n continueButton.setAttribute('data-s360-valid', 0);\n } else if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.setAttribute('data-s360-valid', paymentTypeName);\n }\n });\n } else {\n Customer.addEventListener('validate', (e) => {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n }\n\n if (this.settings.isB2B) {\n options.fields = ['companyInfo'];\n // options = {containerId: 'customer'};\n }\n\n if (this.customerId) {\n Customer.update(this.customerId, options);\n return Customer;\n }\n\n Customer.create(options);\n\n return Customer;\n }\n\n /**\n * Hide form fields from unzer ui component because they are already filled by the shop\n * @param {string} paymentMethodName\n */\n hideFormFields(paymentMethodName) {\n const field = $('#customer');\n\n field.find('.field').filter(\n '.city, .company, :has(.country), .street, .zip, .firstname, .lastname'\n ).hide();\n field.find('.salutation-customer').hide();\n field.find('.firstname, .lastname').parent('.fields').hide();\n field.find('.unzerUI.divider-horizontal:eq(0)').hide();\n field.find('.unzerUI.message.downArrow').hide();\n\n if (paymentMethodName) {\n field.find('.field').filter('.checkbox-billingAddress, .email').hide();\n field.find('.field').filter(\n '.billing-name, .billing-street, .billing-zip, .billing-city, :has(.billing-country)'\n ).hide();\n field.find('.unzerUI.form>.checkboxLabel').hide();\n field.find('.unzerUI.form>.salutation-unzer-' + paymentMethodName + '-customer').hide();\n }\n }\n\n /**\n * Create Paylayter Installment Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/unzer-installment-upl/accept-unzer-installment-ui-component/\n * @returns {{createResource: Function}}\n */\n createPaylaterInstallment() {\n this.customerResource = this.createCustomer('paylater-installment', true);\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n const paylaterInstallment = this.unzerInstance.PaylaterInstallment();\n\n this.hideFormFields('paylater-installment');\n\n paylaterInstallment.create({\n containerId: 'paylater-installment',\n amount: this.settings.amount,\n currency: this.settings.currency,\n country: this.settings.country\n });\n\n paylaterInstallment.addEventListener('paylaterInstallmentEvent', (e) => {\n switch (e.currentStep) {\n case 'plan-list':\n continueButton.setAttribute('disabled', true);\n break;\n\n case 'plan-detail':\n continueButton.setAttribute('disabled', false);\n break;\n\n default:\n break;\n }\n\n const isValid = e.action === 'validate' && e.success;\n this.onPaylaterInputValidation(e, isValid, 'paylater-installment', continueButton);\n });\n\n return paylaterInstallment;\n }\n\n /**\n * Create Paylayter Invoice Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/unzer-invoice-upl/accept-unzer-invoice-upl-ui-component/\n * @returns {{createResource: Function}}\n */\n createPaylaterInvoice() {\n this.customerResource = this.createCustomer('paylater-invoice', true);\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n const paylaterInvoice = this.unzerInstance.PaylaterInvoice();\n\n this.hideFormFields('paylater-invoice');\n\n paylaterInvoice.create({\n containerId: 'paylater-invoice',\n customerType: this.settings.isB2B ? 'B2B' : 'B2C'\n });\n\n paylaterInvoice.addEventListener('change', (e) =>\n this.onPaylaterInputValidation(\n e,\n e.success,\n 'paylater-invoice',\n continueButton\n )\n );\n\n return paylaterInvoice;\n }\n\n /**\n * Create Paylayter Invoice Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/direct-debit-secured/accept-direct-debit-secured-ui-component/\n * @returns {{createResource: Function}}\n */\n createPaylaterDirectDebit() {\n this.customerResource = this.createCustomer('paylater-direct-debit', true);\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n const paylaterDirectDebit = this.unzerInstance.PaylaterDirectDebit();\n\n this.hideFormFields('paylater-direct-debit');\n\n paylaterDirectDebit.create('paylater-direct-debit', {\n containerId: 'paylater-direct-debit',\n customerType: this.settings.isB2B ? 'B2B' : 'B2C'\n });\n\n paylaterDirectDebit.addEventListener('change', (e) =>\n this.onPaylaterInputValidation(\n e,\n e.success,\n 'paylater-direct-debit',\n continueButton\n )\n );\n\n return paylaterDirectDebit;\n }\n\n /**\n * Create Bancontact Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/bancontact/accept-bancontact-ui-component/\n * @returns {{createResource: Function}}\n */\n createBancontact() {\n const bancontact = this.unzerInstance.Bancontact();\n const styling = { fontSize: null, fontColor: null, fontFamily: null };\n\n if (this.settings.styling) {\n styling.fontColor = this.settings.styling.fontColor || null;\n styling.fontSize = this.settings.styling.fontSize || null;\n styling.fontFamily = this.settings.styling.fontFamily || null;\n }\n\n bancontact.create('holder', {\n containerId: 'bancontact-holder',\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n\n return bancontact;\n }\n\n /**\n * Create a new Card Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/credit-card-ui-integration\n * @returns {{createResource: Function}} Card Payment Type\n */\n createCard() {\n var Card = this.unzerInstance.Card();\n var styling = {fontSize: null, fontColor: null, fontFamily: null};\n\n if (this.settings.styling) {\n styling.fontColor = this.settings.styling.fontColor || null;\n styling.fontSize = this.settings.styling.fontSize || null;\n styling.fontFamily = this.settings.styling.fontFamily || null;\n }\n\n Card.create('number', {\n containerId: 'card-element-id-number',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n Card.create('expiry', {\n containerId: 'card-element-id-expiry',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n Card.create('cvc', {\n containerId: 'card-element-id-cvc',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n // fontFamily: styling.fontFamily // messes with hidden font in firefox\n });\n Card.create('holder', {\n containerId: 'card-element-id-holder',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n\n // Enable pay button initially\n var formFieldValid = {};\n\n /** @type {HTMLElement} continueButton */\n var continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n Card.addEventListener('change', (e) => {\n if (e.success) {\n formFieldValid[e.type] = true;\n this.errorHandler.hide();\n }\n\n if (e.error) {\n formFieldValid[e.type] = false;\n this.errorHandler.show(e.error);\n }\n\n if (e.reset) {\n formFieldValid[e.type] = false;\n }\n\n if (formFieldValid.number && formFieldValid.expiry && formFieldValid.cvc && formFieldValid.holder) {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n return Card;\n }\n\n /**\n * Create a new Invoice Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/invoice-ui-integration\n * @returns {{createResource: Function}} Invoice Payment Type\n */\n createInvoice() {\n return this.unzerInstance.Invoice();\n }\n\n /**\n * Create a new Invoice Guaranteed Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/invoice-ui-integration\n * @returns {{createResource: Function}} Invoice Payment Type\n */\n createInvoiceGuaranteed() {\n this.customerResource = this.createCustomer();\n\n return this.unzerInstance.InvoiceSecured();\n }\n\n /**\n * Create a new Invoice Factoring Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/invoice-ui-integration\n * @returns {{createResource: Function}} Invoice Payment Type\n */\n createInvoiceFactoring() {\n this.customerResource = this.createCustomer();\n\n return this.unzerInstance.InvoiceSecured();\n }\n\n /**\n * Create a new SEPA Direct Debit Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/sepa-direct-debit-ui-integration\n * @returns {{createResource: Function}} SEPA Direct Debit Payment Type\n */\n createSepa() {\n var Sepa = this.unzerInstance.SepaDirectDebit();\n Sepa.create('sepa-direct-debit', {\n containerId: 'sepa-IBAN'\n });\n\n /** @type {HTMLElement} continueButton */\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n Sepa.addEventListener('change', (e) => {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n this.errorHandler.hide();\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n return Sepa;\n }\n\n /**\n * Create a new SEPA Direct Debit (guaranteed) Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/sepa-direct-debit-ui-integration\n * @returns {{createResource: Function}} SEPA Direct Debit (guaranteed) Payment Type\n */\n createSepaGuaranteed() {\n var SepaGuaranteed = this.unzerInstance.SepaDirectDebitSecured();\n SepaGuaranteed.create('sepa-direct-debit-guaranteed', {\n containerId: 'sepa-guaranteed-IBAN'\n });\n\n /** @type {HTMLElement} continueButton */\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n SepaGuaranteed.addEventListener('change', (e) => {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n this.errorHandler.hide();\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n this.customerResource = this.createCustomer();\n\n return SepaGuaranteed;\n }\n\n /**\n * Create a new PayPal Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/paypal-ui-integration\n * @returns {{createResource: Function}} Papal Payment Type\n */\n createPaypal() {\n var Paypal = this.unzerInstance.Paypal();\n Paypal.create('email', {\n containerId: 'paypal-element-email'\n });\n\n return Paypal;\n }\n\n /**\n * Create a new SOFORT Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#sofort\n * @returns {{createResource: Function}} Sofort Payment Type\n */\n createSofort() {\n return this.unzerInstance.Sofort();\n }\n\n /**\n * Create a new Giropay Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#giropay\n * @returns {{createResource: Function}} Giropay Payment Type\n */\n createGiropay () {\n return this.unzerInstance.Giropay();\n }\n\n /**\n * Create a new Przelewy24 Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#przelewy24\n * @returns {{createResource: Function}} Przelewy24 Payment Type\n */\n createPrzelewy24() {\n return this.unzerInstance.Przelewy24();\n }\n\n /**\n * Create a new iDEAL Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/ideal-ui-integration\n * @returns {{createResource: Function}} iDEAL Payment Type\n */\n createIdeal() {\n var Ideal = this.unzerInstance.Ideal();\n\n Ideal.create('ideal', {\n containerId: 'ideal-element'\n });\n\n /** @type {HTMLElement} continueButton */\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n Ideal.addEventListener('change', (e) => {\n if (e.value) {\n continueButton.removeAttribute('disabled');\n this.errorHandler.hide();\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n return Ideal;\n }\n\n /**\n * Create a new Prepayment Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/prepayment-ui-integration\n * @returns {{createResource: Function}} Prepayment Payment Type\n */\n createPrepayment() {\n return this.unzerInstance.Prepayment();\n }\n\n /**\n * Create a new EPS Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/eps-ui-integration\n * @returns {{createResource: Function}} EPS Payment Type\n */\n createEPS() {\n return this.unzerInstance.EPS();\n }\n\n /**\n * Create a new FlexiPay Direct Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#flexipay-direct\n * @returns {{createResource: Function}} Alipay Payment Type\n */\n createFlexiPayDirect() {\n return this.unzerInstance.FlexiPayDirect();\n }\n\n /**\n * Create a new Alipay Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#alipay\n * @returns {{createResource: Function}} Alipay Payment Type\n */\n createAlipay() {\n return this.unzerInstance.Alipay();\n }\n\n /**\n * Create a new TWINT Payment Type.\n *\n * @see https://docs.unzer.com/payment-methods/twint/accept-twint-ui-component/\n * @returns {{createResource: Function}} Twint Payment Type\n */\n createTwint() {\n return this.unzerInstance.Twint();\n }\n\n /**\n * Create a new Open Banking Payment Type.\n *\n * @returns {{createResource: Function}} Twint Payment Type\n */\n createOpenBanking() {\n return this.unzerInstance.OpenBanking();\n }\n\n /**\n * Create an new WeChat Pay Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#wechat-pay\n * @returns {{createResource: Function}} WeChat Pay Payment Type\n */\n createWeChatPay() {\n return this.unzerInstance.Wechatpay();\n }\n\n /**\n * Create a new Hire Purchase Payment Type.\n *\n * @see https:://docs.heidelpay.com/docs/hire-purchase-ui-integration\n * @returns {{createResource: Function}} Hire Purchase Payment Type\n */\n createHirePurchase() {\n var InstallmentSecured = this.unzerInstance.InstallmentSecured();\n var self = this;\n this.customerResource = this.createCustomer();\n\n /** @type {HTMLElement} continueButton */\n var continueButton = self.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('style', 'display: none');\n continueButton.setAttribute('disabled', true);\n\n InstallmentSecured.create({\n containerId: 'hire-purchase-element',\n amount: this.settings.amount || null,\n currency: this.settings.currency || null,\n effectiveInterest: this.settings.effectiveInterest || null,\n orderDate: this.settings.orderDate || null\n }).then(function (data) {\n // if successful, notify the user that the list of installments was fetched successfully\n // in case you were using a loading element during the fetching process,\n // you can remove it inside this callback function\n })\n .catch(function (response) {\n // sent an error message to the user (fetching installment list failed)\n var msg = '';\n console.error(response.message);\n\n response.error.details.forEach(function(err) {\n console.error('API-Error: ' + err.code);\n msg += err.customerMessage;\n });\n\n self.errorHandler.show(msg);\n });\n\n\n // Listen to UI events\n InstallmentSecured.addEventListener('installmentSecuredEvent', function (e) {\n if (e.action === 'validate') {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n }\n\n if (e.action === 'change-step') {\n if (e.currentSteep === 'plan-list') {\n continueButton.setAttribute('style', 'display: none');\n continueButton.setAttribute('disabled', true);\n return;\n }\n\n continueButton.setAttribute('style', 'display: inline-block');\n }\n });\n\n return InstallmentSecured;\n }\n}\n", + "import ErrorHandler from \"../utils/errors\";\n\nexport default class UnzerPayment {\n static PAYMENT_TYPES = {\n ALIPAY: 'Alipay',\n CARD: 'Card',\n EPS: 'EPS',\n FLEXIPAY_DIRECT: 'FlexiPay Direct',\n HIRE_PURCHASE: 'Hire Purchase',\n PAYPAL: 'Paypal',\n INVOICE: 'Invoice',\n INVOICE_FACTORING: 'Invoice Factoring',\n INVOICE_GUARANTEED: 'Invoice Guaranteed',\n SEPA: 'SEPA',\n SEPA_GUARANTEED: 'SEPA (guaranteed)',\n SOFORT: 'SOFORT',\n GIROPAY: 'Giropay',\n PRZELEWY24: 'Przelewy24',\n IDEAL: 'iDEAL',\n PREPAYMENT: 'Prepayment',\n WECHAT_PAY: 'WeChat Pay',\n PAYLATER_INVOICE: 'Paylater Invoice',\n BANCONTACT: 'Bancontact',\n PAYLATER_INSTALLMENT: 'Paylater Installment',\n PAYLATER_DIRECT_DEBIT: 'Paylater Direct Debit',\n TWINT: 'Twint',\n OPEN_BANKING: 'Open Banking',\n };\n\n /**\n * Heidelpay Payment Class\n *\n * @param {string} pubKey Public Key\n * @param {string} type Payment Type\n * @param {PaymentSettings} settings\n */\n constructor(pubKey, type, settings) {\n /** @type {PaymentSettings} */\n this.settings = settings || {};\n\n var options = {\n locale: this.settings.locale || 'de-DE'\n };\n\n this.unzerInstance = new unzer(pubKey, options);\n this.errorHandler = new ErrorHandler(this.settings.$errorContainer, this.settings.$errorMessage);\n\n /** @type {?string} customerId */\n this.customerId = settings.customerId || null;\n\n /** @type {{createCustomer: Function, updateCustomer: Function}|null} customerResource */\n this.customerResource = null;\n\n /** @type {{createResource: Function}} paymentType */\n this.paymentType = this.initPaymentType(type);\n\n /** @type {HTMLElement} form Form in which the customer enters additional details */\n this.form = this.settings.form || document.getElementById('form_payment_extra');\n\n // Register Events\n this.handleFormSubmit = this.handleFormSubmit.bind(this); // it's a trick! needed in order to overcome the remove event listener\n this.form.addEventListener('submit', this.handleFormSubmit);\n\n if (this.settings.autoSubmit) {\n // this.form.dispatchEvent(new Event('submit')); // Causes endless redirects in some browsers like FF, so we call the callback directly...\n this.handleFormSubmit(new Event('submit'));\n }\n }\n\n /**\n * Init Payment Type\n *\n * @param {string} type\n * @returns {object} payment type\n * @throws Error if there is an unkown payment type\n */\n initPaymentType(type) {\n switch (type) {\n case UnzerPayment.PAYMENT_TYPES.CARD:\n return this.createCard();\n\n case UnzerPayment.PAYMENT_TYPES.INVOICE:\n return this.createInvoice();\n\n case UnzerPayment.PAYMENT_TYPES.INVOICE_GUARANTEED:\n return this.createInvoiceGuaranteed();\n\n case UnzerPayment.PAYMENT_TYPES.INVOICE_FACTORING:\n return this.createInvoiceFactoring();\n\n case UnzerPayment.PAYMENT_TYPES.SEPA:\n return this.createSepa();\n\n case UnzerPayment.PAYMENT_TYPES.SEPA_GUARANTEED:\n return this.createSepaGuaranteed();\n\n case UnzerPayment.PAYMENT_TYPES.PAYPAL:\n return this.createPaypal();\n\n case UnzerPayment.PAYMENT_TYPES.SOFORT:\n return this.createSofort();\n\n case UnzerPayment.PAYMENT_TYPES.GIROPAY:\n return this.createGiropay();\n\n case UnzerPayment.PAYMENT_TYPES.PRZELEWY24:\n return this.createPrzelewy24();\n\n case UnzerPayment.PAYMENT_TYPES.IDEAL:\n return this.createIdeal();\n\n case UnzerPayment.PAYMENT_TYPES.PREPAYMENT:\n return this.createPrepayment();\n\n case UnzerPayment.PAYMENT_TYPES.EPS:\n return this.createEPS();\n\n case UnzerPayment.PAYMENT_TYPES.FLEXIPAY_DIRECT:\n return this.createFlexiPayDirect();\n\n case UnzerPayment.PAYMENT_TYPES.ALIPAY:\n return this.createAlipay();\n\n case UnzerPayment.PAYMENT_TYPES.TWINT:\n return this.createTwint();\n\n case UnzerPayment.PAYMENT_TYPES.WECHAT_PAY:\n return this.createWeChatPay();\n\n case UnzerPayment.PAYMENT_TYPES.HIRE_PURCHASE:\n return this.createHirePurchase();\n\n case UnzerPayment.PAYMENT_TYPES.PAYLATER_INVOICE:\n return this.createPaylaterInvoice();\n\n case UnzerPayment.PAYMENT_TYPES.BANCONTACT:\n return this.createBancontact();\n\n case UnzerPayment.PAYMENT_TYPES.PAYLATER_INSTALLMENT:\n return this.createPaylaterInstallment();\n\n case UnzerPayment.PAYMENT_TYPES.PAYLATER_DIRECT_DEBIT:\n return this.createPaylaterDirectDebit();\n\n case UnzerPayment.PAYMENT_TYPES.OPEN_BANKING:\n return this.createOpenBanking();\n\n default:\n throw new Error('Unkown Payment Type: ' + type);\n }\n }\n\n /**\n * Handle the form submit\n *\n * @param {Event} event Submit Event\n */\n handleFormSubmit(event) {\n var self = this;\n event.preventDefault();\n\n // Creating a Payment resource and (optional) Customer Resource\n var resources = [this.paymentType.createResource()];\n\n if (this.customerResource) {\n resources.push(this.customerId ? this.customerResource.updateCustomer() : this.customerResource.createCustomer());\n }\n\n Promise.all(resources).then(function (result) {\n // Append Payment Resource Id\n var hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'paymentData[resourceId]');\n hiddenInput.setAttribute('value', result[0].id);\n self.form.appendChild(hiddenInput);\n\n // Append Customer Id\n if (result.length >= 2) {\n var hiddenCstInput = document.createElement('input');\n hiddenCstInput.setAttribute('type', 'hidden');\n hiddenCstInput.setAttribute('name', 'paymentData[customerId]');\n hiddenCstInput.setAttribute('value', result[1].id);\n self.form.appendChild(hiddenCstInput);\n }\n\n // Submitting the form\n self.form.removeEventListener('submit', self.handleFormSubmit);\n self.form.submit();\n })\n .catch(function (error) {\n self.errorHandler.show(error.message);\n });\n }\n\n /**\n * Handle Paylater Input Validation\n * @param {Event} event\n * @param {boolean} isValid\n * @param {String} paymentMethodName\n * @param {HTMLElement} continueButton\n * @returns\n */\n onPaylaterInputValidation(event, isValid, paymentMethodName, continueButton) {\n // console.log(paymentMethodName, { event, isValid, continueButton, 's360-valid': continueButton.getAttribute('data-s360-valid') });\n\n if (isValid) {\n // everything is still valid\n if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n // Customer is already valid -> everything is valid\n if (continueButton.getAttribute('data-s360-valid') == 'customer') {\n continueButton.setAttribute('data-s360-valid', 'all');\n continueButton.removeAttribute('disabled');\n return;\n }\n\n // mark payment method as valid\n continueButton.setAttribute('data-s360-valid', paymentMethodName);\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n\n // only invalidate if the paymentMethodName was valid before\n if (continueButton.getAttribute('data-s360-valid') == paymentMethodName) {\n continueButton.setAttribute('data-s360-valid', 0);\n } else if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.setAttribute('data-s360-valid', 'customer');\n }\n }\n\n /**\n * Create (or update) customer resource.\n *\n * @param {?String} paymentTypeName\n * @param {?String} multipleValidation\n * @see https://docs.heidelpay.com/docs/customer-ui-integration\n * @returns {{createCustomer: Function, updateCustomer: Function}} Customer Resource\n */\n createCustomer(paymentTypeName = null, multipleValidation = false) {\n var Customer = this.settings.isB2B ? this.unzerInstance.B2BCustomer() : this.unzerInstance.Customer();\n var customerObj = this.settings.customer || {};\n var continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n let options = {\n containerId: 'customer',\n showInfoBox: false,\n showHeader: false,\n fields: ['name', 'birthdate']\n };\n\n if (paymentTypeName) {\n options.paymentTypeName = paymentTypeName;\n }\n\n Customer.initFormFields(customerObj);\n if (multipleValidation) {\n continueButton.setAttribute('data-s360-valid', 0);\n\n Customer.addEventListener('validate', (e) => {\n // console.log('customer validate', e, continueButton, continueButton.getAttribute('data-s360-valid'));\n continueButton.setAttribute('disabled', true);\n\n if (e.success) {\n // everything is still valid\n if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n // payment method is already valid -> everything is valid\n if (continueButton.getAttribute('data-s360-valid') == paymentTypeName) {\n continueButton.setAttribute('data-s360-valid', 'all');\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('data-s360-valid', 'customer');\n return;\n }\n\n // only invalidate if the customer was valid before\n if (continueButton.getAttribute('data-s360-valid') == 'customer') {\n continueButton.setAttribute('data-s360-valid', 0);\n } else if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.setAttribute('data-s360-valid', paymentTypeName);\n }\n });\n } else {\n Customer.addEventListener('validate', (e) => {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n }\n\n if (this.settings.isB2B) {\n options.fields = ['companyInfo'];\n // options = {containerId: 'customer'};\n }\n\n if (this.customerId) {\n Customer.update(this.customerId, options);\n return Customer;\n }\n\n Customer.create(options);\n\n return Customer;\n }\n\n /**\n * Hide form fields from unzer ui component because they are already filled by the shop\n * @param {string} paymentMethodName\n */\n hideFormFields(paymentMethodName) {\n const field = $('#customer');\n\n field.find('.field').filter(\n '.city, .company, :has(.country), .street, .zip, .firstname, .lastname'\n ).hide();\n field.find('.salutation-customer').hide();\n field.find('.firstname, .lastname').parent('.fields').hide();\n field.find('.unzerUI.divider-horizontal:eq(0)').hide();\n field.find('.unzerUI.message.downArrow').hide();\n\n if (paymentMethodName) {\n field.find('.field').filter('.checkbox-billingAddress, .email').hide();\n field.find('.field').filter(\n '.billing-name, .billing-street, .billing-zip, .billing-city, :has(.billing-country)'\n ).hide();\n field.find('.unzerUI.form>.checkboxLabel').hide();\n field.find('.unzerUI.form>.salutation-unzer-' + paymentMethodName + '-customer').hide();\n }\n\n field.find('.companyType').on('change', e => this.hideFormFields(paymentMethodName));\n }\n\n /**\n * Create Paylayter Installment Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/unzer-installment-upl/accept-unzer-installment-ui-component/\n * @returns {{createResource: Function}}\n */\n createPaylaterInstallment() {\n this.customerResource = this.createCustomer('paylater-installment', true);\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n const paylaterInstallment = this.unzerInstance.PaylaterInstallment();\n\n this.hideFormFields('paylater-installment');\n\n paylaterInstallment.create({\n containerId: 'paylater-installment',\n amount: this.settings.amount,\n currency: this.settings.currency,\n country: this.settings.country\n });\n\n paylaterInstallment.addEventListener('paylaterInstallmentEvent', (e) => {\n switch (e.currentStep) {\n case 'plan-list':\n continueButton.setAttribute('disabled', true);\n break;\n\n case 'plan-detail':\n continueButton.setAttribute('disabled', false);\n break;\n\n default:\n break;\n }\n\n const isValid = e.action === 'validate' && e.success;\n this.onPaylaterInputValidation(e, isValid, 'paylater-installment', continueButton);\n });\n\n return paylaterInstallment;\n }\n\n /**\n * Create Paylayter Invoice Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/unzer-invoice-upl/accept-unzer-invoice-upl-ui-component/\n * @returns {{createResource: Function}}\n */\n createPaylaterInvoice() {\n this.customerResource = this.createCustomer('paylater-invoice', true);\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n const paylaterInvoice = this.unzerInstance.PaylaterInvoice();\n\n this.hideFormFields('paylater-invoice');\n\n paylaterInvoice.create({\n containerId: 'paylater-invoice',\n customerType: this.settings.isB2B ? 'B2B' : 'B2C'\n });\n\n paylaterInvoice.addEventListener('change', (e) =>\n this.onPaylaterInputValidation(\n e,\n e.success,\n 'paylater-invoice',\n continueButton\n )\n );\n\n return paylaterInvoice;\n }\n\n /**\n * Create Paylayter Invoice Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/direct-debit-secured/accept-direct-debit-secured-ui-component/\n * @returns {{createResource: Function}}\n */\n createPaylaterDirectDebit() {\n this.customerResource = this.createCustomer('paylater-direct-debit', true);\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n const paylaterDirectDebit = this.unzerInstance.PaylaterDirectDebit();\n\n this.hideFormFields('paylater-direct-debit');\n\n paylaterDirectDebit.create('paylater-direct-debit', {\n containerId: 'paylater-direct-debit',\n customerType: this.settings.isB2B ? 'B2B' : 'B2C'\n });\n\n paylaterDirectDebit.addEventListener('change', (e) =>\n this.onPaylaterInputValidation(\n e,\n e.success,\n 'paylater-direct-debit',\n continueButton\n )\n );\n\n return paylaterDirectDebit;\n }\n\n /**\n * Create Bancontact Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/bancontact/accept-bancontact-ui-component/\n * @returns {{createResource: Function}}\n */\n createBancontact() {\n const bancontact = this.unzerInstance.Bancontact();\n const styling = { fontSize: null, fontColor: null, fontFamily: null };\n\n if (this.settings.styling) {\n styling.fontColor = this.settings.styling.fontColor || null;\n styling.fontSize = this.settings.styling.fontSize || null;\n styling.fontFamily = this.settings.styling.fontFamily || null;\n }\n\n bancontact.create('holder', {\n containerId: 'bancontact-holder',\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n\n return bancontact;\n }\n\n /**\n * Create a new Card Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/credit-card-ui-integration\n * @returns {{createResource: Function}} Card Payment Type\n */\n createCard() {\n var Card = this.unzerInstance.Card();\n var styling = {fontSize: null, fontColor: null, fontFamily: null};\n\n if (this.settings.styling) {\n styling.fontColor = this.settings.styling.fontColor || null;\n styling.fontSize = this.settings.styling.fontSize || null;\n styling.fontFamily = this.settings.styling.fontFamily || null;\n }\n\n Card.create('number', {\n containerId: 'card-element-id-number',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n Card.create('expiry', {\n containerId: 'card-element-id-expiry',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n Card.create('cvc', {\n containerId: 'card-element-id-cvc',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n // fontFamily: styling.fontFamily // messes with hidden font in firefox\n });\n Card.create('holder', {\n containerId: 'card-element-id-holder',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n\n // Enable pay button initially\n var formFieldValid = {};\n\n /** @type {HTMLElement} continueButton */\n var continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n Card.addEventListener('change', (e) => {\n if (e.success) {\n formFieldValid[e.type] = true;\n this.errorHandler.hide();\n }\n\n if (e.error) {\n formFieldValid[e.type] = false;\n this.errorHandler.show(e.error);\n }\n\n if (e.reset) {\n formFieldValid[e.type] = false;\n }\n\n if (formFieldValid.number && formFieldValid.expiry && formFieldValid.cvc && formFieldValid.holder) {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n return Card;\n }\n\n /**\n * Create a new Invoice Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/invoice-ui-integration\n * @returns {{createResource: Function}} Invoice Payment Type\n */\n createInvoice() {\n return this.unzerInstance.Invoice();\n }\n\n /**\n * Create a new Invoice Guaranteed Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/invoice-ui-integration\n * @returns {{createResource: Function}} Invoice Payment Type\n */\n createInvoiceGuaranteed() {\n this.customerResource = this.createCustomer();\n\n return this.unzerInstance.InvoiceSecured();\n }\n\n /**\n * Create a new Invoice Factoring Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/invoice-ui-integration\n * @returns {{createResource: Function}} Invoice Payment Type\n */\n createInvoiceFactoring() {\n this.customerResource = this.createCustomer();\n\n return this.unzerInstance.InvoiceSecured();\n }\n\n /**\n * Create a new SEPA Direct Debit Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/sepa-direct-debit-ui-integration\n * @returns {{createResource: Function}} SEPA Direct Debit Payment Type\n */\n createSepa() {\n var Sepa = this.unzerInstance.SepaDirectDebit();\n Sepa.create('sepa-direct-debit', {\n containerId: 'sepa-IBAN'\n });\n\n /** @type {HTMLElement} continueButton */\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n Sepa.addEventListener('change', (e) => {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n this.errorHandler.hide();\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n return Sepa;\n }\n\n /**\n * Create a new SEPA Direct Debit (guaranteed) Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/sepa-direct-debit-ui-integration\n * @returns {{createResource: Function}} SEPA Direct Debit (guaranteed) Payment Type\n */\n createSepaGuaranteed() {\n var SepaGuaranteed = this.unzerInstance.SepaDirectDebitSecured();\n SepaGuaranteed.create('sepa-direct-debit-guaranteed', {\n containerId: 'sepa-guaranteed-IBAN'\n });\n\n /** @type {HTMLElement} continueButton */\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n SepaGuaranteed.addEventListener('change', (e) => {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n this.errorHandler.hide();\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n this.customerResource = this.createCustomer();\n\n return SepaGuaranteed;\n }\n\n /**\n * Create a new PayPal Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/paypal-ui-integration\n * @returns {{createResource: Function}} Papal Payment Type\n */\n createPaypal() {\n var Paypal = this.unzerInstance.Paypal();\n Paypal.create('email', {\n containerId: 'paypal-element-email'\n });\n\n return Paypal;\n }\n\n /**\n * Create a new SOFORT Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#sofort\n * @returns {{createResource: Function}} Sofort Payment Type\n */\n createSofort() {\n return this.unzerInstance.Sofort();\n }\n\n /**\n * Create a new Giropay Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#giropay\n * @returns {{createResource: Function}} Giropay Payment Type\n */\n createGiropay () {\n return this.unzerInstance.Giropay();\n }\n\n /**\n * Create a new Przelewy24 Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#przelewy24\n * @returns {{createResource: Function}} Przelewy24 Payment Type\n */\n createPrzelewy24() {\n return this.unzerInstance.Przelewy24();\n }\n\n /**\n * Create a new iDEAL Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/ideal-ui-integration\n * @returns {{createResource: Function}} iDEAL Payment Type\n */\n createIdeal() {\n var Ideal = this.unzerInstance.Ideal();\n\n Ideal.create('ideal', {\n containerId: 'ideal-element'\n });\n\n /** @type {HTMLElement} continueButton */\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n Ideal.addEventListener('change', (e) => {\n if (e.value) {\n continueButton.removeAttribute('disabled');\n this.errorHandler.hide();\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n return Ideal;\n }\n\n /**\n * Create a new Prepayment Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/prepayment-ui-integration\n * @returns {{createResource: Function}} Prepayment Payment Type\n */\n createPrepayment() {\n return this.unzerInstance.Prepayment();\n }\n\n /**\n * Create a new EPS Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/eps-ui-integration\n * @returns {{createResource: Function}} EPS Payment Type\n */\n createEPS() {\n return this.unzerInstance.EPS();\n }\n\n /**\n * Create a new FlexiPay Direct Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#flexipay-direct\n * @returns {{createResource: Function}} Alipay Payment Type\n */\n createFlexiPayDirect() {\n return this.unzerInstance.FlexiPayDirect();\n }\n\n /**\n * Create a new Alipay Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#alipay\n * @returns {{createResource: Function}} Alipay Payment Type\n */\n createAlipay() {\n return this.unzerInstance.Alipay();\n }\n\n /**\n * Create a new TWINT Payment Type.\n *\n * @see https://docs.unzer.com/payment-methods/twint/accept-twint-ui-component/\n * @returns {{createResource: Function}} Twint Payment Type\n */\n createTwint() {\n return this.unzerInstance.Twint();\n }\n\n /**\n * Create a new Open Banking Payment Type.\n *\n * @returns {{createResource: Function}} Twint Payment Type\n */\n createOpenBanking() {\n return this.unzerInstance.OpenBanking();\n }\n\n /**\n * Create an new WeChat Pay Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#wechat-pay\n * @returns {{createResource: Function}} WeChat Pay Payment Type\n */\n createWeChatPay() {\n return this.unzerInstance.Wechatpay();\n }\n\n /**\n * Create a new Hire Purchase Payment Type.\n *\n * @see https:://docs.heidelpay.com/docs/hire-purchase-ui-integration\n * @returns {{createResource: Function}} Hire Purchase Payment Type\n */\n createHirePurchase() {\n var InstallmentSecured = this.unzerInstance.InstallmentSecured();\n var self = this;\n this.customerResource = this.createCustomer();\n\n /** @type {HTMLElement} continueButton */\n var continueButton = self.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('style', 'display: none');\n continueButton.setAttribute('disabled', true);\n\n InstallmentSecured.create({\n containerId: 'hire-purchase-element',\n amount: this.settings.amount || null,\n currency: this.settings.currency || null,\n effectiveInterest: this.settings.effectiveInterest || null,\n orderDate: this.settings.orderDate || null\n }).then(function (data) {\n // if successful, notify the user that the list of installments was fetched successfully\n // in case you were using a loading element during the fetching process,\n // you can remove it inside this callback function\n })\n .catch(function (response) {\n // sent an error message to the user (fetching installment list failed)\n var msg = '';\n console.error(response.message);\n\n response.error.details.forEach(function(err) {\n console.error('API-Error: ' + err.code);\n msg += err.customerMessage;\n });\n\n self.errorHandler.show(msg);\n });\n\n\n // Listen to UI events\n InstallmentSecured.addEventListener('installmentSecuredEvent', function (e) {\n if (e.action === 'validate') {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n }\n\n if (e.action === 'change-step') {\n if (e.currentSteep === 'plan-list') {\n continueButton.setAttribute('style', 'display: none');\n continueButton.setAttribute('disabled', true);\n return;\n }\n\n continueButton.setAttribute('style', 'display: inline-block');\n }\n });\n\n return InstallmentSecured;\n }\n}\n", "import ErrorHandler from \"../utils/errors\";\n\nexport default class GooglePay\n{\n /**\n * @param {string} pubKey\n * @param {GooglePaySettings} settings\n */\n constructor(pubKey, settings) {\n /** @type {GooglePaySettings} */\n this.settings = settings || {};\n\n /** @type {HTMLFormElement} */\n this.form = this.settings.form || document.getElementById('complete_order');\n\n const options = {\n locale: this.settings.locale || 'de-DE'\n };\n\n this.unzerInstance = new unzer(pubKey, options);\n this.errorHandler = new ErrorHandler(this.settings.$errorContainer, this.settings.$errorMessage);\n\n this.createPaymentTypeResource();\n }\n\n createPaymentTypeResource() {\n // Creating a Google Pay instance\n const googlepayInstance = this.unzerInstance.Googlepay();\n\n const paymentData = googlepayInstance.initPaymentDataRequestObject({\n gatewayMerchantId: this.settings.googlepay.gatewayMerchantId,\n merchantInfo: this.settings.googlepay.merchantInfo,\n transactionInfo: this.settings.googlepay.transactionInfo,\n allowedCardNetworks: this.settings.googlepay.allowedCardNetworks,\n allowCreditCards: this.settings.googlepay.allowCreditCards,\n allowPrepaidCards: this.settings.googlepay.allowPrepaidCards,\n buttonOptions: {\n buttonColor: this.settings.googlepay.buttonOptions.buttonColor,\n buttonSizeMode: this.settings.googlepay.buttonOptions.buttonSize,\n },\n onPaymentAuthorizedCallback: (paymentData) => googlepayInstance.createResource(paymentData)\n .then(this.onAuthorizedSuccess.bind(this))\n .catch(this.onAuthorizedFailed.bind(this))\n });\n\n googlepayInstance.create(\n { containerId: 'googlepay-holder' },\n paymentData\n );\n }\n\n /**\n * @param {{id: string}} result\n * @returns {{ status: string }}\n */\n onAuthorizedSuccess(result) {\n // Submit the ID to your server-side integration\n const hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'unzer-payment-type-id');\n hiddenInput.setAttribute('value', result.id);\n\n this.form.appendChild(hiddenInput);\n this.form.submit();\n\n return { status: 'success' };\n }\n\n /**\n * @param {{customerMessage?: string, message?: string, data?: {errors?: Array<{customerMessage?: string}>}}} error\n * @returns {{ status: string, message: string }}\n */\n onAuthorizedFailed(error) {\n let errorMessage = error.customerMessage || error.message || 'Error';\n if (error.data && Array.isArray(error.data.errors) && error.data.errors[0]) {\n errorMessage = error.data.errors[0].customerMessage || 'Error';\n }\n\n this.errorHandler.show(errorMessage);\n\n return {\n status: 'error',\n message: errorMessage || 'Unexpected error'\n };\n }\n}", "/**\n * Heidelpay Installment Modal Window Handler\n *\n * @param {string} modalSelector\n * @param {HTMLElement} btn Submit Trigger\n * @param {JQuery} $form\n */\nconst Installment = (modalSelector, btn, $form) => {\n var modal = $(modalSelector);\n\n btn.addEventListener('click', function () {\n $form.trigger('submit');\n });\n\n $form.on('submit', function (e) {\n if (!modal.is(':visible')) {\n e.preventDefault();\n modal.modal('show');\n return false;\n }\n\n return true;\n });\n};\n\nexport default Installment;", "export default class Debugging {\n constructor($container) {\n this.$container = $container;\n this.$log = null;\n\n if (!window.UNZER_DEBUG) {\n return;\n }\n\n this.createLogTemplate();\n }\n\n log(context, data = {}) {\n if (!window.UNZER_DEBUG) {\n return;\n }\n\n if (!this.$log) {\n this.createLogTemplate();\n }\n\n this.$log.append(\n '
  • ' + context + '
    ' + JSON.stringify(data,  null, '  ') +  '
  • '\n );\n }\n\n createLogTemplate() {\n this.$container.append(\n $('
    ')\n );\n this.$log = this.$container.find('.debug-log > ul');\n }\n}\n", diff --git a/frontend/js/unzer.min.js b/frontend/js/unzer.min.js index 5da8526..b8be71e 100644 --- a/frontend/js/unzer.min.js +++ b/frontend/js/unzer.min.js @@ -1,2 +1,2 @@ -!function(){function e(t,n,i){function r(s,o){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!o&&l)return l(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){return r(t[s][1][e]||e)},c,c.exports,e,t,n,i)}return n[s].exports}for(var a="function"==typeof require&&require,s=0;s Init Payment Type]",{paymentRequest:this.applePayPaymentRequest}),n.onvalidatemerchant=function(e){t.merchantValidationCallback(e,n)},n.onpaymentauthorized=function(e){t.applePayAuthorizedCallback(e,n)},n.oncancel=function(e){t.debugging.log("[> Cancel]",{event:e}),t.errorHandler.show(t.snippets.CANCEL_BY_USER)},n.begin()}else this.unsupportedDevice()}},{key:"merchantValidationCallback",value:function(e,t){var n=this,i=JSON.stringify(e.validationURL);this.debugging.log("[> Merchant Validation]",{event:e}),$.ajax({url:$.evo.io().options.ioUrl,method:"POST",dataType:"json",data:'io={"name":"apple_pay_merchantvalidation", "params":['+i+"]}"}).done(function(e){n.debugging.log("[> Merchant Validation Response]",e);try{t.completeMerchantValidation(e)}catch(e){alert(e.message)}}).fail(function(e){n.debugging.log("[> Merchant Validation Error]",e),n.errorHandler.show(JSON.stringify(e.statusText)),t.abort()})}},{key:"applePayAuthorizedCallback",value:function(e,t){var n=this,i=this.unzerInstance.ApplePay(),r=e.payment.token.paymentData;this.debugging.log("[> Payment Authorization]",{unzerApplePayInstance:i,event:e,paymentData:r}),i.createResource(r).then(function(e){var i=JSON.stringify(e.id);$.ajax({url:$.evo.io().options.ioUrl,method:"POST",dataType:"json",data:'io={"name":"apple_pay_payment_authorized", "params":['+i+"]}"}).done(function(e){n.debugging.log("[> Payment Authorization Response]",{result:e,typeId:i});var r=e.transactionStatus;if("success"===r||"pending"===r){t.completePayment({status:window.ApplePaySession.STATUS_SUCCESS});var a=document.createElement("input");a.setAttribute("type","hidden"),a.setAttribute("name","paymentData[resourceId]"),a.setAttribute("value",i),n.form.appendChild(a),n.form.removeEventListener("submit",n.initPaymentType),n.form.submit()}else n.abortPaymentSession(t)}).fail(function(e){n.errorHandler.show(e.statusText),n.abortPaymentSession(t)})}).catch(function(e){n.debugging.log("[> Payment Authorization Error]",e),n.errorHandler.show(e.message),n.abortPaymentSession(t)})}},{key:"unsupportedDevice",value:function(){this.settings.submitButton.disabled=!0,this.settings.submitButton.ariaDisabled=!0,this.errorHandler.show(this.snippets.NOT_SUPPORTED)}},{key:"abortPaymentSession",value:function(e){this.debugging.log("[> Abort Payment Session]",{status:window.ApplePaySession.STATUS_FAILURE}),e.completePayment({status:window.ApplePaySession.STATUS_FAILURE}),e.abort()}}]),e}();n.default=u},{"../utils/debugging":7,"../utils/errors":8,"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/createClass":13,"@babel/runtime/helpers/interopRequireDefault":15}],3:[function(e,t,n){"use strict";function i(e,t){a(e,t),t.add(e)}function r(e,t,n){a(e,t),t.set(e,n)}function a(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function s(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function o(e,t,n){var i=this,r=e.payment.token.paymentData;(0,m.default)(this,g).log("[> Payment Authorization]",{applePayInstance:t,event:e,paymentData:r}),t.createResource(r).then(function(e){(0,m.default)(i,g).log("[> Payment Authorization Resource]",{createdResource:e}),n.completePayment({status:window.ApplePaySession.STATUS_SUCCESS});var t=JSON.stringify(e.id),r=document.createElement("input");r.setAttribute("type","hidden"),r.setAttribute("name","unzer-payment-type-id"),r.setAttribute("value",t),i.form.appendChild(r),i.form.removeEventListener("submit",i.initPaymentType),i.form.submit()}).catch(function(e){(0,m.default)(i,g).log("[> Payment Authorization Error]",e),(0,m.default)(i,v).show(e.message),s(i,A,l).call(i,n)})}function l(e){(0,m.default)(this,g).log("[> Abort Payment Session]",{status:window.ApplePaySession.STATUS_FAILURE}),e.completePayment({status:window.ApplePaySession.STATUS_FAILURE}),e.abort()}function u(){(0,m.default)(this,v).show(this.snippets.NOT_SUPPORTED),console.error(this.snippets.NOT_SUPPORTED)}var c=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var d=c(e("@babel/runtime/helpers/classCallCheck")),p=c(e("@babel/runtime/helpers/createClass")),h=c(e("@babel/runtime/helpers/defineProperty")),m=c(e("@babel/runtime/helpers/classPrivateFieldGet")),y=c(e("../utils/errors")),f=c(e("../utils/debugging")),b={NOT_SUPPORTED:"This device does not support Apple Pay!",CANCEL_BY_USER:"Canceled payment process by user!"},v=new WeakMap,g=new WeakMap,P=new WeakSet,A=new WeakSet,E=new WeakSet,I=function(){function e(t,n,a,o){(0,d.default)(this,e),i(this,E),i(this,A),i(this,P),(0,h.default)(this,"settings",void 0),(0,h.default)(this,"snippets",void 0),(0,h.default)(this,"form",void 0),(0,h.default)(this,"applePayPaymentRequest",void 0),r(this,v,{writable:!0,value:new y.default}),r(this,g,{writable:!0,value:new f.default($(".unzerUI"))}),this.settings=o,this.snippets=Object.assign(b,a),this.form=this.settings.form||document.getElementById("complete_order"),this.applePayPaymentRequest=n,this.unzerInstance=new unzer(t,{locale:this.settings.locale||"de-DE"}),window.UNZER_DEBUG=!!this.unzerInstance._isSandbox||this.unzerInstance.config.hasSandboxKey,window.ApplePaySession&&window.ApplePaySession.canMakePayments()?(this.initPaymentType=this.initPaymentType.bind(this),this.form.addEventListener("submit",this.initPaymentType),$(".apple-pay-button").on("click",this.initPaymentType.bind(this))):s(this,E,u).call(this)}return(0,p.default)(e,[{key:"initPaymentType",value:function(e){var t=this;e.preventDefault();var n=this.unzerInstance.ApplePay(),i=n.initApplePaySession(this.applePayPaymentRequest);(0,m.default)(this,g).log("[> Init Payment Type]",{paymentRequest:this.applePayPaymentRequest}),window.ApplePaySession&&window.ApplePaySession.canMakePayments()?(i.onpaymentauthorized=function(e){s(t,P,o).call(t,e,n,i)},i.oncancel=function(e){(0,m.default)(t,g).log("[> Cancel]",{event:e}),(0,m.default)(t,v).show(t.snippets.CANCEL_BY_USER)},i.begin()):s(this,E,u).call(this)}}]),e}();n.default=I},{"../utils/debugging":7,"../utils/errors":8,"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/classPrivateFieldGet":12,"@babel/runtime/helpers/createClass":13,"@babel/runtime/helpers/defineProperty":14,"@babel/runtime/helpers/interopRequireDefault":15}],4:[function(e,t,n){"use strict";var i=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("@babel/runtime/helpers/classCallCheck")),a=i(e("@babel/runtime/helpers/createClass")),s=i(e("@babel/runtime/helpers/defineProperty")),o=i(e("../utils/errors")),l=function(){function e(t,n,i){(0,r.default)(this,e),this.settings=i||{};var a={locale:this.settings.locale||"de-DE"};this.unzerInstance=new unzer(t,a),this.errorHandler=new o.default(this.settings.$errorContainer,this.settings.$errorMessage),this.customerId=i.customerId||null,this.customerResource=null,this.paymentType=this.initPaymentType(n),this.form=this.settings.form||document.getElementById("form_payment_extra"),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.form.addEventListener("submit",this.handleFormSubmit),this.settings.autoSubmit&&this.handleFormSubmit(new Event("submit"))}return(0,a.default)(e,[{key:"initPaymentType",value:function(t){switch(t){case e.PAYMENT_TYPES.CARD:return this.createCard();case e.PAYMENT_TYPES.INVOICE:return this.createInvoice();case e.PAYMENT_TYPES.INVOICE_GUARANTEED:return this.createInvoiceGuaranteed();case e.PAYMENT_TYPES.INVOICE_FACTORING:return this.createInvoiceFactoring();case e.PAYMENT_TYPES.SEPA:return this.createSepa();case e.PAYMENT_TYPES.SEPA_GUARANTEED:return this.createSepaGuaranteed();case e.PAYMENT_TYPES.PAYPAL:return this.createPaypal();case e.PAYMENT_TYPES.SOFORT:return this.createSofort();case e.PAYMENT_TYPES.GIROPAY:return this.createGiropay();case e.PAYMENT_TYPES.PRZELEWY24:return this.createPrzelewy24();case e.PAYMENT_TYPES.IDEAL:return this.createIdeal();case e.PAYMENT_TYPES.PREPAYMENT:return this.createPrepayment();case e.PAYMENT_TYPES.EPS:return this.createEPS();case e.PAYMENT_TYPES.FLEXIPAY_DIRECT:return this.createFlexiPayDirect();case e.PAYMENT_TYPES.ALIPAY:return this.createAlipay();case e.PAYMENT_TYPES.TWINT:return this.createTwint();case e.PAYMENT_TYPES.WECHAT_PAY:return this.createWeChatPay();case e.PAYMENT_TYPES.HIRE_PURCHASE:return this.createHirePurchase();case e.PAYMENT_TYPES.PAYLATER_INVOICE:return this.createPaylaterInvoice();case e.PAYMENT_TYPES.BANCONTACT:return this.createBancontact();case e.PAYMENT_TYPES.PAYLATER_INSTALLMENT:return this.createPaylaterInstallment();case e.PAYMENT_TYPES.PAYLATER_DIRECT_DEBIT:return this.createPaylaterDirectDebit();case e.PAYMENT_TYPES.OPEN_BANKING:return this.createOpenBanking();default:throw new Error("Unkown Payment Type: "+t)}}},{key:"handleFormSubmit",value:function(e){var t=this;e.preventDefault();var n=[this.paymentType.createResource()];this.customerResource&&n.push(this.customerId?this.customerResource.updateCustomer():this.customerResource.createCustomer()),Promise.all(n).then(function(e){var n=document.createElement("input");if(n.setAttribute("type","hidden"),n.setAttribute("name","paymentData[resourceId]"),n.setAttribute("value",e[0].id),t.form.appendChild(n),e.length>=2){var i=document.createElement("input");i.setAttribute("type","hidden"),i.setAttribute("name","paymentData[customerId]"),i.setAttribute("value",e[1].id),t.form.appendChild(i)}t.form.removeEventListener("submit",t.handleFormSubmit),t.form.submit()}).catch(function(e){t.errorHandler.show(e.message)})}},{key:"onPaylaterInputValidation",value:function(e,t,n,i){if(t)return"all"==i.getAttribute("data-s360-valid")?void i.removeAttribute("disabled"):"customer"==i.getAttribute("data-s360-valid")?(i.setAttribute("data-s360-valid","all"),void i.removeAttribute("disabled")):void i.setAttribute("data-s360-valid",n);i.setAttribute("disabled",!0),i.getAttribute("data-s360-valid")==n?i.setAttribute("data-s360-valid",0):"all"==i.getAttribute("data-s360-valid")&&i.setAttribute("data-s360-valid","customer")}},{key:"createCustomer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.settings.isB2B?this.unzerInstance.B2BCustomer():this.unzerInstance.Customer(),i=this.settings.customer||{},r=this.settings.submitButton||document.getElementById("submit-button"),a={containerId:"customer",showInfoBox:!1,showHeader:!1,fields:["name","birthdate"]};return e&&(a.paymentTypeName=e),n.initFormFields(i),t?(r.setAttribute("data-s360-valid",0),n.addEventListener("validate",function(t){if(r.setAttribute("disabled",!0),t.success)return"all"==r.getAttribute("data-s360-valid")?void r.removeAttribute("disabled"):r.getAttribute("data-s360-valid")==e?(r.setAttribute("data-s360-valid","all"),void r.removeAttribute("disabled")):void r.setAttribute("data-s360-valid","customer");"customer"==r.getAttribute("data-s360-valid")?r.setAttribute("data-s360-valid",0):"all"==r.getAttribute("data-s360-valid")&&r.setAttribute("data-s360-valid",e)})):n.addEventListener("validate",function(e){e.success?r.removeAttribute("disabled"):r.setAttribute("disabled",!0)}),this.settings.isB2B&&(a.fields=["companyInfo"]),this.customerId?(n.update(this.customerId,a),n):(n.create(a),n)}},{key:"hideFormFields",value:function(e){var t=$("#customer");t.find(".field").filter(".city, .company, :has(.country), .street, .zip, .firstname, .lastname").hide(),t.find(".salutation-customer").hide(),t.find(".firstname, .lastname").parent(".fields").hide(),t.find(".unzerUI.divider-horizontal:eq(0)").hide(),t.find(".unzerUI.message.downArrow").hide(),e&&(t.find(".field").filter(".checkbox-billingAddress, .email").hide(),t.find(".field").filter(".billing-name, .billing-street, .billing-zip, .billing-city, :has(.billing-country)").hide(),t.find(".unzerUI.form>.checkboxLabel").hide(),t.find(".unzerUI.form>.salutation-unzer-"+e+"-customer").hide())}},{key:"createPaylaterInstallment",value:function(){var e=this;this.customerResource=this.createCustomer("paylater-installment",!0);var t=this.settings.submitButton||document.getElementById("submit-button"),n=this.unzerInstance.PaylaterInstallment();return this.hideFormFields("paylater-installment"),n.create({containerId:"paylater-installment",amount:this.settings.amount,currency:this.settings.currency,country:this.settings.country}),n.addEventListener("paylaterInstallmentEvent",function(n){switch(n.currentStep){case"plan-list":t.setAttribute("disabled",!0);break;case"plan-detail":t.setAttribute("disabled",!1)}var i="validate"===n.action&&n.success;e.onPaylaterInputValidation(n,i,"paylater-installment",t)}),n}},{key:"createPaylaterInvoice",value:function(){var e=this;this.customerResource=this.createCustomer("paylater-invoice",!0);var t=this.settings.submitButton||document.getElementById("submit-button"),n=this.unzerInstance.PaylaterInvoice();return this.hideFormFields("paylater-invoice"),n.create({containerId:"paylater-invoice",customerType:this.settings.isB2B?"B2B":"B2C"}),n.addEventListener("change",function(n){return e.onPaylaterInputValidation(n,n.success,"paylater-invoice",t)}),n}},{key:"createPaylaterDirectDebit",value:function(){var e=this;this.customerResource=this.createCustomer("paylater-direct-debit",!0);var t=this.settings.submitButton||document.getElementById("submit-button"),n=this.unzerInstance.PaylaterDirectDebit();return this.hideFormFields("paylater-direct-debit"),n.create("paylater-direct-debit",{containerId:"paylater-direct-debit",customerType:this.settings.isB2B?"B2B":"B2C"}),n.addEventListener("change",function(n){return e.onPaylaterInputValidation(n,n.success,"paylater-direct-debit",t)}),n}},{key:"createBancontact",value:function(){var e=this.unzerInstance.Bancontact(),t={fontSize:null,fontColor:null,fontFamily:null};return this.settings.styling&&(t.fontColor=this.settings.styling.fontColor||null,t.fontSize=this.settings.styling.fontSize||null,t.fontFamily=this.settings.styling.fontFamily||null),e.create("holder",{containerId:"bancontact-holder",fontSize:t.fontSize,fontColor:t.fontColor,fontFamily:t.fontFamily}),e}},{key:"createCard",value:function(){var e=this,t=this.unzerInstance.Card(),n={fontSize:null,fontColor:null,fontFamily:null};this.settings.styling&&(n.fontColor=this.settings.styling.fontColor||null,n.fontSize=this.settings.styling.fontSize||null,n.fontFamily=this.settings.styling.fontFamily||null),t.create("number",{containerId:"card-element-id-number",onlyIframe:!1,fontSize:n.fontSize,fontColor:n.fontColor,fontFamily:n.fontFamily}),t.create("expiry",{containerId:"card-element-id-expiry",onlyIframe:!1,fontSize:n.fontSize,fontColor:n.fontColor,fontFamily:n.fontFamily}),t.create("cvc",{containerId:"card-element-id-cvc",onlyIframe:!1,fontSize:n.fontSize,fontColor:n.fontColor}),t.create("holder",{containerId:"card-element-id-holder",onlyIframe:!1,fontSize:n.fontSize,fontColor:n.fontColor,fontFamily:n.fontFamily});var i={},r=this.settings.submitButton||document.getElementById("submit-button");return r.setAttribute("disabled",!0),t.addEventListener("change",function(t){t.success&&(i[t.type]=!0,e.errorHandler.hide()),t.error&&(i[t.type]=!1,e.errorHandler.show(t.error)),t.reset&&(i[t.type]=!1),i.number&&i.expiry&&i.cvc&&i.holder?r.removeAttribute("disabled"):r.setAttribute("disabled",!0)}),t}},{key:"createInvoice",value:function(){return this.unzerInstance.Invoice()}},{key:"createInvoiceGuaranteed",value:function(){return this.customerResource=this.createCustomer(),this.unzerInstance.InvoiceSecured()}},{key:"createInvoiceFactoring",value:function(){return this.customerResource=this.createCustomer(),this.unzerInstance.InvoiceSecured()}},{key:"createSepa",value:function(){var e=this,t=this.unzerInstance.SepaDirectDebit();t.create("sepa-direct-debit",{containerId:"sepa-IBAN"});var n=this.settings.submitButton||document.getElementById("submit-button");return n.setAttribute("disabled",!0),t.addEventListener("change",function(t){if(t.success)return n.removeAttribute("disabled"),void e.errorHandler.hide();n.setAttribute("disabled",!0)}),t}},{key:"createSepaGuaranteed",value:function(){var e=this,t=this.unzerInstance.SepaDirectDebitSecured();t.create("sepa-direct-debit-guaranteed",{containerId:"sepa-guaranteed-IBAN"});var n=this.settings.submitButton||document.getElementById("submit-button");return n.setAttribute("disabled",!0),t.addEventListener("change",function(t){if(t.success)return n.removeAttribute("disabled"),void e.errorHandler.hide();n.setAttribute("disabled",!0)}),this.customerResource=this.createCustomer(),t}},{key:"createPaypal",value:function(){var e=this.unzerInstance.Paypal();return e.create("email",{containerId:"paypal-element-email"}),e}},{key:"createSofort",value:function(){return this.unzerInstance.Sofort()}},{key:"createGiropay",value:function(){return this.unzerInstance.Giropay()}},{key:"createPrzelewy24",value:function(){return this.unzerInstance.Przelewy24()}},{key:"createIdeal",value:function(){var e=this,t=this.unzerInstance.Ideal();t.create("ideal",{containerId:"ideal-element"});var n=this.settings.submitButton||document.getElementById("submit-button");return n.setAttribute("disabled",!0),t.addEventListener("change",function(t){if(t.value)return n.removeAttribute("disabled"),void e.errorHandler.hide();n.setAttribute("disabled",!0)}),t}},{key:"createPrepayment",value:function(){return this.unzerInstance.Prepayment()}},{key:"createEPS",value:function(){return this.unzerInstance.EPS()}},{key:"createFlexiPayDirect",value:function(){return this.unzerInstance.FlexiPayDirect()}},{key:"createAlipay",value:function(){return this.unzerInstance.Alipay()}},{key:"createTwint",value:function(){return this.unzerInstance.Twint()}},{key:"createOpenBanking",value:function(){return this.unzerInstance.OpenBanking()}},{key:"createWeChatPay",value:function(){return this.unzerInstance.Wechatpay()}},{key:"createHirePurchase",value:function(){var e=this.unzerInstance.InstallmentSecured(),t=this;this.customerResource=this.createCustomer();var n=t.settings.submitButton||document.getElementById("submit-button");return n.setAttribute("style","display: none"),n.setAttribute("disabled",!0),e.create({containerId:"hire-purchase-element",amount:this.settings.amount||null,currency:this.settings.currency||null,effectiveInterest:this.settings.effectiveInterest||null,orderDate:this.settings.orderDate||null}).then(function(e){}).catch(function(e){var n="";console.error(e.message),e.error.details.forEach(function(e){console.error("API-Error: "+e.code),n+=e.customerMessage}),t.errorHandler.show(n)}),e.addEventListener("installmentSecuredEvent",function(e){if("validate"===e.action){if(e.success)return void n.removeAttribute("disabled");n.setAttribute("disabled",!0)}if("change-step"===e.action){if("plan-list"===e.currentSteep)return n.setAttribute("style","display: none"),void n.setAttribute("disabled",!0);n.setAttribute("style","display: inline-block")}}),e}}]),e}();n.default=l,(0,s.default)(l,"PAYMENT_TYPES",{ALIPAY:"Alipay",CARD:"Card",EPS:"EPS",FLEXIPAY_DIRECT:"FlexiPay Direct",HIRE_PURCHASE:"Hire Purchase",PAYPAL:"Paypal",INVOICE:"Invoice",INVOICE_FACTORING:"Invoice Factoring",INVOICE_GUARANTEED:"Invoice Guaranteed",SEPA:"SEPA",SEPA_GUARANTEED:"SEPA (guaranteed)",SOFORT:"SOFORT",GIROPAY:"Giropay",PRZELEWY24:"Przelewy24",IDEAL:"iDEAL",PREPAYMENT:"Prepayment",WECHAT_PAY:"WeChat Pay",PAYLATER_INVOICE:"Paylater Invoice",BANCONTACT:"Bancontact",PAYLATER_INSTALLMENT:"Paylater Installment",PAYLATER_DIRECT_DEBIT:"Paylater Direct Debit",TWINT:"Twint",OPEN_BANKING:"Open Banking"})},{"../utils/errors":8,"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/createClass":13,"@babel/runtime/helpers/defineProperty":14,"@babel/runtime/helpers/interopRequireDefault":15}],5:[function(e,t,n){"use strict";var i=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("@babel/runtime/helpers/classCallCheck")),a=i(e("@babel/runtime/helpers/createClass")),s=i(e("../utils/errors")),o=function(){function e(t,n){(0,r.default)(this,e),this.settings=n||{},this.form=this.settings.form||document.getElementById("complete_order");var i={locale:this.settings.locale||"de-DE"};this.unzerInstance=new unzer(t,i),this.errorHandler=new s.default(this.settings.$errorContainer,this.settings.$errorMessage),this.createPaymentTypeResource()}return(0,a.default)(e,[{key:"createPaymentTypeResource",value:function(){var e=this,t=this.unzerInstance.Googlepay(),n=t.initPaymentDataRequestObject({gatewayMerchantId:this.settings.googlepay.gatewayMerchantId,merchantInfo:this.settings.googlepay.merchantInfo,transactionInfo:this.settings.googlepay.transactionInfo,allowedCardNetworks:this.settings.googlepay.allowedCardNetworks,allowCreditCards:this.settings.googlepay.allowCreditCards,allowPrepaidCards:this.settings.googlepay.allowPrepaidCards,buttonOptions:{buttonColor:this.settings.googlepay.buttonOptions.buttonColor,buttonSizeMode:this.settings.googlepay.buttonOptions.buttonSize},onPaymentAuthorizedCallback:function(n){return t.createResource(n).then(e.onAuthorizedSuccess.bind(e)).catch(e.onAuthorizedFailed.bind(e))}});t.create({containerId:"googlepay-holder"},n)}},{key:"onAuthorizedSuccess",value:function(e){var t=document.createElement("input");return t.setAttribute("type","hidden"),t.setAttribute("name","unzer-payment-type-id"),t.setAttribute("value",e.id),this.form.appendChild(t),this.form.submit(),{status:"success"}}},{key:"onAuthorizedFailed",value:function(e){var t=e.customerMessage||e.message||"Error";return e.data&&Array.isArray(e.data.errors)&&e.data.errors[0]&&(t=e.data.errors[0].customerMessage||"Error"),this.errorHandler.show(t),{status:"error",message:t||"Unexpected error"}}}]),e}();n.default=o},{"../utils/errors":8,"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/createClass":13,"@babel/runtime/helpers/interopRequireDefault":15}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(e,t,n){var i=$(e);t.addEventListener("click",function(){n.trigger("submit")}),n.on("submit",function(e){return!!i.is(":visible")||(e.preventDefault(),i.modal("show"),!1)})}},{}],7:[function(e,t,n){"use strict";var i=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("@babel/runtime/helpers/classCallCheck")),a=i(e("@babel/runtime/helpers/createClass")),s=function(){function e(t){(0,r.default)(this,e),this.$container=t,this.$log=null,window.UNZER_DEBUG&&this.createLogTemplate()}return(0,a.default)(e,[{key:"log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};window.UNZER_DEBUG&&(this.$log||this.createLogTemplate(),this.$log.append("
  • "+e+"
    "+JSON.stringify(t,null,"  ")+"
  • "))}},{key:"createLogTemplate",value:function(){this.$container.append($('
      ')),this.$log=this.$container.find(".debug-log > ul")}}]),e}();n.default=s},{"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/createClass":13,"@babel/runtime/helpers/interopRequireDefault":15}],8:[function(e,t,n){"use strict";var i=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("@babel/runtime/helpers/classCallCheck")),a=i(e("@babel/runtime/helpers/createClass")),s=function(){function e(t,n){(0,r.default)(this,e),this.$wrapper=t||$("#error-container"),this.$holder=n||this.$wrapper.find(".alert")}return(0,a.default)(e,[{key:"show",value:function(e){this.$wrapper.show(),this.$holder.html(e)}},{key:"hide",value:function(){this.$wrapper.hide(),this.$holder.html()}}]),e}();n.default=s},{"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/createClass":13,"@babel/runtime/helpers/interopRequireDefault":15}],9:[function(e,t,n){t.exports=function(e,t){return t.get?t.get.call(e):t.value},t.exports.__esModule=!0,t.exports.default=t.exports},{}],10:[function(e,t,n){t.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},{}],11:[function(e,t,n){t.exports=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)},t.exports.__esModule=!0,t.exports.default=t.exports},{}],12:[function(e,t,n){var i=e("./classApplyDescriptorGet.js"),r=e("./classExtractFieldDescriptor.js");t.exports=function(e,t){var n=r(e,t,"get");return i(e,n)},t.exports.__esModule=!0,t.exports.default=t.exports},{"./classApplyDescriptorGet.js":9,"./classExtractFieldDescriptor.js":11}],13:[function(e,t,n){function i(e,t){for(var n=0;n Init Payment Type]",{paymentRequest:this.applePayPaymentRequest}),n.onvalidatemerchant=function(e){t.merchantValidationCallback(e,n)},n.onpaymentauthorized=function(e){t.applePayAuthorizedCallback(e,n)},n.oncancel=function(e){t.debugging.log("[> Cancel]",{event:e}),t.errorHandler.show(t.snippets.CANCEL_BY_USER)},n.begin()}else this.unsupportedDevice()}},{key:"merchantValidationCallback",value:function(e,t){var n=this,i=JSON.stringify(e.validationURL);this.debugging.log("[> Merchant Validation]",{event:e}),$.ajax({url:$.evo.io().options.ioUrl,method:"POST",dataType:"json",data:'io={"name":"apple_pay_merchantvalidation", "params":['+i+"]}"}).done(function(e){n.debugging.log("[> Merchant Validation Response]",e);try{t.completeMerchantValidation(e)}catch(e){alert(e.message)}}).fail(function(e){n.debugging.log("[> Merchant Validation Error]",e),n.errorHandler.show(JSON.stringify(e.statusText)),t.abort()})}},{key:"applePayAuthorizedCallback",value:function(e,t){var n=this,i=this.unzerInstance.ApplePay(),r=e.payment.token.paymentData;this.debugging.log("[> Payment Authorization]",{unzerApplePayInstance:i,event:e,paymentData:r}),i.createResource(r).then(function(e){var i=JSON.stringify(e.id);$.ajax({url:$.evo.io().options.ioUrl,method:"POST",dataType:"json",data:'io={"name":"apple_pay_payment_authorized", "params":['+i+"]}"}).done(function(e){n.debugging.log("[> Payment Authorization Response]",{result:e,typeId:i});var r=e.transactionStatus;if("success"===r||"pending"===r){t.completePayment({status:window.ApplePaySession.STATUS_SUCCESS});var a=document.createElement("input");a.setAttribute("type","hidden"),a.setAttribute("name","paymentData[resourceId]"),a.setAttribute("value",i),n.form.appendChild(a),n.form.removeEventListener("submit",n.initPaymentType),n.form.submit()}else n.abortPaymentSession(t)}).fail(function(e){n.errorHandler.show(e.statusText),n.abortPaymentSession(t)})}).catch(function(e){n.debugging.log("[> Payment Authorization Error]",e),n.errorHandler.show(e.message),n.abortPaymentSession(t)})}},{key:"unsupportedDevice",value:function(){this.settings.submitButton.disabled=!0,this.settings.submitButton.ariaDisabled=!0,this.errorHandler.show(this.snippets.NOT_SUPPORTED)}},{key:"abortPaymentSession",value:function(e){this.debugging.log("[> Abort Payment Session]",{status:window.ApplePaySession.STATUS_FAILURE}),e.completePayment({status:window.ApplePaySession.STATUS_FAILURE}),e.abort()}}]),e}();n.default=u},{"../utils/debugging":7,"../utils/errors":8,"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/createClass":13,"@babel/runtime/helpers/interopRequireDefault":15}],3:[function(e,t,n){"use strict";function i(e,t){a(e,t),t.add(e)}function r(e,t,n){a(e,t),t.set(e,n)}function a(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function s(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function o(e,t,n){var i=this,r=e.payment.token.paymentData;(0,m.default)(this,g).log("[> Payment Authorization]",{applePayInstance:t,event:e,paymentData:r}),t.createResource(r).then(function(e){(0,m.default)(i,g).log("[> Payment Authorization Resource]",{createdResource:e}),n.completePayment({status:window.ApplePaySession.STATUS_SUCCESS});var t=JSON.stringify(e.id),r=document.createElement("input");r.setAttribute("type","hidden"),r.setAttribute("name","unzer-payment-type-id"),r.setAttribute("value",t),i.form.appendChild(r),i.form.removeEventListener("submit",i.initPaymentType),i.form.submit()}).catch(function(e){(0,m.default)(i,g).log("[> Payment Authorization Error]",e),(0,m.default)(i,v).show(e.message),s(i,A,l).call(i,n)})}function l(e){(0,m.default)(this,g).log("[> Abort Payment Session]",{status:window.ApplePaySession.STATUS_FAILURE}),e.completePayment({status:window.ApplePaySession.STATUS_FAILURE}),e.abort()}function u(){(0,m.default)(this,v).show(this.snippets.NOT_SUPPORTED),console.error(this.snippets.NOT_SUPPORTED)}var c=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var d=c(e("@babel/runtime/helpers/classCallCheck")),p=c(e("@babel/runtime/helpers/createClass")),h=c(e("@babel/runtime/helpers/defineProperty")),m=c(e("@babel/runtime/helpers/classPrivateFieldGet")),y=c(e("../utils/errors")),f=c(e("../utils/debugging")),b={NOT_SUPPORTED:"This device does not support Apple Pay!",CANCEL_BY_USER:"Canceled payment process by user!"},v=new WeakMap,g=new WeakMap,P=new WeakSet,A=new WeakSet,E=new WeakSet,I=function(){function e(t,n,a,o){(0,d.default)(this,e),i(this,E),i(this,A),i(this,P),(0,h.default)(this,"settings",void 0),(0,h.default)(this,"snippets",void 0),(0,h.default)(this,"form",void 0),(0,h.default)(this,"applePayPaymentRequest",void 0),r(this,v,{writable:!0,value:new y.default}),r(this,g,{writable:!0,value:new f.default($(".unzerUI"))}),this.settings=o,this.snippets=Object.assign(b,a),this.form=this.settings.form||document.getElementById("complete_order"),this.applePayPaymentRequest=n,this.unzerInstance=new unzer(t,{locale:this.settings.locale||"de-DE"}),window.UNZER_DEBUG=!!this.unzerInstance._isSandbox||this.unzerInstance.config.hasSandboxKey,window.ApplePaySession&&window.ApplePaySession.canMakePayments()?(this.initPaymentType=this.initPaymentType.bind(this),this.form.addEventListener("submit",this.initPaymentType),$(".apple-pay-button").on("click",this.initPaymentType.bind(this))):s(this,E,u).call(this)}return(0,p.default)(e,[{key:"initPaymentType",value:function(e){var t=this;e.preventDefault();var n=this.unzerInstance.ApplePay(),i=n.initApplePaySession(this.applePayPaymentRequest);(0,m.default)(this,g).log("[> Init Payment Type]",{paymentRequest:this.applePayPaymentRequest}),window.ApplePaySession&&window.ApplePaySession.canMakePayments()?(i.onpaymentauthorized=function(e){s(t,P,o).call(t,e,n,i)},i.oncancel=function(e){(0,m.default)(t,g).log("[> Cancel]",{event:e}),(0,m.default)(t,v).show(t.snippets.CANCEL_BY_USER)},i.begin()):s(this,E,u).call(this)}}]),e}();n.default=I},{"../utils/debugging":7,"../utils/errors":8,"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/classPrivateFieldGet":12,"@babel/runtime/helpers/createClass":13,"@babel/runtime/helpers/defineProperty":14,"@babel/runtime/helpers/interopRequireDefault":15}],4:[function(e,t,n){"use strict";var i=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("@babel/runtime/helpers/classCallCheck")),a=i(e("@babel/runtime/helpers/createClass")),s=i(e("@babel/runtime/helpers/defineProperty")),o=i(e("../utils/errors")),l=function(){function e(t,n,i){(0,r.default)(this,e),this.settings=i||{};var a={locale:this.settings.locale||"de-DE"};this.unzerInstance=new unzer(t,a),this.errorHandler=new o.default(this.settings.$errorContainer,this.settings.$errorMessage),this.customerId=i.customerId||null,this.customerResource=null,this.paymentType=this.initPaymentType(n),this.form=this.settings.form||document.getElementById("form_payment_extra"),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.form.addEventListener("submit",this.handleFormSubmit),this.settings.autoSubmit&&this.handleFormSubmit(new Event("submit"))}return(0,a.default)(e,[{key:"initPaymentType",value:function(t){switch(t){case e.PAYMENT_TYPES.CARD:return this.createCard();case e.PAYMENT_TYPES.INVOICE:return this.createInvoice();case e.PAYMENT_TYPES.INVOICE_GUARANTEED:return this.createInvoiceGuaranteed();case e.PAYMENT_TYPES.INVOICE_FACTORING:return this.createInvoiceFactoring();case e.PAYMENT_TYPES.SEPA:return this.createSepa();case e.PAYMENT_TYPES.SEPA_GUARANTEED:return this.createSepaGuaranteed();case e.PAYMENT_TYPES.PAYPAL:return this.createPaypal();case e.PAYMENT_TYPES.SOFORT:return this.createSofort();case e.PAYMENT_TYPES.GIROPAY:return this.createGiropay();case e.PAYMENT_TYPES.PRZELEWY24:return this.createPrzelewy24();case e.PAYMENT_TYPES.IDEAL:return this.createIdeal();case e.PAYMENT_TYPES.PREPAYMENT:return this.createPrepayment();case e.PAYMENT_TYPES.EPS:return this.createEPS();case e.PAYMENT_TYPES.FLEXIPAY_DIRECT:return this.createFlexiPayDirect();case e.PAYMENT_TYPES.ALIPAY:return this.createAlipay();case e.PAYMENT_TYPES.TWINT:return this.createTwint();case e.PAYMENT_TYPES.WECHAT_PAY:return this.createWeChatPay();case e.PAYMENT_TYPES.HIRE_PURCHASE:return this.createHirePurchase();case e.PAYMENT_TYPES.PAYLATER_INVOICE:return this.createPaylaterInvoice();case e.PAYMENT_TYPES.BANCONTACT:return this.createBancontact();case e.PAYMENT_TYPES.PAYLATER_INSTALLMENT:return this.createPaylaterInstallment();case e.PAYMENT_TYPES.PAYLATER_DIRECT_DEBIT:return this.createPaylaterDirectDebit();case e.PAYMENT_TYPES.OPEN_BANKING:return this.createOpenBanking();default:throw new Error("Unkown Payment Type: "+t)}}},{key:"handleFormSubmit",value:function(e){var t=this;e.preventDefault();var n=[this.paymentType.createResource()];this.customerResource&&n.push(this.customerId?this.customerResource.updateCustomer():this.customerResource.createCustomer()),Promise.all(n).then(function(e){var n=document.createElement("input");if(n.setAttribute("type","hidden"),n.setAttribute("name","paymentData[resourceId]"),n.setAttribute("value",e[0].id),t.form.appendChild(n),e.length>=2){var i=document.createElement("input");i.setAttribute("type","hidden"),i.setAttribute("name","paymentData[customerId]"),i.setAttribute("value",e[1].id),t.form.appendChild(i)}t.form.removeEventListener("submit",t.handleFormSubmit),t.form.submit()}).catch(function(e){t.errorHandler.show(e.message)})}},{key:"onPaylaterInputValidation",value:function(e,t,n,i){if(t)return"all"==i.getAttribute("data-s360-valid")?void i.removeAttribute("disabled"):"customer"==i.getAttribute("data-s360-valid")?(i.setAttribute("data-s360-valid","all"),void i.removeAttribute("disabled")):void i.setAttribute("data-s360-valid",n);i.setAttribute("disabled",!0),i.getAttribute("data-s360-valid")==n?i.setAttribute("data-s360-valid",0):"all"==i.getAttribute("data-s360-valid")&&i.setAttribute("data-s360-valid","customer")}},{key:"createCustomer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.settings.isB2B?this.unzerInstance.B2BCustomer():this.unzerInstance.Customer(),i=this.settings.customer||{},r=this.settings.submitButton||document.getElementById("submit-button"),a={containerId:"customer",showInfoBox:!1,showHeader:!1,fields:["name","birthdate"]};return e&&(a.paymentTypeName=e),n.initFormFields(i),t?(r.setAttribute("data-s360-valid",0),n.addEventListener("validate",function(t){if(r.setAttribute("disabled",!0),t.success)return"all"==r.getAttribute("data-s360-valid")?void r.removeAttribute("disabled"):r.getAttribute("data-s360-valid")==e?(r.setAttribute("data-s360-valid","all"),void r.removeAttribute("disabled")):void r.setAttribute("data-s360-valid","customer");"customer"==r.getAttribute("data-s360-valid")?r.setAttribute("data-s360-valid",0):"all"==r.getAttribute("data-s360-valid")&&r.setAttribute("data-s360-valid",e)})):n.addEventListener("validate",function(e){e.success?r.removeAttribute("disabled"):r.setAttribute("disabled",!0)}),this.settings.isB2B&&(a.fields=["companyInfo"]),this.customerId?(n.update(this.customerId,a),n):(n.create(a),n)}},{key:"hideFormFields",value:function(e){var t=this,n=$("#customer");n.find(".field").filter(".city, .company, :has(.country), .street, .zip, .firstname, .lastname").hide(),n.find(".salutation-customer").hide(),n.find(".firstname, .lastname").parent(".fields").hide(),n.find(".unzerUI.divider-horizontal:eq(0)").hide(),n.find(".unzerUI.message.downArrow").hide(),e&&(n.find(".field").filter(".checkbox-billingAddress, .email").hide(),n.find(".field").filter(".billing-name, .billing-street, .billing-zip, .billing-city, :has(.billing-country)").hide(),n.find(".unzerUI.form>.checkboxLabel").hide(),n.find(".unzerUI.form>.salutation-unzer-"+e+"-customer").hide()),n.find(".companyType").on("change",function(n){return t.hideFormFields(e)})}},{key:"createPaylaterInstallment",value:function(){var e=this;this.customerResource=this.createCustomer("paylater-installment",!0);var t=this.settings.submitButton||document.getElementById("submit-button"),n=this.unzerInstance.PaylaterInstallment();return this.hideFormFields("paylater-installment"),n.create({containerId:"paylater-installment",amount:this.settings.amount,currency:this.settings.currency,country:this.settings.country}),n.addEventListener("paylaterInstallmentEvent",function(n){switch(n.currentStep){case"plan-list":t.setAttribute("disabled",!0);break;case"plan-detail":t.setAttribute("disabled",!1)}var i="validate"===n.action&&n.success;e.onPaylaterInputValidation(n,i,"paylater-installment",t)}),n}},{key:"createPaylaterInvoice",value:function(){var e=this;this.customerResource=this.createCustomer("paylater-invoice",!0);var t=this.settings.submitButton||document.getElementById("submit-button"),n=this.unzerInstance.PaylaterInvoice();return this.hideFormFields("paylater-invoice"),n.create({containerId:"paylater-invoice",customerType:this.settings.isB2B?"B2B":"B2C"}),n.addEventListener("change",function(n){return e.onPaylaterInputValidation(n,n.success,"paylater-invoice",t)}),n}},{key:"createPaylaterDirectDebit",value:function(){var e=this;this.customerResource=this.createCustomer("paylater-direct-debit",!0);var t=this.settings.submitButton||document.getElementById("submit-button"),n=this.unzerInstance.PaylaterDirectDebit();return this.hideFormFields("paylater-direct-debit"),n.create("paylater-direct-debit",{containerId:"paylater-direct-debit",customerType:this.settings.isB2B?"B2B":"B2C"}),n.addEventListener("change",function(n){return e.onPaylaterInputValidation(n,n.success,"paylater-direct-debit",t)}),n}},{key:"createBancontact",value:function(){var e=this.unzerInstance.Bancontact(),t={fontSize:null,fontColor:null,fontFamily:null};return this.settings.styling&&(t.fontColor=this.settings.styling.fontColor||null,t.fontSize=this.settings.styling.fontSize||null,t.fontFamily=this.settings.styling.fontFamily||null),e.create("holder",{containerId:"bancontact-holder",fontSize:t.fontSize,fontColor:t.fontColor,fontFamily:t.fontFamily}),e}},{key:"createCard",value:function(){var e=this,t=this.unzerInstance.Card(),n={fontSize:null,fontColor:null,fontFamily:null};this.settings.styling&&(n.fontColor=this.settings.styling.fontColor||null,n.fontSize=this.settings.styling.fontSize||null,n.fontFamily=this.settings.styling.fontFamily||null),t.create("number",{containerId:"card-element-id-number",onlyIframe:!1,fontSize:n.fontSize,fontColor:n.fontColor,fontFamily:n.fontFamily}),t.create("expiry",{containerId:"card-element-id-expiry",onlyIframe:!1,fontSize:n.fontSize,fontColor:n.fontColor,fontFamily:n.fontFamily}),t.create("cvc",{containerId:"card-element-id-cvc",onlyIframe:!1,fontSize:n.fontSize,fontColor:n.fontColor}),t.create("holder",{containerId:"card-element-id-holder",onlyIframe:!1,fontSize:n.fontSize,fontColor:n.fontColor,fontFamily:n.fontFamily});var i={},r=this.settings.submitButton||document.getElementById("submit-button");return r.setAttribute("disabled",!0),t.addEventListener("change",function(t){t.success&&(i[t.type]=!0,e.errorHandler.hide()),t.error&&(i[t.type]=!1,e.errorHandler.show(t.error)),t.reset&&(i[t.type]=!1),i.number&&i.expiry&&i.cvc&&i.holder?r.removeAttribute("disabled"):r.setAttribute("disabled",!0)}),t}},{key:"createInvoice",value:function(){return this.unzerInstance.Invoice()}},{key:"createInvoiceGuaranteed",value:function(){return this.customerResource=this.createCustomer(),this.unzerInstance.InvoiceSecured()}},{key:"createInvoiceFactoring",value:function(){return this.customerResource=this.createCustomer(),this.unzerInstance.InvoiceSecured()}},{key:"createSepa",value:function(){var e=this,t=this.unzerInstance.SepaDirectDebit();t.create("sepa-direct-debit",{containerId:"sepa-IBAN"});var n=this.settings.submitButton||document.getElementById("submit-button");return n.setAttribute("disabled",!0),t.addEventListener("change",function(t){if(t.success)return n.removeAttribute("disabled"),void e.errorHandler.hide();n.setAttribute("disabled",!0)}),t}},{key:"createSepaGuaranteed",value:function(){var e=this,t=this.unzerInstance.SepaDirectDebitSecured();t.create("sepa-direct-debit-guaranteed",{containerId:"sepa-guaranteed-IBAN"});var n=this.settings.submitButton||document.getElementById("submit-button");return n.setAttribute("disabled",!0),t.addEventListener("change",function(t){if(t.success)return n.removeAttribute("disabled"),void e.errorHandler.hide();n.setAttribute("disabled",!0)}),this.customerResource=this.createCustomer(),t}},{key:"createPaypal",value:function(){var e=this.unzerInstance.Paypal();return e.create("email",{containerId:"paypal-element-email"}),e}},{key:"createSofort",value:function(){return this.unzerInstance.Sofort()}},{key:"createGiropay",value:function(){return this.unzerInstance.Giropay()}},{key:"createPrzelewy24",value:function(){return this.unzerInstance.Przelewy24()}},{key:"createIdeal",value:function(){var e=this,t=this.unzerInstance.Ideal();t.create("ideal",{containerId:"ideal-element"});var n=this.settings.submitButton||document.getElementById("submit-button");return n.setAttribute("disabled",!0),t.addEventListener("change",function(t){if(t.value)return n.removeAttribute("disabled"),void e.errorHandler.hide();n.setAttribute("disabled",!0)}),t}},{key:"createPrepayment",value:function(){return this.unzerInstance.Prepayment()}},{key:"createEPS",value:function(){return this.unzerInstance.EPS()}},{key:"createFlexiPayDirect",value:function(){return this.unzerInstance.FlexiPayDirect()}},{key:"createAlipay",value:function(){return this.unzerInstance.Alipay()}},{key:"createTwint",value:function(){return this.unzerInstance.Twint()}},{key:"createOpenBanking",value:function(){return this.unzerInstance.OpenBanking()}},{key:"createWeChatPay",value:function(){return this.unzerInstance.Wechatpay()}},{key:"createHirePurchase",value:function(){var e=this.unzerInstance.InstallmentSecured(),t=this;this.customerResource=this.createCustomer();var n=t.settings.submitButton||document.getElementById("submit-button");return n.setAttribute("style","display: none"),n.setAttribute("disabled",!0),e.create({containerId:"hire-purchase-element",amount:this.settings.amount||null,currency:this.settings.currency||null,effectiveInterest:this.settings.effectiveInterest||null,orderDate:this.settings.orderDate||null}).then(function(e){}).catch(function(e){var n="";console.error(e.message),e.error.details.forEach(function(e){console.error("API-Error: "+e.code),n+=e.customerMessage}),t.errorHandler.show(n)}),e.addEventListener("installmentSecuredEvent",function(e){if("validate"===e.action){if(e.success)return void n.removeAttribute("disabled");n.setAttribute("disabled",!0)}if("change-step"===e.action){if("plan-list"===e.currentSteep)return n.setAttribute("style","display: none"),void n.setAttribute("disabled",!0);n.setAttribute("style","display: inline-block")}}),e}}]),e}();n.default=l,(0,s.default)(l,"PAYMENT_TYPES",{ALIPAY:"Alipay",CARD:"Card",EPS:"EPS",FLEXIPAY_DIRECT:"FlexiPay Direct",HIRE_PURCHASE:"Hire Purchase",PAYPAL:"Paypal",INVOICE:"Invoice",INVOICE_FACTORING:"Invoice Factoring",INVOICE_GUARANTEED:"Invoice Guaranteed",SEPA:"SEPA",SEPA_GUARANTEED:"SEPA (guaranteed)",SOFORT:"SOFORT",GIROPAY:"Giropay",PRZELEWY24:"Przelewy24",IDEAL:"iDEAL",PREPAYMENT:"Prepayment",WECHAT_PAY:"WeChat Pay",PAYLATER_INVOICE:"Paylater Invoice",BANCONTACT:"Bancontact",PAYLATER_INSTALLMENT:"Paylater Installment",PAYLATER_DIRECT_DEBIT:"Paylater Direct Debit",TWINT:"Twint",OPEN_BANKING:"Open Banking"})},{"../utils/errors":8,"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/createClass":13,"@babel/runtime/helpers/defineProperty":14,"@babel/runtime/helpers/interopRequireDefault":15}],5:[function(e,t,n){"use strict";var i=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("@babel/runtime/helpers/classCallCheck")),a=i(e("@babel/runtime/helpers/createClass")),s=i(e("../utils/errors")),o=function(){function e(t,n){(0,r.default)(this,e),this.settings=n||{},this.form=this.settings.form||document.getElementById("complete_order");var i={locale:this.settings.locale||"de-DE"};this.unzerInstance=new unzer(t,i),this.errorHandler=new s.default(this.settings.$errorContainer,this.settings.$errorMessage),this.createPaymentTypeResource()}return(0,a.default)(e,[{key:"createPaymentTypeResource",value:function(){var e=this,t=this.unzerInstance.Googlepay(),n=t.initPaymentDataRequestObject({gatewayMerchantId:this.settings.googlepay.gatewayMerchantId,merchantInfo:this.settings.googlepay.merchantInfo,transactionInfo:this.settings.googlepay.transactionInfo,allowedCardNetworks:this.settings.googlepay.allowedCardNetworks,allowCreditCards:this.settings.googlepay.allowCreditCards,allowPrepaidCards:this.settings.googlepay.allowPrepaidCards,buttonOptions:{buttonColor:this.settings.googlepay.buttonOptions.buttonColor,buttonSizeMode:this.settings.googlepay.buttonOptions.buttonSize},onPaymentAuthorizedCallback:function(n){return t.createResource(n).then(e.onAuthorizedSuccess.bind(e)).catch(e.onAuthorizedFailed.bind(e))}});t.create({containerId:"googlepay-holder"},n)}},{key:"onAuthorizedSuccess",value:function(e){var t=document.createElement("input");return t.setAttribute("type","hidden"),t.setAttribute("name","unzer-payment-type-id"),t.setAttribute("value",e.id),this.form.appendChild(t),this.form.submit(),{status:"success"}}},{key:"onAuthorizedFailed",value:function(e){var t=e.customerMessage||e.message||"Error";return e.data&&Array.isArray(e.data.errors)&&e.data.errors[0]&&(t=e.data.errors[0].customerMessage||"Error"),this.errorHandler.show(t),{status:"error",message:t||"Unexpected error"}}}]),e}();n.default=o},{"../utils/errors":8,"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/createClass":13,"@babel/runtime/helpers/interopRequireDefault":15}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(e,t,n){var i=$(e);t.addEventListener("click",function(){n.trigger("submit")}),n.on("submit",function(e){return!!i.is(":visible")||(e.preventDefault(),i.modal("show"),!1)})}},{}],7:[function(e,t,n){"use strict";var i=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("@babel/runtime/helpers/classCallCheck")),a=i(e("@babel/runtime/helpers/createClass")),s=function(){function e(t){(0,r.default)(this,e),this.$container=t,this.$log=null,window.UNZER_DEBUG&&this.createLogTemplate()}return(0,a.default)(e,[{key:"log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};window.UNZER_DEBUG&&(this.$log||this.createLogTemplate(),this.$log.append("
    • "+e+"
      "+JSON.stringify(t,null,"  ")+"
    • "))}},{key:"createLogTemplate",value:function(){this.$container.append($('
        ')),this.$log=this.$container.find(".debug-log > ul")}}]),e}();n.default=s},{"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/createClass":13,"@babel/runtime/helpers/interopRequireDefault":15}],8:[function(e,t,n){"use strict";var i=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("@babel/runtime/helpers/classCallCheck")),a=i(e("@babel/runtime/helpers/createClass")),s=function(){function e(t,n){(0,r.default)(this,e),this.$wrapper=t||$("#error-container"),this.$holder=n||this.$wrapper.find(".alert")}return(0,a.default)(e,[{key:"show",value:function(e){this.$wrapper.show(),this.$holder.html(e)}},{key:"hide",value:function(){this.$wrapper.hide(),this.$holder.html()}}]),e}();n.default=s},{"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/createClass":13,"@babel/runtime/helpers/interopRequireDefault":15}],9:[function(e,t,n){t.exports=function(e,t){return t.get?t.get.call(e):t.value},t.exports.__esModule=!0,t.exports.default=t.exports},{}],10:[function(e,t,n){t.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},{}],11:[function(e,t,n){t.exports=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)},t.exports.__esModule=!0,t.exports.default=t.exports},{}],12:[function(e,t,n){var i=e("./classApplyDescriptorGet.js"),r=e("./classExtractFieldDescriptor.js");t.exports=function(e,t){var n=r(e,t,"get");return i(e,n)},t.exports.__esModule=!0,t.exports.default=t.exports},{"./classApplyDescriptorGet.js":9,"./classExtractFieldDescriptor.js":11}],13:[function(e,t,n){function i(e,t){for(var n=0;n Init Payment Type]', {paymentRequest: this.applePayPaymentRequest});\n\n session.onvalidatemerchant = (event) => {\n this.merchantValidationCallback(event, session);\n };\n\n session.onpaymentauthorized = (event) => {\n this.applePayAuthorizedCallback(event, session);\n };\n\n session.oncancel = (event) => {\n this.debugging.log('[> Cancel]', {event});\n this.errorHandler.show(this.snippets.CANCEL_BY_USER);\n };\n\n session.begin();\n }\n\n /**\n * Call the merchant validation in the server-side integration (apple_pay_merchantvalidation)\n * @param {Event} event\n * @param {ApplePaySession} session\n */\n merchantValidationCallback(event, session) {\n var validationUrl = JSON.stringify(event.validationURL);\n\n this.debugging.log('[> Merchant Validation]', {event});\n\n $.ajax({\n 'url': $.evo.io().options.ioUrl,\n 'method': 'POST',\n 'dataType': 'json',\n 'data': 'io={\"name\":\"apple_pay_merchantvalidation\", \"params\":[' + validationUrl + ']}',\n }).done((validationResponse) => {\n this.debugging.log('[> Merchant Validation Response]', validationResponse);\n\n try {\n session.completeMerchantValidation(validationResponse);\n } catch (e) {\n alert(e.message);\n }\n })\n .fail((error) => {\n this.debugging.log('[> Merchant Validation Error]', error);\n this.errorHandler.show(JSON.stringify(error.statusText));\n session.abort();\n });\n }\n\n /**\n * Create Apple Pay resource with unzer and save the resource id to charge it later.\n *\n * We do this here via AJAX instead of the validateAdditional method in the payment method to set the apple pay\n * session state accordingly.\n *\n * @param {Event} event\n * @param {ApplePaySession} session\n */\n applePayAuthorizedCallback(event, session) {\n // Get payment data from event.\n // \"event.payment\" also contains contact information, if they were set via Apple Pay.\n var self = this;\n var unzerApplePayInstance = this.unzerInstance.ApplePay();\n var paymentData = event.payment.token.paymentData;\n\n this.debugging.log('[> Payment Authorization]', {unzerApplePayInstance, event, paymentData});\n\n // Create an Unzer instance with your public key\n unzerApplePayInstance.createResource(paymentData)\n .then(function (createdResource) {\n // Hand over the type ID to your backend.\n var typeId = JSON.stringify(createdResource.id);\n $.ajax({\n 'url': $.evo.io().options.ioUrl,\n 'method': 'POST',\n 'dataType': 'json',\n 'data': 'io={\"name\":\"apple_pay_payment_authorized\", \"params\":[' + typeId + ']}',\n }).done(function (result) {\n // Handle the transaction respone from backend.\n self.debugging.log('[> Payment Authorization Response]', {result, typeId});\n var status = result.transactionStatus;\n if (status === 'success' || status === 'pending') {\n session.completePayment({ status: window.ApplePaySession.STATUS_SUCCESS });\n\n // Append Payment Resource Id\n const hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'paymentData[resourceId]');\n hiddenInput.setAttribute('value', typeId);\n self.form.appendChild(hiddenInput);\n\n // Submitting the form\n self.form.removeEventListener('submit', self.initPaymentType);\n self.form.submit();\n } else {\n self.abortPaymentSession(session);\n }\n }).fail(function (error) {\n self.errorHandler.show(error.statusText);\n self.abortPaymentSession(session);\n });\n })\n .catch(function (error) {\n self.debugging.log('[> Payment Authorization Error]', error);\n self.errorHandler.show(error.message);\n self.abortPaymentSession(session);\n });\n }\n\n /**\n * Handle Unsupported devices\n */\n unsupportedDevice() {\n this.settings.submitButton.disabled = true;\n this.settings.submitButton.ariaDisabled = true;\n this.errorHandler.show(this.snippets.NOT_SUPPORTED);\n }\n\n /**\n * abort current payment session.\n * @param {ApplePaySession} session\n */\n abortPaymentSession(session) {\n this.debugging.log('[> Abort Payment Session]', { status: window.ApplePaySession.STATUS_FAILURE });\n session.completePayment({ status: window.ApplePaySession.STATUS_FAILURE });\n session.abort();\n }\n}\n","import ErrorHandler from \"../utils/errors\";\nimport Debugging from \"../utils/debugging\";\n\n/** @type {ApplePaySnippets} */\nconst ApplePaySnippetsDefaults = {\n NOT_SUPPORTED: \"This device does not support Apple Pay!\",\n CANCEL_BY_USER: \"Canceled payment process by user!\"\n};\n\nexport default class ApplePayV2 {\n /** @type {ApplePaySettings} */\n settings;\n\n /** @type {ApplePaySnippets} */\n snippets;\n\n /** @type {HTMLFormElement} */\n form;\n\n /** @type {ApplePayPaymentRequest} */\n applePayPaymentRequest;\n\n #errorHandler = new ErrorHandler();\n #debugging = new Debugging($('.unzerUI'));\n\n /**\n * @class\n * @param {String} pubKey\n * @param {ApplePayPaymentRequest} applePayPaymentRequest\n * @param {ApplePaySnippets} snippets\n * @param {ApplePaySettings} settings\n */\n constructor(pubKey, applePayPaymentRequest, snippets, settings) {\n this.settings = settings;\n this.snippets = Object.assign(ApplePaySnippetsDefaults, snippets);\n this.form = this.settings.form || document.getElementById('complete_order');\n this.applePayPaymentRequest = applePayPaymentRequest;\n this.unzerInstance = new unzer(pubKey, {\n locale: this.settings.locale || 'de-DE'\n });\n window.UNZER_DEBUG = !!this.unzerInstance._isSandbox || this.unzerInstance.config.hasSandboxKey; // Enable Debugging in sandbox mode\n\n if (!window.ApplePaySession || !window.ApplePaySession.canMakePayments()) {\n this.#unsupportedDevice();\n return;\n }\n\n // Register Events\n this.initPaymentType = this.initPaymentType.bind(this); // it's a trick! needed in order to overcome the remove event listener\n this.form.addEventListener('submit', this.initPaymentType);\n $('.apple-pay-button').on('click', this.initPaymentType.bind(this));\n }\n\n /**\n * @param {Event} event\n */\n initPaymentType(event) {\n event.preventDefault();\n const applePayInstance = this.unzerInstance.ApplePay();\n const session = applePayInstance.initApplePaySession(this.applePayPaymentRequest); // setup session with default merchant validation\n\n this.#debugging.log('[> Init Payment Type]', { paymentRequest: this.applePayPaymentRequest });\n\n if (!window.ApplePaySession || !window.ApplePaySession.canMakePayments()) {\n this.#unsupportedDevice();\n return;\n }\n\n /** @param {Event} event */\n session.onpaymentauthorized = (event) => {\n this.#applePayAuthorizedCallback(event, applePayInstance, session);\n };\n\n /** @param {Event} event */\n session.oncancel = (event) => {\n this.#debugging.log('[> Cancel]', {event});\n this.#errorHandler.show(this.snippets.CANCEL_BY_USER);\n };\n\n session.begin();\n }\n\n /**\n * Create Apple Pay resource with unzer and save the resource id to charge it later.\n *\n * @param {Event & {payment: {token: {paymentData: object}}}} event\n * @param {Object} applePayInstance\n * @param {ApplePaySession} session\n */\n #applePayAuthorizedCallback(event, applePayInstance, session) {\n const paymentData = event.payment.token.paymentData;\n\n this.#debugging.log('[> Payment Authorization]', { applePayInstance, event, paymentData });\n\n // Create an Unzer instance with your public key\n applePayInstance.createResource(paymentData)\n .then((createdResource) => {\n this.#debugging.log('[> Payment Authorization Resource]', { createdResource });\n session.completePayment({ status: window.ApplePaySession.STATUS_SUCCESS });\n\n // Hand over the payment type ID (createdResource.id)\n const typeId = JSON.stringify(createdResource.id);\n const hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'unzer-payment-type-id');\n hiddenInput.setAttribute('value', typeId);\n\n this.form.appendChild(hiddenInput);\n this.form.removeEventListener('submit', this.initPaymentType);\n this.form.submit();\n })\n .catch(error => {\n this.#debugging.log('[> Payment Authorization Error]', error);\n this.#errorHandler.show(error.message);\n this.#abortPaymentSession(session);\n })\n }\n\n /**\n * abort current payment session.\n * @param {ApplePaySession} session\n */\n #abortPaymentSession(session) {\n this.#debugging.log('[> Abort Payment Session]', { status: window.ApplePaySession.STATUS_FAILURE });\n session.completePayment({ status: window.ApplePaySession.STATUS_FAILURE });\n session.abort();\n }\n\n /**\n * Handle Unsupported devices\n */\n #unsupportedDevice() {\n this.#errorHandler.show(this.snippets.NOT_SUPPORTED);\n console.error(this.snippets.NOT_SUPPORTED);\n }\n}","import ErrorHandler from \"../utils/errors\";\n\nexport default class UnzerPayment {\n static PAYMENT_TYPES = {\n ALIPAY: 'Alipay',\n CARD: 'Card',\n EPS: 'EPS',\n FLEXIPAY_DIRECT: 'FlexiPay Direct',\n HIRE_PURCHASE: 'Hire Purchase',\n PAYPAL: 'Paypal',\n INVOICE: 'Invoice',\n INVOICE_FACTORING: 'Invoice Factoring',\n INVOICE_GUARANTEED: 'Invoice Guaranteed',\n SEPA: 'SEPA',\n SEPA_GUARANTEED: 'SEPA (guaranteed)',\n SOFORT: 'SOFORT',\n GIROPAY: 'Giropay',\n PRZELEWY24: 'Przelewy24',\n IDEAL: 'iDEAL',\n PREPAYMENT: 'Prepayment',\n WECHAT_PAY: 'WeChat Pay',\n PAYLATER_INVOICE: 'Paylater Invoice',\n BANCONTACT: 'Bancontact',\n PAYLATER_INSTALLMENT: 'Paylater Installment',\n PAYLATER_DIRECT_DEBIT: 'Paylater Direct Debit',\n TWINT: 'Twint',\n OPEN_BANKING: 'Open Banking',\n };\n\n /**\n * Heidelpay Payment Class\n *\n * @param {string} pubKey Public Key\n * @param {string} type Payment Type\n * @param {PaymentSettings} settings\n */\n constructor(pubKey, type, settings) {\n /** @type {PaymentSettings} */\n this.settings = settings || {};\n\n var options = {\n locale: this.settings.locale || 'de-DE'\n };\n\n this.unzerInstance = new unzer(pubKey, options);\n this.errorHandler = new ErrorHandler(this.settings.$errorContainer, this.settings.$errorMessage);\n\n /** @type {?string} customerId */\n this.customerId = settings.customerId || null;\n\n /** @type {{createCustomer: Function, updateCustomer: Function}|null} customerResource */\n this.customerResource = null;\n\n /** @type {{createResource: Function}} paymentType */\n this.paymentType = this.initPaymentType(type);\n\n /** @type {HTMLElement} form Form in which the customer enters additional details */\n this.form = this.settings.form || document.getElementById('form_payment_extra');\n\n // Register Events\n this.handleFormSubmit = this.handleFormSubmit.bind(this); // it's a trick! needed in order to overcome the remove event listener\n this.form.addEventListener('submit', this.handleFormSubmit);\n\n if (this.settings.autoSubmit) {\n // this.form.dispatchEvent(new Event('submit')); // Causes endless redirects in some browsers like FF, so we call the callback directly...\n this.handleFormSubmit(new Event('submit'));\n }\n }\n\n /**\n * Init Payment Type\n *\n * @param {string} type\n * @returns {object} payment type\n * @throws Error if there is an unkown payment type\n */\n initPaymentType(type) {\n switch (type) {\n case UnzerPayment.PAYMENT_TYPES.CARD:\n return this.createCard();\n\n case UnzerPayment.PAYMENT_TYPES.INVOICE:\n return this.createInvoice();\n\n case UnzerPayment.PAYMENT_TYPES.INVOICE_GUARANTEED:\n return this.createInvoiceGuaranteed();\n\n case UnzerPayment.PAYMENT_TYPES.INVOICE_FACTORING:\n return this.createInvoiceFactoring();\n\n case UnzerPayment.PAYMENT_TYPES.SEPA:\n return this.createSepa();\n\n case UnzerPayment.PAYMENT_TYPES.SEPA_GUARANTEED:\n return this.createSepaGuaranteed();\n\n case UnzerPayment.PAYMENT_TYPES.PAYPAL:\n return this.createPaypal();\n\n case UnzerPayment.PAYMENT_TYPES.SOFORT:\n return this.createSofort();\n\n case UnzerPayment.PAYMENT_TYPES.GIROPAY:\n return this.createGiropay();\n\n case UnzerPayment.PAYMENT_TYPES.PRZELEWY24:\n return this.createPrzelewy24();\n\n case UnzerPayment.PAYMENT_TYPES.IDEAL:\n return this.createIdeal();\n\n case UnzerPayment.PAYMENT_TYPES.PREPAYMENT:\n return this.createPrepayment();\n\n case UnzerPayment.PAYMENT_TYPES.EPS:\n return this.createEPS();\n\n case UnzerPayment.PAYMENT_TYPES.FLEXIPAY_DIRECT:\n return this.createFlexiPayDirect();\n\n case UnzerPayment.PAYMENT_TYPES.ALIPAY:\n return this.createAlipay();\n\n case UnzerPayment.PAYMENT_TYPES.TWINT:\n return this.createTwint();\n\n case UnzerPayment.PAYMENT_TYPES.WECHAT_PAY:\n return this.createWeChatPay();\n\n case UnzerPayment.PAYMENT_TYPES.HIRE_PURCHASE:\n return this.createHirePurchase();\n\n case UnzerPayment.PAYMENT_TYPES.PAYLATER_INVOICE:\n return this.createPaylaterInvoice();\n\n case UnzerPayment.PAYMENT_TYPES.BANCONTACT:\n return this.createBancontact();\n\n case UnzerPayment.PAYMENT_TYPES.PAYLATER_INSTALLMENT:\n return this.createPaylaterInstallment();\n\n case UnzerPayment.PAYMENT_TYPES.PAYLATER_DIRECT_DEBIT:\n return this.createPaylaterDirectDebit();\n\n case UnzerPayment.PAYMENT_TYPES.OPEN_BANKING:\n return this.createOpenBanking();\n\n default:\n throw new Error('Unkown Payment Type: ' + type);\n }\n }\n\n /**\n * Handle the form submit\n *\n * @param {Event} event Submit Event\n */\n handleFormSubmit(event) {\n var self = this;\n event.preventDefault();\n\n // Creating a Payment resource and (optional) Customer Resource\n var resources = [this.paymentType.createResource()];\n\n if (this.customerResource) {\n resources.push(this.customerId ? this.customerResource.updateCustomer() : this.customerResource.createCustomer());\n }\n\n Promise.all(resources).then(function (result) {\n // Append Payment Resource Id\n var hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'paymentData[resourceId]');\n hiddenInput.setAttribute('value', result[0].id);\n self.form.appendChild(hiddenInput);\n\n // Append Customer Id\n if (result.length >= 2) {\n var hiddenCstInput = document.createElement('input');\n hiddenCstInput.setAttribute('type', 'hidden');\n hiddenCstInput.setAttribute('name', 'paymentData[customerId]');\n hiddenCstInput.setAttribute('value', result[1].id);\n self.form.appendChild(hiddenCstInput);\n }\n\n // Submitting the form\n self.form.removeEventListener('submit', self.handleFormSubmit);\n self.form.submit();\n })\n .catch(function (error) {\n self.errorHandler.show(error.message);\n });\n }\n\n /**\n * Handle Paylater Input Validation\n * @param {Event} event\n * @param {boolean} isValid\n * @param {String} paymentMethodName\n * @param {HTMLElement} continueButton\n * @returns\n */\n onPaylaterInputValidation(event, isValid, paymentMethodName, continueButton) {\n // console.log(paymentMethodName, { event, isValid, continueButton, 's360-valid': continueButton.getAttribute('data-s360-valid') });\n\n if (isValid) {\n // everything is still valid\n if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n // Customer is already valid -> everything is valid\n if (continueButton.getAttribute('data-s360-valid') == 'customer') {\n continueButton.setAttribute('data-s360-valid', 'all');\n continueButton.removeAttribute('disabled');\n return;\n }\n\n // mark payment method as valid\n continueButton.setAttribute('data-s360-valid', paymentMethodName);\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n\n // only invalidate if the paymentMethodName was valid before\n if (continueButton.getAttribute('data-s360-valid') == paymentMethodName) {\n continueButton.setAttribute('data-s360-valid', 0);\n } else if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.setAttribute('data-s360-valid', 'customer');\n }\n }\n\n /**\n * Create (or update) customer resource.\n *\n * @param {?String} paymentTypeName\n * @param {?String} multipleValidation\n * @see https://docs.heidelpay.com/docs/customer-ui-integration\n * @returns {{createCustomer: Function, updateCustomer: Function}} Customer Resource\n */\n createCustomer(paymentTypeName = null, multipleValidation = false) {\n var Customer = this.settings.isB2B ? this.unzerInstance.B2BCustomer() : this.unzerInstance.Customer();\n var customerObj = this.settings.customer || {};\n var continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n let options = {\n containerId: 'customer',\n showInfoBox: false,\n showHeader: false,\n fields: ['name', 'birthdate']\n };\n\n if (paymentTypeName) {\n options.paymentTypeName = paymentTypeName;\n }\n\n Customer.initFormFields(customerObj);\n if (multipleValidation) {\n continueButton.setAttribute('data-s360-valid', 0);\n\n Customer.addEventListener('validate', (e) => {\n // console.log('customer validate', e, continueButton, continueButton.getAttribute('data-s360-valid'));\n continueButton.setAttribute('disabled', true);\n\n if (e.success) {\n // everything is still valid\n if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n // payment method is already valid -> everything is valid\n if (continueButton.getAttribute('data-s360-valid') == paymentTypeName) {\n continueButton.setAttribute('data-s360-valid', 'all');\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('data-s360-valid', 'customer');\n return;\n }\n\n // only invalidate if the customer was valid before\n if (continueButton.getAttribute('data-s360-valid') == 'customer') {\n continueButton.setAttribute('data-s360-valid', 0);\n } else if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.setAttribute('data-s360-valid', paymentTypeName);\n }\n });\n } else {\n Customer.addEventListener('validate', (e) => {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n }\n\n if (this.settings.isB2B) {\n options.fields = ['companyInfo'];\n // options = {containerId: 'customer'};\n }\n\n if (this.customerId) {\n Customer.update(this.customerId, options);\n return Customer;\n }\n\n Customer.create(options);\n\n return Customer;\n }\n\n /**\n * Hide form fields from unzer ui component because they are already filled by the shop\n * @param {string} paymentMethodName\n */\n hideFormFields(paymentMethodName) {\n const field = $('#customer');\n\n field.find('.field').filter(\n '.city, .company, :has(.country), .street, .zip, .firstname, .lastname'\n ).hide();\n field.find('.salutation-customer').hide();\n field.find('.firstname, .lastname').parent('.fields').hide();\n field.find('.unzerUI.divider-horizontal:eq(0)').hide();\n field.find('.unzerUI.message.downArrow').hide();\n\n if (paymentMethodName) {\n field.find('.field').filter('.checkbox-billingAddress, .email').hide();\n field.find('.field').filter(\n '.billing-name, .billing-street, .billing-zip, .billing-city, :has(.billing-country)'\n ).hide();\n field.find('.unzerUI.form>.checkboxLabel').hide();\n field.find('.unzerUI.form>.salutation-unzer-' + paymentMethodName + '-customer').hide();\n }\n }\n\n /**\n * Create Paylayter Installment Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/unzer-installment-upl/accept-unzer-installment-ui-component/\n * @returns {{createResource: Function}}\n */\n createPaylaterInstallment() {\n this.customerResource = this.createCustomer('paylater-installment', true);\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n const paylaterInstallment = this.unzerInstance.PaylaterInstallment();\n\n this.hideFormFields('paylater-installment');\n\n paylaterInstallment.create({\n containerId: 'paylater-installment',\n amount: this.settings.amount,\n currency: this.settings.currency,\n country: this.settings.country\n });\n\n paylaterInstallment.addEventListener('paylaterInstallmentEvent', (e) => {\n switch (e.currentStep) {\n case 'plan-list':\n continueButton.setAttribute('disabled', true);\n break;\n\n case 'plan-detail':\n continueButton.setAttribute('disabled', false);\n break;\n\n default:\n break;\n }\n\n const isValid = e.action === 'validate' && e.success;\n this.onPaylaterInputValidation(e, isValid, 'paylater-installment', continueButton);\n });\n\n return paylaterInstallment;\n }\n\n /**\n * Create Paylayter Invoice Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/unzer-invoice-upl/accept-unzer-invoice-upl-ui-component/\n * @returns {{createResource: Function}}\n */\n createPaylaterInvoice() {\n this.customerResource = this.createCustomer('paylater-invoice', true);\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n const paylaterInvoice = this.unzerInstance.PaylaterInvoice();\n\n this.hideFormFields('paylater-invoice');\n\n paylaterInvoice.create({\n containerId: 'paylater-invoice',\n customerType: this.settings.isB2B ? 'B2B' : 'B2C'\n });\n\n paylaterInvoice.addEventListener('change', (e) =>\n this.onPaylaterInputValidation(\n e,\n e.success,\n 'paylater-invoice',\n continueButton\n )\n );\n\n return paylaterInvoice;\n }\n\n /**\n * Create Paylayter Invoice Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/direct-debit-secured/accept-direct-debit-secured-ui-component/\n * @returns {{createResource: Function}}\n */\n createPaylaterDirectDebit() {\n this.customerResource = this.createCustomer('paylater-direct-debit', true);\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n const paylaterDirectDebit = this.unzerInstance.PaylaterDirectDebit();\n\n this.hideFormFields('paylater-direct-debit');\n\n paylaterDirectDebit.create('paylater-direct-debit', {\n containerId: 'paylater-direct-debit',\n customerType: this.settings.isB2B ? 'B2B' : 'B2C'\n });\n\n paylaterDirectDebit.addEventListener('change', (e) =>\n this.onPaylaterInputValidation(\n e,\n e.success,\n 'paylater-direct-debit',\n continueButton\n )\n );\n\n return paylaterDirectDebit;\n }\n\n /**\n * Create Bancontact Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/bancontact/accept-bancontact-ui-component/\n * @returns {{createResource: Function}}\n */\n createBancontact() {\n const bancontact = this.unzerInstance.Bancontact();\n const styling = { fontSize: null, fontColor: null, fontFamily: null };\n\n if (this.settings.styling) {\n styling.fontColor = this.settings.styling.fontColor || null;\n styling.fontSize = this.settings.styling.fontSize || null;\n styling.fontFamily = this.settings.styling.fontFamily || null;\n }\n\n bancontact.create('holder', {\n containerId: 'bancontact-holder',\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n\n return bancontact;\n }\n\n /**\n * Create a new Card Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/credit-card-ui-integration\n * @returns {{createResource: Function}} Card Payment Type\n */\n createCard() {\n var Card = this.unzerInstance.Card();\n var styling = {fontSize: null, fontColor: null, fontFamily: null};\n\n if (this.settings.styling) {\n styling.fontColor = this.settings.styling.fontColor || null;\n styling.fontSize = this.settings.styling.fontSize || null;\n styling.fontFamily = this.settings.styling.fontFamily || null;\n }\n\n Card.create('number', {\n containerId: 'card-element-id-number',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n Card.create('expiry', {\n containerId: 'card-element-id-expiry',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n Card.create('cvc', {\n containerId: 'card-element-id-cvc',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n // fontFamily: styling.fontFamily // messes with hidden font in firefox\n });\n Card.create('holder', {\n containerId: 'card-element-id-holder',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n\n // Enable pay button initially\n var formFieldValid = {};\n\n /** @type {HTMLElement} continueButton */\n var continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n Card.addEventListener('change', (e) => {\n if (e.success) {\n formFieldValid[e.type] = true;\n this.errorHandler.hide();\n }\n\n if (e.error) {\n formFieldValid[e.type] = false;\n this.errorHandler.show(e.error);\n }\n\n if (e.reset) {\n formFieldValid[e.type] = false;\n }\n\n if (formFieldValid.number && formFieldValid.expiry && formFieldValid.cvc && formFieldValid.holder) {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n return Card;\n }\n\n /**\n * Create a new Invoice Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/invoice-ui-integration\n * @returns {{createResource: Function}} Invoice Payment Type\n */\n createInvoice() {\n return this.unzerInstance.Invoice();\n }\n\n /**\n * Create a new Invoice Guaranteed Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/invoice-ui-integration\n * @returns {{createResource: Function}} Invoice Payment Type\n */\n createInvoiceGuaranteed() {\n this.customerResource = this.createCustomer();\n\n return this.unzerInstance.InvoiceSecured();\n }\n\n /**\n * Create a new Invoice Factoring Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/invoice-ui-integration\n * @returns {{createResource: Function}} Invoice Payment Type\n */\n createInvoiceFactoring() {\n this.customerResource = this.createCustomer();\n\n return this.unzerInstance.InvoiceSecured();\n }\n\n /**\n * Create a new SEPA Direct Debit Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/sepa-direct-debit-ui-integration\n * @returns {{createResource: Function}} SEPA Direct Debit Payment Type\n */\n createSepa() {\n var Sepa = this.unzerInstance.SepaDirectDebit();\n Sepa.create('sepa-direct-debit', {\n containerId: 'sepa-IBAN'\n });\n\n /** @type {HTMLElement} continueButton */\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n Sepa.addEventListener('change', (e) => {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n this.errorHandler.hide();\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n return Sepa;\n }\n\n /**\n * Create a new SEPA Direct Debit (guaranteed) Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/sepa-direct-debit-ui-integration\n * @returns {{createResource: Function}} SEPA Direct Debit (guaranteed) Payment Type\n */\n createSepaGuaranteed() {\n var SepaGuaranteed = this.unzerInstance.SepaDirectDebitSecured();\n SepaGuaranteed.create('sepa-direct-debit-guaranteed', {\n containerId: 'sepa-guaranteed-IBAN'\n });\n\n /** @type {HTMLElement} continueButton */\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n SepaGuaranteed.addEventListener('change', (e) => {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n this.errorHandler.hide();\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n this.customerResource = this.createCustomer();\n\n return SepaGuaranteed;\n }\n\n /**\n * Create a new PayPal Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/paypal-ui-integration\n * @returns {{createResource: Function}} Papal Payment Type\n */\n createPaypal() {\n var Paypal = this.unzerInstance.Paypal();\n Paypal.create('email', {\n containerId: 'paypal-element-email'\n });\n\n return Paypal;\n }\n\n /**\n * Create a new SOFORT Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#sofort\n * @returns {{createResource: Function}} Sofort Payment Type\n */\n createSofort() {\n return this.unzerInstance.Sofort();\n }\n\n /**\n * Create a new Giropay Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#giropay\n * @returns {{createResource: Function}} Giropay Payment Type\n */\n createGiropay () {\n return this.unzerInstance.Giropay();\n }\n\n /**\n * Create a new Przelewy24 Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#przelewy24\n * @returns {{createResource: Function}} Przelewy24 Payment Type\n */\n createPrzelewy24() {\n return this.unzerInstance.Przelewy24();\n }\n\n /**\n * Create a new iDEAL Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/ideal-ui-integration\n * @returns {{createResource: Function}} iDEAL Payment Type\n */\n createIdeal() {\n var Ideal = this.unzerInstance.Ideal();\n\n Ideal.create('ideal', {\n containerId: 'ideal-element'\n });\n\n /** @type {HTMLElement} continueButton */\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n Ideal.addEventListener('change', (e) => {\n if (e.value) {\n continueButton.removeAttribute('disabled');\n this.errorHandler.hide();\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n return Ideal;\n }\n\n /**\n * Create a new Prepayment Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/prepayment-ui-integration\n * @returns {{createResource: Function}} Prepayment Payment Type\n */\n createPrepayment() {\n return this.unzerInstance.Prepayment();\n }\n\n /**\n * Create a new EPS Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/eps-ui-integration\n * @returns {{createResource: Function}} EPS Payment Type\n */\n createEPS() {\n return this.unzerInstance.EPS();\n }\n\n /**\n * Create a new FlexiPay Direct Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#flexipay-direct\n * @returns {{createResource: Function}} Alipay Payment Type\n */\n createFlexiPayDirect() {\n return this.unzerInstance.FlexiPayDirect();\n }\n\n /**\n * Create a new Alipay Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#alipay\n * @returns {{createResource: Function}} Alipay Payment Type\n */\n createAlipay() {\n return this.unzerInstance.Alipay();\n }\n\n /**\n * Create a new TWINT Payment Type.\n *\n * @see https://docs.unzer.com/payment-methods/twint/accept-twint-ui-component/\n * @returns {{createResource: Function}} Twint Payment Type\n */\n createTwint() {\n return this.unzerInstance.Twint();\n }\n\n /**\n * Create a new Open Banking Payment Type.\n *\n * @returns {{createResource: Function}} Twint Payment Type\n */\n createOpenBanking() {\n return this.unzerInstance.OpenBanking();\n }\n\n /**\n * Create an new WeChat Pay Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#wechat-pay\n * @returns {{createResource: Function}} WeChat Pay Payment Type\n */\n createWeChatPay() {\n return this.unzerInstance.Wechatpay();\n }\n\n /**\n * Create a new Hire Purchase Payment Type.\n *\n * @see https:://docs.heidelpay.com/docs/hire-purchase-ui-integration\n * @returns {{createResource: Function}} Hire Purchase Payment Type\n */\n createHirePurchase() {\n var InstallmentSecured = this.unzerInstance.InstallmentSecured();\n var self = this;\n this.customerResource = this.createCustomer();\n\n /** @type {HTMLElement} continueButton */\n var continueButton = self.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('style', 'display: none');\n continueButton.setAttribute('disabled', true);\n\n InstallmentSecured.create({\n containerId: 'hire-purchase-element',\n amount: this.settings.amount || null,\n currency: this.settings.currency || null,\n effectiveInterest: this.settings.effectiveInterest || null,\n orderDate: this.settings.orderDate || null\n }).then(function (data) {\n // if successful, notify the user that the list of installments was fetched successfully\n // in case you were using a loading element during the fetching process,\n // you can remove it inside this callback function\n })\n .catch(function (response) {\n // sent an error message to the user (fetching installment list failed)\n var msg = '';\n console.error(response.message);\n\n response.error.details.forEach(function(err) {\n console.error('API-Error: ' + err.code);\n msg += err.customerMessage;\n });\n\n self.errorHandler.show(msg);\n });\n\n\n // Listen to UI events\n InstallmentSecured.addEventListener('installmentSecuredEvent', function (e) {\n if (e.action === 'validate') {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n }\n\n if (e.action === 'change-step') {\n if (e.currentSteep === 'plan-list') {\n continueButton.setAttribute('style', 'display: none');\n continueButton.setAttribute('disabled', true);\n return;\n }\n\n continueButton.setAttribute('style', 'display: inline-block');\n }\n });\n\n return InstallmentSecured;\n }\n}\n","import ErrorHandler from \"../utils/errors\";\n\nexport default class GooglePay\n{\n /**\n * @param {string} pubKey\n * @param {GooglePaySettings} settings\n */\n constructor(pubKey, settings) {\n /** @type {GooglePaySettings} */\n this.settings = settings || {};\n\n /** @type {HTMLFormElement} */\n this.form = this.settings.form || document.getElementById('complete_order');\n\n const options = {\n locale: this.settings.locale || 'de-DE'\n };\n\n this.unzerInstance = new unzer(pubKey, options);\n this.errorHandler = new ErrorHandler(this.settings.$errorContainer, this.settings.$errorMessage);\n\n this.createPaymentTypeResource();\n }\n\n createPaymentTypeResource() {\n // Creating a Google Pay instance\n const googlepayInstance = this.unzerInstance.Googlepay();\n\n const paymentData = googlepayInstance.initPaymentDataRequestObject({\n gatewayMerchantId: this.settings.googlepay.gatewayMerchantId,\n merchantInfo: this.settings.googlepay.merchantInfo,\n transactionInfo: this.settings.googlepay.transactionInfo,\n allowedCardNetworks: this.settings.googlepay.allowedCardNetworks,\n allowCreditCards: this.settings.googlepay.allowCreditCards,\n allowPrepaidCards: this.settings.googlepay.allowPrepaidCards,\n buttonOptions: {\n buttonColor: this.settings.googlepay.buttonOptions.buttonColor,\n buttonSizeMode: this.settings.googlepay.buttonOptions.buttonSize,\n },\n onPaymentAuthorizedCallback: (paymentData) => googlepayInstance.createResource(paymentData)\n .then(this.onAuthorizedSuccess.bind(this))\n .catch(this.onAuthorizedFailed.bind(this))\n });\n\n googlepayInstance.create(\n { containerId: 'googlepay-holder' },\n paymentData\n );\n }\n\n /**\n * @param {{id: string}} result\n * @returns {{ status: string }}\n */\n onAuthorizedSuccess(result) {\n // Submit the ID to your server-side integration\n const hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'unzer-payment-type-id');\n hiddenInput.setAttribute('value', result.id);\n\n this.form.appendChild(hiddenInput);\n this.form.submit();\n\n return { status: 'success' };\n }\n\n /**\n * @param {{customerMessage?: string, message?: string, data?: {errors?: Array<{customerMessage?: string}>}}} error\n * @returns {{ status: string, message: string }}\n */\n onAuthorizedFailed(error) {\n let errorMessage = error.customerMessage || error.message || 'Error';\n if (error.data && Array.isArray(error.data.errors) && error.data.errors[0]) {\n errorMessage = error.data.errors[0].customerMessage || 'Error';\n }\n\n this.errorHandler.show(errorMessage);\n\n return {\n status: 'error',\n message: errorMessage || 'Unexpected error'\n };\n }\n}","/**\n * Heidelpay Installment Modal Window Handler\n *\n * @param {string} modalSelector\n * @param {HTMLElement} btn Submit Trigger\n * @param {JQuery} $form\n */\nconst Installment = (modalSelector, btn, $form) => {\n var modal = $(modalSelector);\n\n btn.addEventListener('click', function () {\n $form.trigger('submit');\n });\n\n $form.on('submit', function (e) {\n if (!modal.is(':visible')) {\n e.preventDefault();\n modal.modal('show');\n return false;\n }\n\n return true;\n });\n};\n\nexport default Installment;","export default class Debugging {\n constructor($container) {\n this.$container = $container;\n this.$log = null;\n\n if (!window.UNZER_DEBUG) {\n return;\n }\n\n this.createLogTemplate();\n }\n\n log(context, data = {}) {\n if (!window.UNZER_DEBUG) {\n return;\n }\n\n if (!this.$log) {\n this.createLogTemplate();\n }\n\n this.$log.append(\n '
      • ' + context + '
        ' + JSON.stringify(data,  null, '  ') +  '
      • '\n );\n }\n\n createLogTemplate() {\n this.$container.append(\n $('
          ')\n );\n this.$log = this.$container.find('.debug-log > ul');\n }\n}\n","export default class ErrorHandler {\n /**\n * @param {JQuery|null} $wrapper Wrapper for Container to display error messages in\n * @param {JQuery|null} $holder Container to display error messages in\n */\n constructor($wrapper, $holder) {\n this.$wrapper = $wrapper || $('#error-container');\n this.$holder = $holder || this.$wrapper.find('.alert');\n }\n\n /**\n * Show Error message\n * @param {String} message\n */\n show(message) {\n this.$wrapper.show();\n this.$holder.html(message);\n }\n\n /**\n * Hide error message\n */\n hide() {\n this.$wrapper.hide();\n this.$holder.html();\n }\n}\n","function _classApplyDescriptorGet(receiver, descriptor) {\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n\n return descriptor.value;\n}\n\nmodule.exports = _classApplyDescriptorGet, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _classExtractFieldDescriptor(receiver, privateMap, action) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to \" + action + \" private field on non-instance\");\n }\n\n return privateMap.get(receiver);\n}\n\nmodule.exports = _classExtractFieldDescriptor, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var classApplyDescriptorGet = require(\"./classApplyDescriptorGet.js\");\n\nvar classExtractFieldDescriptor = require(\"./classExtractFieldDescriptor.js\");\n\nfunction _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"get\");\n return classApplyDescriptorGet(receiver, descriptor);\n}\n\nmodule.exports = _classPrivateFieldGet, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;"]} \ No newline at end of file +{"version":3,"sources":["node_modules/browser-pack/_prelude.js","frontend/src/js/app.js","frontend/src/js/payments/applepay.js","frontend/src/js/payments/applepay_v2.js","frontend/src/js/payments/general.js","frontend/src/js/payments/googlepay.js","frontend/src/js/payments/instalment.js","frontend/src/js/utils/debugging.js","frontend/src/js/utils/errors.js","node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js","node_modules/@babel/runtime/helpers/classCallCheck.js","node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js","node_modules/@babel/runtime/helpers/classPrivateFieldGet.js","node_modules/@babel/runtime/helpers/createClass.js","node_modules/@babel/runtime/helpers/defineProperty.js","node_modules/@babel/runtime/helpers/interopRequireDefault.js"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","_applepay","_interopRequireDefault","_applepay_v","_general","_googlepay","_instalment","window","HpPayment","HpInstalment","UnzerApplePay","UnzerApplePayV2","UnzerGooglePay","_errors","_debugging","ApplePaySnippetsDefaults","NOT_SUPPORTED","CANCEL_BY_USER","ApplePay","pubKey","applePayPaymentRequest","snippets","settings","_classCallCheck2","this","Object","assign","options","locale","unzerInstance","unzer","errorHandler","$errorContainer","$errorMessage","debugging","$","UNZER_DEBUG","_isSandbox","config","hasSandboxKey","ApplePaySession","canMakePayments","form","document","getElementById","initPaymentType","bind","addEventListener","on","unsupportedDevice","event","_this","preventDefault","session","log","paymentRequest","onvalidatemerchant","merchantValidationCallback","onpaymentauthorized","applePayAuthorizedCallback","oncancel","show","begin","_this2","validationUrl","JSON","stringify","validationURL","ajax","url","evo","io","ioUrl","method","dataType","data","done","validationResponse","completeMerchantValidation","alert","message","fail","error","statusText","abort","self","unzerApplePayInstance","paymentData","payment","token","createResource","then","createdResource","typeId","id","result","status","transactionStatus","completePayment","STATUS_SUCCESS","hiddenInput","createElement","setAttribute","appendChild","removeEventListener","submit","abortPaymentSession","submitButton","disabled","ariaDisabled","STATUS_FAILURE","applePayInstance","_classPrivateFieldGet2","_errorHandler","_classPrivateMethodGet","_abortPaymentSession","_abortPaymentSession2","console","_debugging2","ApplePayV2","_classPrivateMethodInitSpec","_unsupportedDevice","_applePayAuthorizedCallback","_defineProperty2","_classPrivateFieldInitSpec","writable","value","_unsupportedDevice2","initApplePaySession","_applePayAuthorizedCallback2","UnzerPayment","type","customerId","customerResource","paymentType","handleFormSubmit","autoSubmit","Event","PAYMENT_TYPES","CARD","createCard","INVOICE","createInvoice","INVOICE_GUARANTEED","createInvoiceGuaranteed","INVOICE_FACTORING","createInvoiceFactoring","SEPA","createSepa","SEPA_GUARANTEED","createSepaGuaranteed","PAYPAL","createPaypal","SOFORT","createSofort","GIROPAY","createGiropay","PRZELEWY24","createPrzelewy24","IDEAL","createIdeal","PREPAYMENT","createPrepayment","EPS","createEPS","FLEXIPAY_DIRECT","createFlexiPayDirect","ALIPAY","createAlipay","TWINT","createTwint","WECHAT_PAY","createWeChatPay","HIRE_PURCHASE","createHirePurchase","PAYLATER_INVOICE","createPaylaterInvoice","BANCONTACT","createBancontact","PAYLATER_INSTALLMENT","createPaylaterInstallment","PAYLATER_DIRECT_DEBIT","createPaylaterDirectDebit","OPEN_BANKING","createOpenBanking","resources","push","updateCustomer","createCustomer","Promise","all","hiddenCstInput","isValid","paymentMethodName","continueButton","getAttribute","removeAttribute","paymentTypeName","arguments","undefined","multipleValidation","Customer","isB2B","B2BCustomer","customerObj","customer","containerId","showInfoBox","showHeader","fields","initFormFields","success","update","create","field","find","filter","hide","parent","hideFormFields","paylaterInstallment","PaylaterInstallment","amount","currency","country","currentStep","action","onPaylaterInputValidation","_this3","paylaterInvoice","PaylaterInvoice","customerType","_this4","paylaterDirectDebit","PaylaterDirectDebit","bancontact","Bancontact","styling","fontSize","fontColor","fontFamily","_this5","Card","onlyIframe","formFieldValid","reset","number","expiry","cvc","holder","Invoice","InvoiceSecured","_this6","Sepa","SepaDirectDebit","_this7","SepaGuaranteed","SepaDirectDebitSecured","Paypal","Sofort","Giropay","Przelewy24","_this8","Ideal","Prepayment","FlexiPayDirect","Alipay","Twint","OpenBanking","Wechatpay","InstallmentSecured","effectiveInterest","orderDate","response","msg","details","forEach","err","customerMessage","currentSteep","GooglePay","createPaymentTypeResource","googlepayInstance","Googlepay","initPaymentDataRequestObject","gatewayMerchantId","googlepay","merchantInfo","transactionInfo","allowedCardNetworks","allowCreditCards","allowPrepaidCards","buttonOptions","buttonColor","buttonSizeMode","buttonSize","onPaymentAuthorizedCallback","onAuthorizedSuccess","onAuthorizedFailed","errorMessage","Array","isArray","errors","modalSelector","btn","$form","modal","trigger","is","Debugging","$container","$log","createLogTemplate","context","append","ErrorHandler","$wrapper","$holder","html","receiver","descriptor","get","__esModule","instance","Constructor","TypeError","privateMap","has","classApplyDescriptorGet","classExtractFieldDescriptor","_defineProperties","target","props","enumerable","configurable","defineProperty","key","protoProps","staticProps","prototype","obj","default"],"mappings":"CAAA,WAAA,SAAAA,EAAAC,EAAAC,EAAAC,GAAA,SAAAC,EAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,IAAAE,EAAA,mBAAAC,SAAAA,QAAA,IAAAF,GAAAC,EAAA,OAAAA,EAAAF,GAAA,GAAA,GAAAI,EAAA,OAAAA,EAAAJ,GAAA,GAAA,IAAAK,EAAA,IAAAC,MAAA,uBAAAN,EAAA,KAAA,MAAAK,EAAAE,KAAA,mBAAAF,EAAA,IAAAG,EAAAX,EAAAG,IAAAS,YAAAb,EAAAI,GAA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A,SAAA8U,EAAAC,EAAAC,GACA,IAAA,IAAAzV,EAAA,EAAAA,EAAAyV,EAAA9U,OAAAX,IAAA,CACA,IAAA6U,EAAAY,EAAAzV,GACA6U,EAAAa,WAAAb,EAAAa,aAAA,EACAb,EAAAc,cAAA,EACA,UAAAd,IAAAA,EAAAnM,UAAA,GACApG,OAAAsT,eAAAJ,EAAAX,EAAAgB,IAAAhB,IAaAhU,EAAAJ,QATA,SAAAwU,EAAAa,EAAAC,GAMA,OALAD,GAAAP,EAAAN,EAAAe,UAAAF,GACAC,GAAAR,EAAAN,EAAAc,GACAzT,OAAAsT,eAAAX,EAAA,aACAvM,UAAA,IAEAuM,GAGApU,EAAAJ,QAAAsU,YAAA,EAAAlU,EAAAJ,QAAA,QAAAI,EAAAJ,iCCJAI,EAAAJ,QAfA,SAAAwV,EAAAJ,EAAAlN,GAYA,OAXAkN,KAAAI,EACA3T,OAAAsT,eAAAK,EAAAJ,GACAlN,MAAAA,EACA+M,YAAA,EACAC,cAAA,EACAjN,UAAA,IAGAuN,EAAAJ,GAAAlN,EAGAsN,GAGApV,EAAAJ,QAAAsU,YAAA,EAAAlU,EAAAJ,QAAA,QAAAI,EAAAJ,iCCTAI,EAAAJ,QANA,SAAAwV,GACA,OAAAA,GAAAA,EAAAlB,WAAAkB,GACAC,QAAAD,IAIApV,EAAAJ,QAAAsU,YAAA,EAAAlU,EAAAJ,QAAA,QAAAI,EAAAJ","file":"unzer.min.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i Init Payment Type]', {paymentRequest: this.applePayPaymentRequest});\n\n session.onvalidatemerchant = (event) => {\n this.merchantValidationCallback(event, session);\n };\n\n session.onpaymentauthorized = (event) => {\n this.applePayAuthorizedCallback(event, session);\n };\n\n session.oncancel = (event) => {\n this.debugging.log('[> Cancel]', {event});\n this.errorHandler.show(this.snippets.CANCEL_BY_USER);\n };\n\n session.begin();\n }\n\n /**\n * Call the merchant validation in the server-side integration (apple_pay_merchantvalidation)\n * @param {Event} event\n * @param {ApplePaySession} session\n */\n merchantValidationCallback(event, session) {\n var validationUrl = JSON.stringify(event.validationURL);\n\n this.debugging.log('[> Merchant Validation]', {event});\n\n $.ajax({\n 'url': $.evo.io().options.ioUrl,\n 'method': 'POST',\n 'dataType': 'json',\n 'data': 'io={\"name\":\"apple_pay_merchantvalidation\", \"params\":[' + validationUrl + ']}',\n }).done((validationResponse) => {\n this.debugging.log('[> Merchant Validation Response]', validationResponse);\n\n try {\n session.completeMerchantValidation(validationResponse);\n } catch (e) {\n alert(e.message);\n }\n })\n .fail((error) => {\n this.debugging.log('[> Merchant Validation Error]', error);\n this.errorHandler.show(JSON.stringify(error.statusText));\n session.abort();\n });\n }\n\n /**\n * Create Apple Pay resource with unzer and save the resource id to charge it later.\n *\n * We do this here via AJAX instead of the validateAdditional method in the payment method to set the apple pay\n * session state accordingly.\n *\n * @param {Event} event\n * @param {ApplePaySession} session\n */\n applePayAuthorizedCallback(event, session) {\n // Get payment data from event.\n // \"event.payment\" also contains contact information, if they were set via Apple Pay.\n var self = this;\n var unzerApplePayInstance = this.unzerInstance.ApplePay();\n var paymentData = event.payment.token.paymentData;\n\n this.debugging.log('[> Payment Authorization]', {unzerApplePayInstance, event, paymentData});\n\n // Create an Unzer instance with your public key\n unzerApplePayInstance.createResource(paymentData)\n .then(function (createdResource) {\n // Hand over the type ID to your backend.\n var typeId = JSON.stringify(createdResource.id);\n $.ajax({\n 'url': $.evo.io().options.ioUrl,\n 'method': 'POST',\n 'dataType': 'json',\n 'data': 'io={\"name\":\"apple_pay_payment_authorized\", \"params\":[' + typeId + ']}',\n }).done(function (result) {\n // Handle the transaction respone from backend.\n self.debugging.log('[> Payment Authorization Response]', {result, typeId});\n var status = result.transactionStatus;\n if (status === 'success' || status === 'pending') {\n session.completePayment({ status: window.ApplePaySession.STATUS_SUCCESS });\n\n // Append Payment Resource Id\n const hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'paymentData[resourceId]');\n hiddenInput.setAttribute('value', typeId);\n self.form.appendChild(hiddenInput);\n\n // Submitting the form\n self.form.removeEventListener('submit', self.initPaymentType);\n self.form.submit();\n } else {\n self.abortPaymentSession(session);\n }\n }).fail(function (error) {\n self.errorHandler.show(error.statusText);\n self.abortPaymentSession(session);\n });\n })\n .catch(function (error) {\n self.debugging.log('[> Payment Authorization Error]', error);\n self.errorHandler.show(error.message);\n self.abortPaymentSession(session);\n });\n }\n\n /**\n * Handle Unsupported devices\n */\n unsupportedDevice() {\n this.settings.submitButton.disabled = true;\n this.settings.submitButton.ariaDisabled = true;\n this.errorHandler.show(this.snippets.NOT_SUPPORTED);\n }\n\n /**\n * abort current payment session.\n * @param {ApplePaySession} session\n */\n abortPaymentSession(session) {\n this.debugging.log('[> Abort Payment Session]', { status: window.ApplePaySession.STATUS_FAILURE });\n session.completePayment({ status: window.ApplePaySession.STATUS_FAILURE });\n session.abort();\n }\n}\n","import ErrorHandler from \"../utils/errors\";\nimport Debugging from \"../utils/debugging\";\n\n/** @type {ApplePaySnippets} */\nconst ApplePaySnippetsDefaults = {\n NOT_SUPPORTED: \"This device does not support Apple Pay!\",\n CANCEL_BY_USER: \"Canceled payment process by user!\"\n};\n\nexport default class ApplePayV2 {\n /** @type {ApplePaySettings} */\n settings;\n\n /** @type {ApplePaySnippets} */\n snippets;\n\n /** @type {HTMLFormElement} */\n form;\n\n /** @type {ApplePayPaymentRequest} */\n applePayPaymentRequest;\n\n #errorHandler = new ErrorHandler();\n #debugging = new Debugging($('.unzerUI'));\n\n /**\n * @class\n * @param {String} pubKey\n * @param {ApplePayPaymentRequest} applePayPaymentRequest\n * @param {ApplePaySnippets} snippets\n * @param {ApplePaySettings} settings\n */\n constructor(pubKey, applePayPaymentRequest, snippets, settings) {\n this.settings = settings;\n this.snippets = Object.assign(ApplePaySnippetsDefaults, snippets);\n this.form = this.settings.form || document.getElementById('complete_order');\n this.applePayPaymentRequest = applePayPaymentRequest;\n this.unzerInstance = new unzer(pubKey, {\n locale: this.settings.locale || 'de-DE'\n });\n window.UNZER_DEBUG = !!this.unzerInstance._isSandbox || this.unzerInstance.config.hasSandboxKey; // Enable Debugging in sandbox mode\n\n if (!window.ApplePaySession || !window.ApplePaySession.canMakePayments()) {\n this.#unsupportedDevice();\n return;\n }\n\n // Register Events\n this.initPaymentType = this.initPaymentType.bind(this); // it's a trick! needed in order to overcome the remove event listener\n this.form.addEventListener('submit', this.initPaymentType);\n $('.apple-pay-button').on('click', this.initPaymentType.bind(this));\n }\n\n /**\n * @param {Event} event\n */\n initPaymentType(event) {\n event.preventDefault();\n const applePayInstance = this.unzerInstance.ApplePay();\n const session = applePayInstance.initApplePaySession(this.applePayPaymentRequest); // setup session with default merchant validation\n\n this.#debugging.log('[> Init Payment Type]', { paymentRequest: this.applePayPaymentRequest });\n\n if (!window.ApplePaySession || !window.ApplePaySession.canMakePayments()) {\n this.#unsupportedDevice();\n return;\n }\n\n /** @param {Event} event */\n session.onpaymentauthorized = (event) => {\n this.#applePayAuthorizedCallback(event, applePayInstance, session);\n };\n\n /** @param {Event} event */\n session.oncancel = (event) => {\n this.#debugging.log('[> Cancel]', {event});\n this.#errorHandler.show(this.snippets.CANCEL_BY_USER);\n };\n\n session.begin();\n }\n\n /**\n * Create Apple Pay resource with unzer and save the resource id to charge it later.\n *\n * @param {Event & {payment: {token: {paymentData: object}}}} event\n * @param {Object} applePayInstance\n * @param {ApplePaySession} session\n */\n #applePayAuthorizedCallback(event, applePayInstance, session) {\n const paymentData = event.payment.token.paymentData;\n\n this.#debugging.log('[> Payment Authorization]', { applePayInstance, event, paymentData });\n\n // Create an Unzer instance with your public key\n applePayInstance.createResource(paymentData)\n .then((createdResource) => {\n this.#debugging.log('[> Payment Authorization Resource]', { createdResource });\n session.completePayment({ status: window.ApplePaySession.STATUS_SUCCESS });\n\n // Hand over the payment type ID (createdResource.id)\n const typeId = JSON.stringify(createdResource.id);\n const hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'unzer-payment-type-id');\n hiddenInput.setAttribute('value', typeId);\n\n this.form.appendChild(hiddenInput);\n this.form.removeEventListener('submit', this.initPaymentType);\n this.form.submit();\n })\n .catch(error => {\n this.#debugging.log('[> Payment Authorization Error]', error);\n this.#errorHandler.show(error.message);\n this.#abortPaymentSession(session);\n })\n }\n\n /**\n * abort current payment session.\n * @param {ApplePaySession} session\n */\n #abortPaymentSession(session) {\n this.#debugging.log('[> Abort Payment Session]', { status: window.ApplePaySession.STATUS_FAILURE });\n session.completePayment({ status: window.ApplePaySession.STATUS_FAILURE });\n session.abort();\n }\n\n /**\n * Handle Unsupported devices\n */\n #unsupportedDevice() {\n this.#errorHandler.show(this.snippets.NOT_SUPPORTED);\n console.error(this.snippets.NOT_SUPPORTED);\n }\n}","import ErrorHandler from \"../utils/errors\";\n\nexport default class UnzerPayment {\n static PAYMENT_TYPES = {\n ALIPAY: 'Alipay',\n CARD: 'Card',\n EPS: 'EPS',\n FLEXIPAY_DIRECT: 'FlexiPay Direct',\n HIRE_PURCHASE: 'Hire Purchase',\n PAYPAL: 'Paypal',\n INVOICE: 'Invoice',\n INVOICE_FACTORING: 'Invoice Factoring',\n INVOICE_GUARANTEED: 'Invoice Guaranteed',\n SEPA: 'SEPA',\n SEPA_GUARANTEED: 'SEPA (guaranteed)',\n SOFORT: 'SOFORT',\n GIROPAY: 'Giropay',\n PRZELEWY24: 'Przelewy24',\n IDEAL: 'iDEAL',\n PREPAYMENT: 'Prepayment',\n WECHAT_PAY: 'WeChat Pay',\n PAYLATER_INVOICE: 'Paylater Invoice',\n BANCONTACT: 'Bancontact',\n PAYLATER_INSTALLMENT: 'Paylater Installment',\n PAYLATER_DIRECT_DEBIT: 'Paylater Direct Debit',\n TWINT: 'Twint',\n OPEN_BANKING: 'Open Banking',\n };\n\n /**\n * Heidelpay Payment Class\n *\n * @param {string} pubKey Public Key\n * @param {string} type Payment Type\n * @param {PaymentSettings} settings\n */\n constructor(pubKey, type, settings) {\n /** @type {PaymentSettings} */\n this.settings = settings || {};\n\n var options = {\n locale: this.settings.locale || 'de-DE'\n };\n\n this.unzerInstance = new unzer(pubKey, options);\n this.errorHandler = new ErrorHandler(this.settings.$errorContainer, this.settings.$errorMessage);\n\n /** @type {?string} customerId */\n this.customerId = settings.customerId || null;\n\n /** @type {{createCustomer: Function, updateCustomer: Function}|null} customerResource */\n this.customerResource = null;\n\n /** @type {{createResource: Function}} paymentType */\n this.paymentType = this.initPaymentType(type);\n\n /** @type {HTMLElement} form Form in which the customer enters additional details */\n this.form = this.settings.form || document.getElementById('form_payment_extra');\n\n // Register Events\n this.handleFormSubmit = this.handleFormSubmit.bind(this); // it's a trick! needed in order to overcome the remove event listener\n this.form.addEventListener('submit', this.handleFormSubmit);\n\n if (this.settings.autoSubmit) {\n // this.form.dispatchEvent(new Event('submit')); // Causes endless redirects in some browsers like FF, so we call the callback directly...\n this.handleFormSubmit(new Event('submit'));\n }\n }\n\n /**\n * Init Payment Type\n *\n * @param {string} type\n * @returns {object} payment type\n * @throws Error if there is an unkown payment type\n */\n initPaymentType(type) {\n switch (type) {\n case UnzerPayment.PAYMENT_TYPES.CARD:\n return this.createCard();\n\n case UnzerPayment.PAYMENT_TYPES.INVOICE:\n return this.createInvoice();\n\n case UnzerPayment.PAYMENT_TYPES.INVOICE_GUARANTEED:\n return this.createInvoiceGuaranteed();\n\n case UnzerPayment.PAYMENT_TYPES.INVOICE_FACTORING:\n return this.createInvoiceFactoring();\n\n case UnzerPayment.PAYMENT_TYPES.SEPA:\n return this.createSepa();\n\n case UnzerPayment.PAYMENT_TYPES.SEPA_GUARANTEED:\n return this.createSepaGuaranteed();\n\n case UnzerPayment.PAYMENT_TYPES.PAYPAL:\n return this.createPaypal();\n\n case UnzerPayment.PAYMENT_TYPES.SOFORT:\n return this.createSofort();\n\n case UnzerPayment.PAYMENT_TYPES.GIROPAY:\n return this.createGiropay();\n\n case UnzerPayment.PAYMENT_TYPES.PRZELEWY24:\n return this.createPrzelewy24();\n\n case UnzerPayment.PAYMENT_TYPES.IDEAL:\n return this.createIdeal();\n\n case UnzerPayment.PAYMENT_TYPES.PREPAYMENT:\n return this.createPrepayment();\n\n case UnzerPayment.PAYMENT_TYPES.EPS:\n return this.createEPS();\n\n case UnzerPayment.PAYMENT_TYPES.FLEXIPAY_DIRECT:\n return this.createFlexiPayDirect();\n\n case UnzerPayment.PAYMENT_TYPES.ALIPAY:\n return this.createAlipay();\n\n case UnzerPayment.PAYMENT_TYPES.TWINT:\n return this.createTwint();\n\n case UnzerPayment.PAYMENT_TYPES.WECHAT_PAY:\n return this.createWeChatPay();\n\n case UnzerPayment.PAYMENT_TYPES.HIRE_PURCHASE:\n return this.createHirePurchase();\n\n case UnzerPayment.PAYMENT_TYPES.PAYLATER_INVOICE:\n return this.createPaylaterInvoice();\n\n case UnzerPayment.PAYMENT_TYPES.BANCONTACT:\n return this.createBancontact();\n\n case UnzerPayment.PAYMENT_TYPES.PAYLATER_INSTALLMENT:\n return this.createPaylaterInstallment();\n\n case UnzerPayment.PAYMENT_TYPES.PAYLATER_DIRECT_DEBIT:\n return this.createPaylaterDirectDebit();\n\n case UnzerPayment.PAYMENT_TYPES.OPEN_BANKING:\n return this.createOpenBanking();\n\n default:\n throw new Error('Unkown Payment Type: ' + type);\n }\n }\n\n /**\n * Handle the form submit\n *\n * @param {Event} event Submit Event\n */\n handleFormSubmit(event) {\n var self = this;\n event.preventDefault();\n\n // Creating a Payment resource and (optional) Customer Resource\n var resources = [this.paymentType.createResource()];\n\n if (this.customerResource) {\n resources.push(this.customerId ? this.customerResource.updateCustomer() : this.customerResource.createCustomer());\n }\n\n Promise.all(resources).then(function (result) {\n // Append Payment Resource Id\n var hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'paymentData[resourceId]');\n hiddenInput.setAttribute('value', result[0].id);\n self.form.appendChild(hiddenInput);\n\n // Append Customer Id\n if (result.length >= 2) {\n var hiddenCstInput = document.createElement('input');\n hiddenCstInput.setAttribute('type', 'hidden');\n hiddenCstInput.setAttribute('name', 'paymentData[customerId]');\n hiddenCstInput.setAttribute('value', result[1].id);\n self.form.appendChild(hiddenCstInput);\n }\n\n // Submitting the form\n self.form.removeEventListener('submit', self.handleFormSubmit);\n self.form.submit();\n })\n .catch(function (error) {\n self.errorHandler.show(error.message);\n });\n }\n\n /**\n * Handle Paylater Input Validation\n * @param {Event} event\n * @param {boolean} isValid\n * @param {String} paymentMethodName\n * @param {HTMLElement} continueButton\n * @returns\n */\n onPaylaterInputValidation(event, isValid, paymentMethodName, continueButton) {\n // console.log(paymentMethodName, { event, isValid, continueButton, 's360-valid': continueButton.getAttribute('data-s360-valid') });\n\n if (isValid) {\n // everything is still valid\n if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n // Customer is already valid -> everything is valid\n if (continueButton.getAttribute('data-s360-valid') == 'customer') {\n continueButton.setAttribute('data-s360-valid', 'all');\n continueButton.removeAttribute('disabled');\n return;\n }\n\n // mark payment method as valid\n continueButton.setAttribute('data-s360-valid', paymentMethodName);\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n\n // only invalidate if the paymentMethodName was valid before\n if (continueButton.getAttribute('data-s360-valid') == paymentMethodName) {\n continueButton.setAttribute('data-s360-valid', 0);\n } else if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.setAttribute('data-s360-valid', 'customer');\n }\n }\n\n /**\n * Create (or update) customer resource.\n *\n * @param {?String} paymentTypeName\n * @param {?String} multipleValidation\n * @see https://docs.heidelpay.com/docs/customer-ui-integration\n * @returns {{createCustomer: Function, updateCustomer: Function}} Customer Resource\n */\n createCustomer(paymentTypeName = null, multipleValidation = false) {\n var Customer = this.settings.isB2B ? this.unzerInstance.B2BCustomer() : this.unzerInstance.Customer();\n var customerObj = this.settings.customer || {};\n var continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n let options = {\n containerId: 'customer',\n showInfoBox: false,\n showHeader: false,\n fields: ['name', 'birthdate']\n };\n\n if (paymentTypeName) {\n options.paymentTypeName = paymentTypeName;\n }\n\n Customer.initFormFields(customerObj);\n if (multipleValidation) {\n continueButton.setAttribute('data-s360-valid', 0);\n\n Customer.addEventListener('validate', (e) => {\n // console.log('customer validate', e, continueButton, continueButton.getAttribute('data-s360-valid'));\n continueButton.setAttribute('disabled', true);\n\n if (e.success) {\n // everything is still valid\n if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n // payment method is already valid -> everything is valid\n if (continueButton.getAttribute('data-s360-valid') == paymentTypeName) {\n continueButton.setAttribute('data-s360-valid', 'all');\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('data-s360-valid', 'customer');\n return;\n }\n\n // only invalidate if the customer was valid before\n if (continueButton.getAttribute('data-s360-valid') == 'customer') {\n continueButton.setAttribute('data-s360-valid', 0);\n } else if (continueButton.getAttribute('data-s360-valid') == 'all') {\n continueButton.setAttribute('data-s360-valid', paymentTypeName);\n }\n });\n } else {\n Customer.addEventListener('validate', (e) => {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n }\n\n if (this.settings.isB2B) {\n options.fields = ['companyInfo'];\n // options = {containerId: 'customer'};\n }\n\n if (this.customerId) {\n Customer.update(this.customerId, options);\n return Customer;\n }\n\n Customer.create(options);\n\n return Customer;\n }\n\n /**\n * Hide form fields from unzer ui component because they are already filled by the shop\n * @param {string} paymentMethodName\n */\n hideFormFields(paymentMethodName) {\n const field = $('#customer');\n\n field.find('.field').filter(\n '.city, .company, :has(.country), .street, .zip, .firstname, .lastname'\n ).hide();\n field.find('.salutation-customer').hide();\n field.find('.firstname, .lastname').parent('.fields').hide();\n field.find('.unzerUI.divider-horizontal:eq(0)').hide();\n field.find('.unzerUI.message.downArrow').hide();\n\n if (paymentMethodName) {\n field.find('.field').filter('.checkbox-billingAddress, .email').hide();\n field.find('.field').filter(\n '.billing-name, .billing-street, .billing-zip, .billing-city, :has(.billing-country)'\n ).hide();\n field.find('.unzerUI.form>.checkboxLabel').hide();\n field.find('.unzerUI.form>.salutation-unzer-' + paymentMethodName + '-customer').hide();\n }\n\n field.find('.companyType').on('change', e => this.hideFormFields(paymentMethodName));\n }\n\n /**\n * Create Paylayter Installment Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/unzer-installment-upl/accept-unzer-installment-ui-component/\n * @returns {{createResource: Function}}\n */\n createPaylaterInstallment() {\n this.customerResource = this.createCustomer('paylater-installment', true);\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n const paylaterInstallment = this.unzerInstance.PaylaterInstallment();\n\n this.hideFormFields('paylater-installment');\n\n paylaterInstallment.create({\n containerId: 'paylater-installment',\n amount: this.settings.amount,\n currency: this.settings.currency,\n country: this.settings.country\n });\n\n paylaterInstallment.addEventListener('paylaterInstallmentEvent', (e) => {\n switch (e.currentStep) {\n case 'plan-list':\n continueButton.setAttribute('disabled', true);\n break;\n\n case 'plan-detail':\n continueButton.setAttribute('disabled', false);\n break;\n\n default:\n break;\n }\n\n const isValid = e.action === 'validate' && e.success;\n this.onPaylaterInputValidation(e, isValid, 'paylater-installment', continueButton);\n });\n\n return paylaterInstallment;\n }\n\n /**\n * Create Paylayter Invoice Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/unzer-invoice-upl/accept-unzer-invoice-upl-ui-component/\n * @returns {{createResource: Function}}\n */\n createPaylaterInvoice() {\n this.customerResource = this.createCustomer('paylater-invoice', true);\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n const paylaterInvoice = this.unzerInstance.PaylaterInvoice();\n\n this.hideFormFields('paylater-invoice');\n\n paylaterInvoice.create({\n containerId: 'paylater-invoice',\n customerType: this.settings.isB2B ? 'B2B' : 'B2C'\n });\n\n paylaterInvoice.addEventListener('change', (e) =>\n this.onPaylaterInputValidation(\n e,\n e.success,\n 'paylater-invoice',\n continueButton\n )\n );\n\n return paylaterInvoice;\n }\n\n /**\n * Create Paylayter Invoice Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/direct-debit-secured/accept-direct-debit-secured-ui-component/\n * @returns {{createResource: Function}}\n */\n createPaylaterDirectDebit() {\n this.customerResource = this.createCustomer('paylater-direct-debit', true);\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n const paylaterDirectDebit = this.unzerInstance.PaylaterDirectDebit();\n\n this.hideFormFields('paylater-direct-debit');\n\n paylaterDirectDebit.create('paylater-direct-debit', {\n containerId: 'paylater-direct-debit',\n customerType: this.settings.isB2B ? 'B2B' : 'B2C'\n });\n\n paylaterDirectDebit.addEventListener('change', (e) =>\n this.onPaylaterInputValidation(\n e,\n e.success,\n 'paylater-direct-debit',\n continueButton\n )\n );\n\n return paylaterDirectDebit;\n }\n\n /**\n * Create Bancontact Payment Type\n *\n * @see https://docs.unzer.com/payment-methods/bancontact/accept-bancontact-ui-component/\n * @returns {{createResource: Function}}\n */\n createBancontact() {\n const bancontact = this.unzerInstance.Bancontact();\n const styling = { fontSize: null, fontColor: null, fontFamily: null };\n\n if (this.settings.styling) {\n styling.fontColor = this.settings.styling.fontColor || null;\n styling.fontSize = this.settings.styling.fontSize || null;\n styling.fontFamily = this.settings.styling.fontFamily || null;\n }\n\n bancontact.create('holder', {\n containerId: 'bancontact-holder',\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n\n return bancontact;\n }\n\n /**\n * Create a new Card Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/credit-card-ui-integration\n * @returns {{createResource: Function}} Card Payment Type\n */\n createCard() {\n var Card = this.unzerInstance.Card();\n var styling = {fontSize: null, fontColor: null, fontFamily: null};\n\n if (this.settings.styling) {\n styling.fontColor = this.settings.styling.fontColor || null;\n styling.fontSize = this.settings.styling.fontSize || null;\n styling.fontFamily = this.settings.styling.fontFamily || null;\n }\n\n Card.create('number', {\n containerId: 'card-element-id-number',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n Card.create('expiry', {\n containerId: 'card-element-id-expiry',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n Card.create('cvc', {\n containerId: 'card-element-id-cvc',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n // fontFamily: styling.fontFamily // messes with hidden font in firefox\n });\n Card.create('holder', {\n containerId: 'card-element-id-holder',\n onlyIframe: false,\n fontSize: styling.fontSize,\n fontColor: styling.fontColor,\n fontFamily: styling.fontFamily\n });\n\n // Enable pay button initially\n var formFieldValid = {};\n\n /** @type {HTMLElement} continueButton */\n var continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n Card.addEventListener('change', (e) => {\n if (e.success) {\n formFieldValid[e.type] = true;\n this.errorHandler.hide();\n }\n\n if (e.error) {\n formFieldValid[e.type] = false;\n this.errorHandler.show(e.error);\n }\n\n if (e.reset) {\n formFieldValid[e.type] = false;\n }\n\n if (formFieldValid.number && formFieldValid.expiry && formFieldValid.cvc && formFieldValid.holder) {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n return Card;\n }\n\n /**\n * Create a new Invoice Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/invoice-ui-integration\n * @returns {{createResource: Function}} Invoice Payment Type\n */\n createInvoice() {\n return this.unzerInstance.Invoice();\n }\n\n /**\n * Create a new Invoice Guaranteed Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/invoice-ui-integration\n * @returns {{createResource: Function}} Invoice Payment Type\n */\n createInvoiceGuaranteed() {\n this.customerResource = this.createCustomer();\n\n return this.unzerInstance.InvoiceSecured();\n }\n\n /**\n * Create a new Invoice Factoring Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/invoice-ui-integration\n * @returns {{createResource: Function}} Invoice Payment Type\n */\n createInvoiceFactoring() {\n this.customerResource = this.createCustomer();\n\n return this.unzerInstance.InvoiceSecured();\n }\n\n /**\n * Create a new SEPA Direct Debit Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/sepa-direct-debit-ui-integration\n * @returns {{createResource: Function}} SEPA Direct Debit Payment Type\n */\n createSepa() {\n var Sepa = this.unzerInstance.SepaDirectDebit();\n Sepa.create('sepa-direct-debit', {\n containerId: 'sepa-IBAN'\n });\n\n /** @type {HTMLElement} continueButton */\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n Sepa.addEventListener('change', (e) => {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n this.errorHandler.hide();\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n return Sepa;\n }\n\n /**\n * Create a new SEPA Direct Debit (guaranteed) Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/sepa-direct-debit-ui-integration\n * @returns {{createResource: Function}} SEPA Direct Debit (guaranteed) Payment Type\n */\n createSepaGuaranteed() {\n var SepaGuaranteed = this.unzerInstance.SepaDirectDebitSecured();\n SepaGuaranteed.create('sepa-direct-debit-guaranteed', {\n containerId: 'sepa-guaranteed-IBAN'\n });\n\n /** @type {HTMLElement} continueButton */\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n SepaGuaranteed.addEventListener('change', (e) => {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n this.errorHandler.hide();\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n this.customerResource = this.createCustomer();\n\n return SepaGuaranteed;\n }\n\n /**\n * Create a new PayPal Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/paypal-ui-integration\n * @returns {{createResource: Function}} Papal Payment Type\n */\n createPaypal() {\n var Paypal = this.unzerInstance.Paypal();\n Paypal.create('email', {\n containerId: 'paypal-element-email'\n });\n\n return Paypal;\n }\n\n /**\n * Create a new SOFORT Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#sofort\n * @returns {{createResource: Function}} Sofort Payment Type\n */\n createSofort() {\n return this.unzerInstance.Sofort();\n }\n\n /**\n * Create a new Giropay Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#giropay\n * @returns {{createResource: Function}} Giropay Payment Type\n */\n createGiropay () {\n return this.unzerInstance.Giropay();\n }\n\n /**\n * Create a new Przelewy24 Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#przelewy24\n * @returns {{createResource: Function}} Przelewy24 Payment Type\n */\n createPrzelewy24() {\n return this.unzerInstance.Przelewy24();\n }\n\n /**\n * Create a new iDEAL Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/ideal-ui-integration\n * @returns {{createResource: Function}} iDEAL Payment Type\n */\n createIdeal() {\n var Ideal = this.unzerInstance.Ideal();\n\n Ideal.create('ideal', {\n containerId: 'ideal-element'\n });\n\n /** @type {HTMLElement} continueButton */\n const continueButton = this.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('disabled', true);\n\n Ideal.addEventListener('change', (e) => {\n if (e.value) {\n continueButton.removeAttribute('disabled');\n this.errorHandler.hide();\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n });\n\n return Ideal;\n }\n\n /**\n * Create a new Prepayment Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/prepayment-ui-integration\n * @returns {{createResource: Function}} Prepayment Payment Type\n */\n createPrepayment() {\n return this.unzerInstance.Prepayment();\n }\n\n /**\n * Create a new EPS Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/eps-ui-integration\n * @returns {{createResource: Function}} EPS Payment Type\n */\n createEPS() {\n return this.unzerInstance.EPS();\n }\n\n /**\n * Create a new FlexiPay Direct Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#flexipay-direct\n * @returns {{createResource: Function}} Alipay Payment Type\n */\n createFlexiPayDirect() {\n return this.unzerInstance.FlexiPayDirect();\n }\n\n /**\n * Create a new Alipay Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#alipay\n * @returns {{createResource: Function}} Alipay Payment Type\n */\n createAlipay() {\n return this.unzerInstance.Alipay();\n }\n\n /**\n * Create a new TWINT Payment Type.\n *\n * @see https://docs.unzer.com/payment-methods/twint/accept-twint-ui-component/\n * @returns {{createResource: Function}} Twint Payment Type\n */\n createTwint() {\n return this.unzerInstance.Twint();\n }\n\n /**\n * Create a new Open Banking Payment Type.\n *\n * @returns {{createResource: Function}} Twint Payment Type\n */\n createOpenBanking() {\n return this.unzerInstance.OpenBanking();\n }\n\n /**\n * Create an new WeChat Pay Payment Type.\n *\n * @see https://docs.heidelpay.com/docs/redirect-ui-integration#wechat-pay\n * @returns {{createResource: Function}} WeChat Pay Payment Type\n */\n createWeChatPay() {\n return this.unzerInstance.Wechatpay();\n }\n\n /**\n * Create a new Hire Purchase Payment Type.\n *\n * @see https:://docs.heidelpay.com/docs/hire-purchase-ui-integration\n * @returns {{createResource: Function}} Hire Purchase Payment Type\n */\n createHirePurchase() {\n var InstallmentSecured = this.unzerInstance.InstallmentSecured();\n var self = this;\n this.customerResource = this.createCustomer();\n\n /** @type {HTMLElement} continueButton */\n var continueButton = self.settings.submitButton || document.getElementById(\"submit-button\");\n continueButton.setAttribute('style', 'display: none');\n continueButton.setAttribute('disabled', true);\n\n InstallmentSecured.create({\n containerId: 'hire-purchase-element',\n amount: this.settings.amount || null,\n currency: this.settings.currency || null,\n effectiveInterest: this.settings.effectiveInterest || null,\n orderDate: this.settings.orderDate || null\n }).then(function (data) {\n // if successful, notify the user that the list of installments was fetched successfully\n // in case you were using a loading element during the fetching process,\n // you can remove it inside this callback function\n })\n .catch(function (response) {\n // sent an error message to the user (fetching installment list failed)\n var msg = '';\n console.error(response.message);\n\n response.error.details.forEach(function(err) {\n console.error('API-Error: ' + err.code);\n msg += err.customerMessage;\n });\n\n self.errorHandler.show(msg);\n });\n\n\n // Listen to UI events\n InstallmentSecured.addEventListener('installmentSecuredEvent', function (e) {\n if (e.action === 'validate') {\n if (e.success) {\n continueButton.removeAttribute('disabled');\n return;\n }\n\n continueButton.setAttribute('disabled', true);\n }\n\n if (e.action === 'change-step') {\n if (e.currentSteep === 'plan-list') {\n continueButton.setAttribute('style', 'display: none');\n continueButton.setAttribute('disabled', true);\n return;\n }\n\n continueButton.setAttribute('style', 'display: inline-block');\n }\n });\n\n return InstallmentSecured;\n }\n}\n","import ErrorHandler from \"../utils/errors\";\n\nexport default class GooglePay\n{\n /**\n * @param {string} pubKey\n * @param {GooglePaySettings} settings\n */\n constructor(pubKey, settings) {\n /** @type {GooglePaySettings} */\n this.settings = settings || {};\n\n /** @type {HTMLFormElement} */\n this.form = this.settings.form || document.getElementById('complete_order');\n\n const options = {\n locale: this.settings.locale || 'de-DE'\n };\n\n this.unzerInstance = new unzer(pubKey, options);\n this.errorHandler = new ErrorHandler(this.settings.$errorContainer, this.settings.$errorMessage);\n\n this.createPaymentTypeResource();\n }\n\n createPaymentTypeResource() {\n // Creating a Google Pay instance\n const googlepayInstance = this.unzerInstance.Googlepay();\n\n const paymentData = googlepayInstance.initPaymentDataRequestObject({\n gatewayMerchantId: this.settings.googlepay.gatewayMerchantId,\n merchantInfo: this.settings.googlepay.merchantInfo,\n transactionInfo: this.settings.googlepay.transactionInfo,\n allowedCardNetworks: this.settings.googlepay.allowedCardNetworks,\n allowCreditCards: this.settings.googlepay.allowCreditCards,\n allowPrepaidCards: this.settings.googlepay.allowPrepaidCards,\n buttonOptions: {\n buttonColor: this.settings.googlepay.buttonOptions.buttonColor,\n buttonSizeMode: this.settings.googlepay.buttonOptions.buttonSize,\n },\n onPaymentAuthorizedCallback: (paymentData) => googlepayInstance.createResource(paymentData)\n .then(this.onAuthorizedSuccess.bind(this))\n .catch(this.onAuthorizedFailed.bind(this))\n });\n\n googlepayInstance.create(\n { containerId: 'googlepay-holder' },\n paymentData\n );\n }\n\n /**\n * @param {{id: string}} result\n * @returns {{ status: string }}\n */\n onAuthorizedSuccess(result) {\n // Submit the ID to your server-side integration\n const hiddenInput = document.createElement('input');\n hiddenInput.setAttribute('type', 'hidden');\n hiddenInput.setAttribute('name', 'unzer-payment-type-id');\n hiddenInput.setAttribute('value', result.id);\n\n this.form.appendChild(hiddenInput);\n this.form.submit();\n\n return { status: 'success' };\n }\n\n /**\n * @param {{customerMessage?: string, message?: string, data?: {errors?: Array<{customerMessage?: string}>}}} error\n * @returns {{ status: string, message: string }}\n */\n onAuthorizedFailed(error) {\n let errorMessage = error.customerMessage || error.message || 'Error';\n if (error.data && Array.isArray(error.data.errors) && error.data.errors[0]) {\n errorMessage = error.data.errors[0].customerMessage || 'Error';\n }\n\n this.errorHandler.show(errorMessage);\n\n return {\n status: 'error',\n message: errorMessage || 'Unexpected error'\n };\n }\n}","/**\n * Heidelpay Installment Modal Window Handler\n *\n * @param {string} modalSelector\n * @param {HTMLElement} btn Submit Trigger\n * @param {JQuery} $form\n */\nconst Installment = (modalSelector, btn, $form) => {\n var modal = $(modalSelector);\n\n btn.addEventListener('click', function () {\n $form.trigger('submit');\n });\n\n $form.on('submit', function (e) {\n if (!modal.is(':visible')) {\n e.preventDefault();\n modal.modal('show');\n return false;\n }\n\n return true;\n });\n};\n\nexport default Installment;","export default class Debugging {\n constructor($container) {\n this.$container = $container;\n this.$log = null;\n\n if (!window.UNZER_DEBUG) {\n return;\n }\n\n this.createLogTemplate();\n }\n\n log(context, data = {}) {\n if (!window.UNZER_DEBUG) {\n return;\n }\n\n if (!this.$log) {\n this.createLogTemplate();\n }\n\n this.$log.append(\n '
        • ' + context + '
          ' + JSON.stringify(data,  null, '  ') +  '
        • '\n );\n }\n\n createLogTemplate() {\n this.$container.append(\n $('
            ')\n );\n this.$log = this.$container.find('.debug-log > ul');\n }\n}\n","export default class ErrorHandler {\n /**\n * @param {JQuery|null} $wrapper Wrapper for Container to display error messages in\n * @param {JQuery|null} $holder Container to display error messages in\n */\n constructor($wrapper, $holder) {\n this.$wrapper = $wrapper || $('#error-container');\n this.$holder = $holder || this.$wrapper.find('.alert');\n }\n\n /**\n * Show Error message\n * @param {String} message\n */\n show(message) {\n this.$wrapper.show();\n this.$holder.html(message);\n }\n\n /**\n * Hide error message\n */\n hide() {\n this.$wrapper.hide();\n this.$holder.html();\n }\n}\n","function _classApplyDescriptorGet(receiver, descriptor) {\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n\n return descriptor.value;\n}\n\nmodule.exports = _classApplyDescriptorGet, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _classExtractFieldDescriptor(receiver, privateMap, action) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to \" + action + \" private field on non-instance\");\n }\n\n return privateMap.get(receiver);\n}\n\nmodule.exports = _classExtractFieldDescriptor, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var classApplyDescriptorGet = require(\"./classApplyDescriptorGet.js\");\n\nvar classExtractFieldDescriptor = require(\"./classExtractFieldDescriptor.js\");\n\nfunction _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"get\");\n return classApplyDescriptorGet(receiver, descriptor);\n}\n\nmodule.exports = _classPrivateFieldGet, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;"]} \ No newline at end of file diff --git a/frontend/src/js/payments/general.js b/frontend/src/js/payments/general.js index ca7e092..0808764 100644 --- a/frontend/src/js/payments/general.js +++ b/frontend/src/js/payments/general.js @@ -337,6 +337,8 @@ export default class UnzerPayment { field.find('.unzerUI.form>.checkboxLabel').hide(); field.find('.unzerUI.form>.salutation-unzer-' + paymentMethodName + '-customer').hide(); } + + field.find('.companyType').on('change', e => this.hideFormFields(paymentMethodName)); } /** diff --git a/info.xml b/info.xml index a418578..f4abb00 100644 --- a/info.xml +++ b/info.xml @@ -6,7 +6,7 @@ http://www.solution360.de 100 5.0.0 - 1.8.0 + 1.8.1 s360_unzer_shop5 2020-10-27 diff --git a/paymentmethod/UnzerPaylaterInvoice.php b/paymentmethod/UnzerPaylaterInvoice.php index 9f755b4..9d5d364 100644 --- a/paymentmethod/UnzerPaylaterInvoice.php +++ b/paymentmethod/UnzerPaylaterInvoice.php @@ -216,7 +216,7 @@ public function validateAdditional(): bool $shopCustomer->cNachname = $names['lastname'] ?: $shopCustomer->cNachname; if ($this->isB2BCustomer($shopCustomer)) { - $shopCustomer->cBundesland = $customer->getBillingAddress()->getState(); + $shopCustomer->cBundesland = $customer->getBillingAddress()->getState() ?? ''; $shopCustomer->cPLZ = $customer->getBillingAddress()->getZip(); $shopCustomer->cOrt = $customer->getBillingAddress()->getCity(); $shopCustomer->cLand = $customer->getBillingAddress()->getCountry(); diff --git a/src/Foundation/ServiceProvider.php b/src/Foundation/ServiceProvider.php index 533b7b7..203e25a 100644 --- a/src/Foundation/ServiceProvider.php +++ b/src/Foundation/ServiceProvider.php @@ -47,6 +47,8 @@ public function __construct(Container $container) */ public function register(): void { + require_once __DIR__ . '/../../vendor/autoload.php'; + // Wrap Helper in a singleton because it does not cache it (=> many initializations during a request!) $this->app->setSingleton(Config::PLUGIN_ID, function () { return Helper::getPluginById(Config::PLUGIN_ID); diff --git a/src/KeyPairs/KeyPairEntity.php b/src/KeyPairs/KeyPairEntity.php index 0737aea..7322960 100644 --- a/src/KeyPairs/KeyPairEntity.php +++ b/src/KeyPairs/KeyPairEntity.php @@ -46,8 +46,8 @@ public function toObject(): stdClass public static function create(stdClass $data): Entity { $entity = new self( - $data->private_key, - $data->public_key, + trim($data->private_key), + trim($data->public_key), (bool) $data->is_b2b, (int) $data->currency_id, (int) $data->payment_method_id diff --git a/src/Orders/OrderMappingModel.php b/src/Orders/OrderMappingModel.php index de7909e..8b427b9 100644 --- a/src/Orders/OrderMappingModel.php +++ b/src/Orders/OrderMappingModel.php @@ -152,7 +152,7 @@ public function loadOrders(int $limit, int $offset, ?string $search = null): arr $order->kVersandart = (int)$row->kVersandart; $order->kSprache = (int)$row->kSprache; $order->kWaehrung = (int)$row->kWaehrung; - $order->fGuthaben = $row->fGuthaben; + $order->fGuthaben = $row->fGuthaben ?? ''; $order->fGesamtsumme = $row->fGesamtsumme; $order->cSession = $row->cSession; $order->cVersandartName = $row->cVersandartName; @@ -166,13 +166,13 @@ public function loadOrders(int $limit, int $offset, ?string $search = null): arr $order->dBewertungErinnerung = $row->dBewertungErinnerung; $order->cTracking = $row->cTracking; $order->cKommentar = $row->cKommentar; - $order->cLogistiker = $row->cLogistiker; - $order->cTrackingURL = $row->cTrackingURL; - $order->cIP = $row->cIP; - $order->cAbgeholt = $row->cAbgeholt; - $order->cStatus = $row->cStatus; + $order->cLogistiker = $row->cLogistiker ?? ''; + $order->cTrackingURL = $row->cTrackingURL ?? ''; + $order->cIP = $row->cIP ?? ''; + $order->cAbgeholt = $row->cAbgeholt ?? ''; + $order->cStatus = $row->cStatus ? (int)$row->cStatus : null; $order->dErstellt = $row->dErstellt; - $order->fWaehrungsFaktor = $row->fWaehrungsFaktor; + $order->fWaehrungsFaktor = $row->fWaehrungsFaktor ? (float)$row->fWaehrungsFaktor : 1.0; $order->cPUIZahlungsdaten = $row->cPUIZahlungsdaten; if (isset($order->nLongestMinDelivery, $order->nLongestMaxDelivery)) { diff --git a/src/Payments/HeidelpayPaymentMethod.php b/src/Payments/HeidelpayPaymentMethod.php index f20aab4..92dbe92 100644 --- a/src/Payments/HeidelpayPaymentMethod.php +++ b/src/Payments/HeidelpayPaymentMethod.php @@ -5,6 +5,7 @@ use Exception; use JTL\Alert\Alert; +use Plugin\s360_unzer_shop5\src\Foundation\ServiceProvider; use UnzerSDK\Exceptions\UnzerApiException; use UnzerSDK\Resources\PaymentTypes\BasePaymentType; use UnzerSDK\Resources\TransactionTypes\AbstractTransactionType; @@ -115,6 +116,9 @@ public function init($nAgainCheckout = 0): self { parent::init($nAgainCheckout); + // For some reason JTL does not always call the Plugin::boot() method before calling payment methods + (new ServiceProvider(Shop::Container()))->register(); + try { $this->plugin = Shop::Container()->get(Config::PLUGIN_ID); $this->sessionHelper = Shop::Container()->get(SessionHelper::class); diff --git a/src/Payments/PaymentHandler.php b/src/Payments/PaymentHandler.php index f028db1..68960e3 100644 --- a/src/Payments/PaymentHandler.php +++ b/src/Payments/PaymentHandler.php @@ -415,7 +415,7 @@ public function prepareView(): void (int) Frontend::getCurrency()->getID(), (int) Frontend::get('AktiveZahlungsart') ); - $data['publicKey'] = $publicKey ?? $this->adapter->getKeypairService()->getDefaultPublicKey(); + $data['publicKey'] = trim($publicKey ?? $this->adapter->getKeypairService()->getDefaultPublicKey() ?? ''); $smarty->assign('hpPayment', $data); } diff --git a/src/Payments/Traits/HasCustomer.php b/src/Payments/Traits/HasCustomer.php index be54376..2746b1e 100644 --- a/src/Payments/Traits/HasCustomer.php +++ b/src/Payments/Traits/HasCustomer.php @@ -136,7 +136,7 @@ protected function createHeidelpayCustomer(ShopCustomer $customer): Customer */ protected function createHeidelpayAddress($address): Address { - $type = $_SESSION['Bestellung'] && $_SESSION['Bestellung']->kLieferadresse == -1 + $type = isset($_SESSION['Bestellung']) && $_SESSION['Bestellung']->kLieferadresse == -1 ? ShippingTypes::DIFFERENT_ADDRESS : ShippingTypes::EQUALS_BILLING; diff --git a/src/Utils/Logger.php b/src/Utils/Logger.php index dffb03e..1a3473f 100644 --- a/src/Utils/Logger.php +++ b/src/Utils/Logger.php @@ -26,7 +26,7 @@ class Logger */ public static function debug(string $message, array $context = []): void { - self::log($message, LOGLEVEL_DEBUG, $context); + self::log($message, JTLLOG_LEVEL_DEBUG, $context); } /** @@ -38,7 +38,7 @@ public static function debug(string $message, array $context = []): void */ public static function notice(string $message, array $context = []): void { - self::log($message, LOGLEVEL_NOTICE, $context); + self::log($message, JTLLOG_LEVEL_NOTICE, $context); } /** @@ -50,7 +50,7 @@ public static function notice(string $message, array $context = []): void */ public static function error(string $message, array $context = []): void { - self::log($message, LOGLEVEL_ERROR, $context); + self::log($message, JTLLOG_LEVEL_ERROR, $context); } public static function log(string $message, int $level, array $context = []): void diff --git a/src/Utils/TranslatorTrait.php b/src/Utils/TranslatorTrait.php index 061710e..f7c5eed 100644 --- a/src/Utils/TranslatorTrait.php +++ b/src/Utils/TranslatorTrait.php @@ -21,7 +21,7 @@ trait TranslatorTrait * @param string $languageIso * @return string|null */ - public function trans(string $key, string $languageIso = null): ?string + public function trans(string $key, ?string $languageIso = null): ?string { /** @var PluginInterface $plugin */ $plugin = Shop::Container()->get(Config::PLUGIN_ID);