From 0b1dd18b5eef1dfe76f31d1104f4e7d03a70cd5b Mon Sep 17 00:00:00 2001 From: amirinterlutions Date: Thu, 9 Nov 2023 22:14:09 +0100 Subject: [PATCH] [PAYONE-190] merge with master: if the customer has a company address, the birthday is not required --- .github/workflows/archive.yml | 25 +- .github/workflows/main.yml | 104 ++++-- CHANGELOG.md | 19 +- CHANGELOG_de-DE.md | 101 ++--- bin/static-analyze-autoloader.php | 5 +- composer.json | 8 +- ecs.php | 18 +- phpstan.neon | 1 - src/Components/Validator/Birthday.php | 11 +- src/Components/Validator/PaymentMethod.php | 11 +- .../CheckoutConfirmApplePayEventListener.php | 2 +- src/PaymentHandler/PaymentHandlerGroups.php | 4 + .../CaptureRequestParameterBuilder.php | 2 +- .../Handler/NotificationForwardHandler.php | 6 +- src/PayonePayment.php | 26 ++ .../dist/storefront/js/payone-payment.js | 2 +- .../src/klarna/payone-payment.klarna.js | 2 +- .../administration/css/payone-payment.css | 2 +- .../administration/js/payone-payment.js | 2 +- src/Resources/public/static/js/0.js | 2 +- src/Resources/public/static/js/1.js | 2 +- src/Resources/public/static/js/10.js | 2 +- src/Resources/public/static/js/11.js | 2 +- src/Resources/public/static/js/12.js | 2 +- src/Resources/public/static/js/13.js | 1 - src/Resources/public/static/js/2.js | 2 +- src/Resources/public/static/js/3.js | 2 +- src/Resources/public/static/js/4.js | 2 +- src/Resources/public/static/js/5.js | 2 +- src/Resources/public/static/js/6.js | 2 +- src/Resources/public/static/js/7.js | 2 +- src/Resources/public/static/js/8.js | 2 +- src/Resources/public/static/js/9.js | 2 +- .../payolution/consent-checkbox.html.twig | 1 - .../CaptureRequestParameterBuilderTest.php | 22 ++ tests/TestBootstrap.php | 43 ++- tests/TestBootstrapper.php | 350 ------------------ 37 files changed, 266 insertions(+), 528 deletions(-) delete mode 100644 src/Resources/public/static/js/13.js delete mode 100644 tests/TestBootstrapper.php diff --git a/.github/workflows/archive.yml b/.github/workflows/archive.yml index 7af448501..1c30745f5 100644 --- a/.github/workflows/archive.yml +++ b/.github/workflows/archive.yml @@ -1,5 +1,5 @@ name: Create Download on Release -on: +on: release: types: [published] jobs: @@ -8,37 +8,26 @@ jobs: steps: - name: Checkout Master uses: actions/checkout@master - - name: Install PHP - uses: shivammathur/setup-php@master - with: - php-version: 7.4 - extensions: mbstring, xdebug, curl, dom, fileinfo, gd, iconv, intl, json, xml, mbstring, pdo, phar, zip, sodium - tools: composer:v2.2 - - name: Check PHP Version - run: php -v - - name: Check Composer Version - run: composer -V - - name: Check PHP Extensions - run: php -m + - name: Set Tag env run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF:10} env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' + - name: Test tag run: echo ${{ env.RELEASE_VERSION }} + - name: Prepare folder run: | mkdir ./PayonePayment - cp -r src CHANGELOG* README.md composer.json composer.lock ./PayonePayment/ - - name: Composer setup - run: | - cd ./PayonePayment - composer install --no-dev --prefer-dist --no-ansi --no-interaction --no-progress --optimize-autoloader + cp -r src CHANGELOG* README.md composer.json ./PayonePayment/ + - name: Build the zip uses: thedoctor0/zip-release@v0.2.1 with: path: ./PayonePayment/ filename: PayonePayment-${{ env.RELEASE_VERSION }}.zip + - name: Upload zip to release uses: fnkr/github-action-ghr@v1 env: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e87c547d7..245d327c1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,8 +9,14 @@ on: - master workflow_dispatch: +env: + MODULE_NAME: PayonePayment + COMPOSER_NAME: payone-gmbh/shopware-6 + TEST_DATABASE_URL: "mysql://root:root@127.0.0.1:3306/shopware" + jobs: ci-current: + name: SW ${{ matrix.shopware-versions }}, PHP ${{ matrix.php-versions }}, MySQL ${{ matrix.mysql-versions }} runs-on: ubuntu-latest strategy: max-parallel: 15 @@ -19,7 +25,6 @@ jobs: php-versions: [ '8.1', '8.2' ] mysql-versions: [ '5.7', '8.0' ] shopware-versions: [ 'v6.5.0.0', 'v6.5.1.0', 'v6.5.2.0' ] - name: SW ${{ matrix.shopware-versions }}, PHP ${{ matrix.php-versions }}, MySQL ${{ matrix.mysql-versions }} services: mysql: image: mysql:${{ matrix.mysql-versions }} @@ -28,46 +33,81 @@ jobs: MYSQL_ROOT_PASSWORD: root ports: - 3306:3306 + steps: - - name: Checkout - uses: actions/checkout@master - name: Install PHP uses: shivammathur/setup-php@master with: php-version: ${{ matrix.php-versions }} - extensions: mbstring, xdebug, curl, dom, fileinfo, gd, iconv, intl, json, xml, mbstring, pdo, phar, zip, sodium + extensions: mbstring, xdebug, curl, dom, fileinfo, gd, iconv, intl, json, xml, mbstring, pdo, phar, zip, sodium, pdo_mysql tools: composer:2.2 - - name: Check PHP Version + + - name: "Check PHP Version" run: php -v - - name: Check Composer Version + + - name: "Check Composer Version" run: composer -V - - name: Check PHP Extensions + + - name: "Check PHP Extensions" run: php -m - - name: Composer setup - run: composer install --prefer-dist --no-ansi --no-interaction --no-progress --optimize-autoloader - - name: Codestyle - run: composer ecs - - name: SW-Install + + - name: "checkout Shopware" + uses: actions/checkout@v3 + with: + repository: shopware/production + ref: 'flex' + + - name: "Checkout ${{ env.COMPOSER_NAME }}" + uses: actions/checkout@v3 + with: + path: custom/plugins/${{ env.MODULE_NAME }} + + - name: "Get composer cache directory" + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: "Cache Composer dependencies" + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ matrix.operating-system }}-${{ matrix.php-versions }}-${{ matrix.shopware-versions }}-${{ hashFiles('**/composer.lock') }} + + - name: "Install Shopware dependencies" + # Install Shopware with --no-dev to prevent that dev-tools of the module got in conflict with the tools of shopware run: | - composer create-project shopware/production:flex-dev /tmp/shopware -s dev --no-install - composer req shopware/administration:${{ matrix.shopware-versions }} shopware/core:${{ matrix.shopware-versions }} shopware/elasticsearch:${{ matrix.shopware-versions }} shopware/storefront:${{ matrix.shopware-versions }} --no-update -d /tmp/shopware - composer update -d /tmp/shopware - cd /tmp/shopware - printf "APP_ENV=dev\nAPP_URL=http://localhost\nDATABASE_URL=mysql://root:root@127.0.0.1:3306/shopware" > /tmp/shopware/.env.local - php bin/console system:install --basic-setup - - name: Install plugin + composer req shopware/administration:${{ matrix.shopware-versions }} shopware/core:${{ matrix.shopware-versions }} shopware/elasticsearch:${{ matrix.shopware-versions }} shopware/storefront:${{ matrix.shopware-versions }} --no-update + composer install --no-dev + + - name: "Install ${{ env.COMPOSER_NAME }}" + run: composer req ${{ env.COMPOSER_NAME }} + + - name: "Install DEV-Tools" + working-directory: custom/plugins/${{ env.MODULE_NAME }} run: | - mkdir -p /tmp/shopware/custom/plugins/PayonePayment - cp -r * /tmp/shopware/custom/plugins/PayonePayment - cd /tmp/shopware - php bin/console plugin:refresh - php bin/console plugin:install --activate PayonePayment - - name: Static code analyze (phpstan) - run: PROJECT_ROOT=/tmp/shopware composer phpstan - - name: PHPUnit + composer remove shopware/* --no-update + composer install + + - name: "Run PHPStan" + working-directory: custom/plugins/${{ env.MODULE_NAME }} + run: ./vendor/bin/phpstan + + - name: "Check Code style (easy-coding-style)" + working-directory: custom/plugins/${{ env.MODULE_NAME }} + run: ./vendor/bin/ecs + + - name: "Check Code style (rector)" + working-directory: custom/plugins/${{ env.MODULE_NAME }} + run: ./vendor/bin/rector --dry-run + + - name: "Install Shopware" run: | - PROJECT_ROOT=/tmp/shopware \ - TEST_DATABASE_URL="mysql://root:root@127.0.0.1:3306/shopware" \ - /tmp/shopware/custom/plugins/PayonePayment/vendor/bin/phpunit \ - --testdox \ - --configuration /tmp/shopware/custom/plugins/PayonePayment/phpunit.xml.dist + echo APP_ENV=dev >> .env + echo APP_URL=http://localhost >> .env + echo DATABASE_URL=${{ env.TEST_DATABASE_URL }} >> .env + echo APP_SECRET=secretf0rt3st >> .env + bin/console system:install --basic-setup + + - name: "Run PHPUnit Tests" + working-directory: custom/plugins/${{ env.MODULE_NAME }} + run: ./vendor/bin/phpunit --testdox + diff --git a/CHANGELOG.md b/CHANGELOG.md index 189922487..18ff60428 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -338,21 +338,18 @@ Maintenance # 4.2.1 -New Features - -* - Bugfixes -* Payla: fix typo in deviceFingerPrint -* Klarna: change event name of submitting order to prevent default behavior -* Secured Debit/Secured Installment: add validation for IBAN +* Fixed capture for Bancontact +* Fixed typo in dfp snippet for Payla +* Fixed txid in database +* Fixed Klarna event name Maintenance -* add index for transaction-id in transaction-data table for better performance +* tested with 6.4.20.2 -# 5.0.0 +# 5.0.2 New Features @@ -364,4 +361,6 @@ New Features Maintenance -* Tested with 6.5.0.0 +* Tested with 6.5.1.1 +* 1st run tested with 6.5.2.1 +* 2nd run tested with 6.5.3.0 diff --git a/CHANGELOG_de-DE.md b/CHANGELOG_de-DE.md index 0759bdb34..006ed8aa2 100644 --- a/CHANGELOG_de-DE.md +++ b/CHANGELOG_de-DE.md @@ -41,17 +41,17 @@ Bekannte Inkompatibilitäten # 2.0.0 Neue Funktionen - + * Neue Zahlungsmethode: Vorauszahlung * Neue Zahlungsmethode: Paydirekt * Unterstützung des Storno-Zahlungsflusses von Shopware 6.2 - + Fehlerbehebung(en) - + * ein Fehler behoben, durch den bestehende Einstellungen wie die Zuweisung von Zahlungsmethoden nach einem Plugin-Update verloren gehen konnten * falsches Vertriebskanal-Routing von PayPal-Express-Zahlungen korrigiert (thx @boxblinkracer) * verschiedene kleinere Korrekturen - + Wartung * Kompatibilität für Shopware 6.2.x+ @@ -73,17 +73,17 @@ Fehlerbehebung(en) # 2.2.0 Neue Funktionen - + * Kompatibilität mit Shopware 6.4.x - + Fehlerbehebungen - + * API-Test für paydirekt behoben * Lieferadresse bei Paypal-Zahlungen immer angeben -* gefixte Labels für PAYONE Statusmapping (endlich!) - +* gefixte Labels für PAYONE Statusmapping (endlich!) + Wartung - + * getestet mit Shop-Version 6.4.1.0 * bessere Übersetzungen der Fehlermeldungen @@ -91,17 +91,17 @@ Wartung # 2.3.0 Neue Funktionen - + * neue PAYONE Berechtigungsverwaltung * Status Mapping pro Zahlungsmethode möglich - + Fehlerbehebungen - + * Fix für die Freischaltung der Schaltfläche "Jetzt kaufen" * PayPal Express: Telefonnummer ist kein Pflichtfeld mehr - + Wartung - + * getestet mit Shopware 6.4.3.1 * massive Überarbeitungen in der Pluginstruktur * Elasticsearch Kompatibilität hergestellt @@ -181,13 +181,13 @@ Wartung # 3.1.0 Neue Funktionen - + * Neue Zahlungsart: Rechnung * Checkbox für Kreditkartenzahlungen hinzugefügt, um Zahlungsdaten zu speichern Fehlerbehebungen - -* Der Capturemode Parameter wurde entfernt bei abgeschlossenen Zahlungen + +* Der Capturemode Parameter wurde entfernt bei abgeschlossenen Zahlungen * den ZeroAmountCartValidator geupdatet * Data Protection Check wird immer aktiviert @@ -202,14 +202,14 @@ Shopware 6.4.10.0 # 3.2.0 Neue Funktionen - + * Neue Zahlungsart: Bancontact * Bankgruppen Typen für iDEAL hinzugefügt * Regelmäßiges automatisiertes reinigen der redirect Tabelle * Zahlungsziel auf den Standardrechnungen für den Rechnungskauf hinzugefügt - + Fehlerbehebung - + * Versandkosten zu einzelnen Artikeln hinzugefügt * Fehler in Regel zur Entfernung des gesicherten Rechnungskaufs behoben @@ -224,7 +224,7 @@ Neue Funktionen Wartung * Sales Landingpage ins Backend integriert -* Getestet mit 6.4.14 +* Getestet mit 6.4.14 # 4.0.0 @@ -233,17 +233,17 @@ Neue Funktionen * Unterstützung für Shopware 6.3 aufgehoben * Allgemeine Code Optimierungen durchgeführt -* Wichtige Änderung: Die Transaktionsdaten von PAYONE Zahlungen -wurden bisher immer in den Zusatzfeldern der Bestellungen gespeichert. -Da die Zusatzfelder als JSON in der Datenbank gespeichert werden, -war das Durchsuchen der Transaktionsdaten bei großen Datenmengen nicht -sehr performant. Deshalb wurde für die Transaktionsdaten eine Entity -Extension eingerichtet, sodass die Daten in einer extra Datenbanktabelle -gespeichert werden, die deutlich performanter durchsucht werden kann. -Beim Plugin Update werden die alten Zusatzfelder in die Entity Extension -migriert und danach werden die Zusatzfelder gelöscht. Sollten Sie in Ihrem -eigenen Code oder zum Beispiel bei der Synchronisation zu externen Systemen -unsere Zusatzfelder verwendet haben, müssen Sie das auf die neue Entity +* Wichtige Änderung: Die Transaktionsdaten von PAYONE Zahlungen +wurden bisher immer in den Zusatzfeldern der Bestellungen gespeichert. +Da die Zusatzfelder als JSON in der Datenbank gespeichert werden, +war das Durchsuchen der Transaktionsdaten bei großen Datenmengen nicht +sehr performant. Deshalb wurde für die Transaktionsdaten eine Entity +Extension eingerichtet, sodass die Daten in einer extra Datenbanktabelle +gespeichert werden, die deutlich performanter durchsucht werden kann. +Beim Plugin Update werden die alten Zusatzfelder in die Entity Extension +migriert und danach werden die Zusatzfelder gelöscht. Sollten Sie in Ihrem +eigenen Code oder zum Beispiel bei der Synchronisation zu externen Systemen +unsere Zusatzfelder verwendet haben, müssen Sie das auf die neue Entity Extension anpassen. Fehlerbehebung @@ -256,7 +256,7 @@ Wartung * Getestet mit 6.4.16 ### Lesen der Transaktionsdaten ### -``` +``` $criteria = (new Criteria()) ->addAssociation(PayonePaymentOrderTransactionExtension::NAME) ->addFilter(new EqualsFilter(PayonePaymentOrderTransactionExtension::NAME . '.transactionId', $payoneTransactionId)); @@ -284,25 +284,27 @@ $this->transactionRepository->upsert([[ # 4.1.0 Neue Funktionen - + * Neue Zahlungsart: Klarna Rechnung * Neue Zahlungsart: Klarna Sofort * Neue Zahlungsart: Klarna Ratenkauf * Neue Zahlungsart: P24 * Der Kreditkarten - Kartentyp wird nun im Adminbereich bei den Bestelldetails angezeigt - + Fehlerbehebung - + * Fehler in der Weiterleitung behoben, wenn Multi-Saleschannels genutzt werden - Vielen Dank an @patchee500 * Fehler bei Unzer B2B behoben * Fehler beim Refund mit falscher tx_id behoben - + Wartung - + * Getestet mit: 6.4.17.1 # 4.2.0 +Neue Funktionen + * Neue Zahlungsart: PAYONE WeChat Pay * Neue Zahlungsart: PAYONE Postfinance Card * Neue Zahlungsart: PAYONE Postfinance E-Finance @@ -321,9 +323,22 @@ Wartung * Zahlungsartenfilter Technologie verbessert * Geburtstagsfeld aus der Zahlungsart offene Rechnung entfernt * iDEAL Bankliste geupdated -* getestet mit 6.4.20 +* Getestet mit 6.4.20 + +# 4.2.1 + +Fehlerbehebung + +* Fehler beim Capture in Bancontact behoben +* Schreibfehler in dfp snippet für Payla behoben +* Fehler txid in Datenbank behoben +* Fehler Klarna Eventname behoben + +Wartung + +* Getestet mit 6.4.20.2 -# 5.0.0 +# 5.0.2 Neue Funktionen @@ -334,4 +349,6 @@ Neue Funktionen Wartung -* Getestet mit 6.5.0.0 +* Getestet mit 6.5.1.1 +* 1er Lauf getestet mit 6.5.2.1 +* 2ter Lauf getestet mit 6.5.3.0 diff --git a/bin/static-analyze-autoloader.php b/bin/static-analyze-autoloader.php index 9acbcac6f..e36bac880 100644 --- a/bin/static-analyze-autoloader.php +++ b/bin/static-analyze-autoloader.php @@ -2,10 +2,7 @@ use Symfony\Component\Dotenv\Dotenv; -$projectRoot = $_SERVER['PROJECT_ROOT']; -if (!$projectRoot) { - die('Server variable PROJECT_ROOT is missing'); -} +$projectRoot = $_SERVER['PROJECT_ROOT'] ?? dirname(__DIR__, 4); require_once $projectRoot . '/vendor/autoload.php'; diff --git a/composer.json b/composer.json index 23652d6f5..ebaa57584 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "payone-gmbh/shopware-6", "type": "shopware-platform-plugin", "description": "PAYONE Payment Plugin", - "version": "5.0.0", + "version": "5.0.2", "license": "MIT", "authors": [ { @@ -23,9 +23,9 @@ "ext-curl": "*", "ext-json": "*", "sinergi/browser-detector": "^6.1", - "shopware/core": ">= 6.5", - "shopware/administration": ">= 6.5", - "shopware/storefront": ">= 6.5" + "shopware/core": "^6.5.0", + "shopware/administration": "^6.5.0", + "shopware/storefront": "^6.5.0" }, "require-dev": { "dms/phpunit-arraysubset-asserts": "^0.3.0", diff --git a/ecs.php b/ecs.php index 7489b70e2..3384b9899 100644 --- a/ecs.php +++ b/ecs.php @@ -36,12 +36,6 @@ use PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer; use PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer; use PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer; -use PhpCsFixerCustomFixers\Fixer\NoImportFromGlobalNamespaceFixer; -use PhpCsFixerCustomFixers\Fixer\NoSuperfluousConcatenationFixer; -use PhpCsFixerCustomFixers\Fixer\NoUselessCommentFixer; -use PhpCsFixerCustomFixers\Fixer\NoUselessParenthesisFixer; -use PhpCsFixerCustomFixers\Fixer\NoUselessStrlenFixer; -use PhpCsFixerCustomFixers\Fixer\SingleSpaceAfterStatementFixer; use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayListItemNewlineFixer; use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayOpenerAndCloserNewlineFixer; use Symplify\CodingStandard\Fixer\ArrayNotation\StandaloneLineInMultilineArrayFixer; @@ -50,6 +44,12 @@ use Symplify\EasyCodingStandard\ValueObject\Set\SetList; return static function (ECSConfig $ecsConfig): void { + + $ecsConfig->paths([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]); + $ecsConfig->sets([ SetList::ARRAY, SetList::CONTROL_STRUCTURES, @@ -75,12 +75,6 @@ DeclareStrictTypesFixer::class, BlankLineBeforeStatementFixer::class, CompactNullableTypehintFixer::class, - NoImportFromGlobalNamespaceFixer::class, - NoSuperfluousConcatenationFixer::class, - NoUselessCommentFixer::class, - SingleSpaceAfterStatementFixer::class, - NoUselessParenthesisFixer::class, - NoUselessStrlenFixer::class, ]); $ecsConfig->ruleWithConfiguration(ClassAttributesSeparationFixer::class, ['elements' => ['property' => 'one', 'method' => 'one']]); diff --git a/phpstan.neon b/phpstan.neon index 20cf3f09a..996da745d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,5 @@ includes: - phpstan-ignore.neon - - vendor/phpstan/phpstan/conf/bleedingEdge.neon parameters: level: 8 diff --git a/src/Components/Validator/Birthday.php b/src/Components/Validator/Birthday.php index 5e71ceab1..26b3f12ca 100644 --- a/src/Components/Validator/Birthday.php +++ b/src/Components/Validator/Birthday.php @@ -14,15 +14,12 @@ class Birthday extends AbstractComparison { final public const TOO_HIGH_ERROR = 'ac2f93c6-f906-47c9-8b09-6f7cf41f4f49'; + protected const ERROR_NAMES = [ + self::TOO_HIGH_ERROR => 'PAYONE_BIRTHDAY_NOT_VALID', + ]; + /** * @phpstan-ignore-next-line */ public $message = 'This value should be less than or equal to {{ compared_value }}.'; - - /** - * @var string[] - */ - protected static $errorNames = [ - self::TOO_HIGH_ERROR => 'PAYONE_BIRTHDAY_NOT_VALID', - ]; } diff --git a/src/Components/Validator/PaymentMethod.php b/src/Components/Validator/PaymentMethod.php index f9b841ef9..0d72879f8 100644 --- a/src/Components/Validator/PaymentMethod.php +++ b/src/Components/Validator/PaymentMethod.php @@ -14,15 +14,12 @@ class PaymentMethod extends AbstractComparison { final public const INVALID_ERROR = '8608fc941e7a4407bc8d259866ca64b4'; + protected const ERROR_NAMES = [ + self::INVALID_ERROR => 'PAYONE_INVALID_PAYMENT_METHOD', + ]; + /** * @phpstan-ignore-next-line */ public $message = 'The selected payment method {{ compared_value }} is not available.'; - - /** - * @var string[] - */ - protected static $errorNames = [ - self::INVALID_ERROR => 'PAYONE_INVALID_PAYMENT_METHOD', - ]; } diff --git a/src/EventListener/CheckoutConfirmApplePayEventListener.php b/src/EventListener/CheckoutConfirmApplePayEventListener.php index 363e4fc07..d50261b86 100644 --- a/src/EventListener/CheckoutConfirmApplePayEventListener.php +++ b/src/EventListener/CheckoutConfirmApplePayEventListener.php @@ -35,7 +35,7 @@ public static function getSubscribedEvents(): array } public function hideApplePayForNonSafariUsers( - AccountPaymentMethodPageLoadedEvent|CheckoutConfirmPageLoadedEvent $event + CheckoutConfirmPageLoadedEvent|AccountPaymentMethodPageLoadedEvent|AccountEditOrderPageLoadedEvent $event ): void { $paymentMethods = $event->getPage()->getPaymentMethods(); diff --git a/src/PaymentHandler/PaymentHandlerGroups.php b/src/PaymentHandler/PaymentHandlerGroups.php index 2127f6249..fada872ab 100644 --- a/src/PaymentHandler/PaymentHandlerGroups.php +++ b/src/PaymentHandler/PaymentHandlerGroups.php @@ -17,4 +17,8 @@ interface PaymentHandlerGroups PayoneSecuredInvoicePaymentHandler::class, PayoneSecuredInstallmentPaymentHandler::class, ]; + public const POSTFINANCE = [ + PayonePostfinanceCardPaymentHandler::class, + PayonePostfinanceWalletPaymentHandler::class, + ]; } diff --git a/src/Payone/RequestParameter/Builder/Capture/CaptureRequestParameterBuilder.php b/src/Payone/RequestParameter/Builder/Capture/CaptureRequestParameterBuilder.php index dbfaf5c34..7bc8b7a1d 100644 --- a/src/Payone/RequestParameter/Builder/Capture/CaptureRequestParameterBuilder.php +++ b/src/Payone/RequestParameter/Builder/Capture/CaptureRequestParameterBuilder.php @@ -98,7 +98,7 @@ public function getRequestParameter(AbstractRequestParameterStruct $arguments): $parameters['settleaccount'] = self::SETTLEACCOUNT_YES; } - if (\in_array($arguments->getPaymentMethod(), PaymentHandlerGroups::BNPL, true)) { + if (\in_array($arguments->getPaymentMethod(), [...PaymentHandlerGroups::BNPL, ...PaymentHandlerGroups::POSTFINANCE], true)) { unset($parameters['capturemode']); } diff --git a/src/Payone/Webhook/Handler/NotificationForwardHandler.php b/src/Payone/Webhook/Handler/NotificationForwardHandler.php index 16097de20..7511127d8 100644 --- a/src/Payone/Webhook/Handler/NotificationForwardHandler.php +++ b/src/Payone/Webhook/Handler/NotificationForwardHandler.php @@ -37,15 +37,13 @@ public function supports(SalesChannelContext $salesChannelContext, array $data): public function process(SalesChannelContext $salesChannelContext, Request $request): void { - $data = $request->request->all(); - - $paymentTransactionId = $this->getPaymentTransactionId((int) $data['txid'], $salesChannelContext); + $paymentTransactionId = $this->getPaymentTransactionId($request->request->getInt('txid'), $salesChannelContext); if ($paymentTransactionId === null) { return; } - $notificationTargets = $this->getRelevantNotificationTargets($data['txaction'], $salesChannelContext); + $notificationTargets = $this->getRelevantNotificationTargets($request->request->getAlnum('txaction'), $salesChannelContext); if ($notificationTargets === null) { return; diff --git a/src/PayonePayment.php b/src/PayonePayment.php index c8ba846bb..758e6e9ba 100644 --- a/src/PayonePayment.php +++ b/src/PayonePayment.php @@ -20,6 +20,7 @@ use Shopware\Core\System\SystemConfig\SystemConfigService; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; class PayonePayment extends Plugin @@ -73,6 +74,11 @@ public function deactivate(DeactivateContext $deactivateContext): void public function uninstall(UninstallContext $uninstallContext): void { + if (!$this->container instanceof ContainerInterface) { + // symfony 6.4: variable has been set to ContainerInterface|null. + throw new \RuntimeException('container instance missing.'); + } + $this->getConfigInstaller()->uninstall($uninstallContext); $this->getCustomFieldInstaller()->uninstall($uninstallContext); $this->getPaymentMethodInstaller()->uninstall($uninstallContext); @@ -100,6 +106,11 @@ public function executeComposerCommands(): bool private function getRuleInstallerSecureInvoice(): RuleInstallerSecureInvoice { + if (!$this->container instanceof ContainerInterface) { + // symfony 6.4: variable has been set to ContainerInterface|null. + throw new \RuntimeException('container instance missing.'); + } + /** @var EntityRepository $ruleRepository */ $ruleRepository = $this->container->get('rule.repository'); /** @var EntityRepository $countryRepository */ @@ -119,6 +130,11 @@ private function getRuleInstallerSecureInvoice(): RuleInstallerSecureInvoice private function getConfigInstaller(): ConfigInstaller { + if (!$this->container instanceof ContainerInterface) { + // symfony 6.4: variable has been set to ContainerInterface|null. + throw new \RuntimeException('container instance missing.'); + } + /** @var SystemConfigService $systemConfigService */ $systemConfigService = $this->container->get(SystemConfigService::class); @@ -127,6 +143,11 @@ private function getConfigInstaller(): ConfigInstaller private function getPaymentMethodInstaller(): PaymentMethodInstaller { + if (!$this->container instanceof ContainerInterface) { + // symfony 6.4: variable has been set to ContainerInterface|null. + throw new \RuntimeException('container instance missing.'); + } + /** @var PluginIdProvider $pluginIdProvider */ $pluginIdProvider = $this->container->get(PluginIdProvider::class); /** @var EntityRepository $paymentMethodRepository */ @@ -149,6 +170,11 @@ private function getPaymentMethodInstaller(): PaymentMethodInstaller private function getCustomFieldInstaller(): CustomFieldInstaller { + if (!$this->container instanceof ContainerInterface) { + // symfony 6.4: variable has been set to ContainerInterface|null. + throw new \RuntimeException('container instance missing.'); + } + /** @var EntityRepository $customFieldSetRepository */ $customFieldSetRepository = $this->container->get('custom_field_set.repository'); /** @var EntityRepository $customFieldRepository */ diff --git a/src/Resources/app/storefront/dist/storefront/js/payone-payment.js b/src/Resources/app/storefront/dist/storefront/js/payone-payment.js index 2478caf48..89c0197ca 100644 --- a/src/Resources/app/storefront/dist/storefront/js/payone-payment.js +++ b/src/Resources/app/storefront/dist/storefront/js/payone-payment.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["payone-payment"],{6726:(e,t,n)=>{var r,i,a,o=n(6285),l=n(1110);class s extends o.Z{init(){this.iframe=null,this.iframeFieldCheckerStarted=!1,this.orderFormDisabled=!0;const e=document.getElementById("payone-request"),t=e.getAttribute("data-payone-language"),n=JSON.parse(e.innerHTML);this._createScript((()=>{const e=this.getClientConfig(t);this.iframe=new window.Payone.ClientApi.HostedIFrames(e,n);const r=document.getElementById("savedpseudocardpan"),i=document.getElementById("confirmOrderForm");r&&r.addEventListener("change",this._handleChangeSavedCard.bind(this)),i&&i.addEventListener("submit",this._handleOrderSubmit.bind(this))}))}getSelectStyle(){return["width: 100%","padding: .5625rem","color: #8798a9","vertical-align: middle","line-height: 1.5","font-weight: 500","background-color: #fff","border: none","border-radius: 3px"]}getFieldStyle(){return["width: 100%","height: 100%","padding: .5625rem","color: #8798a9","vertical-align: middle","line-height: 1.5","font-weight: 500","background-color: #fff","border: none","border-radius: .1875rem"]}getClientConfig(e){return{fields:{cardpan:{selector:"cardpan",type:"text",style:this.getFieldStyle().join("; ")},cardcvc2:{selector:"cardcvc2",type:"password",size:"4",maxlength:"4",length:{V:3,M:3,A:4,D:3,J:0,O:3,P:3,U:3},style:this.getFieldStyle().join("; ")},cardexpiremonth:{selector:"cardexpiremonth",type:"select",size:"2",maxlength:"2",style:this.getSelectStyle().join("; ")},cardexpireyear:{selector:"cardexpireyear",type:"select",style:this.getSelectStyle().join("; ")}},language:window.Payone.ClientApi.Language[e],defaultStyle:{iframe:{height:"100%",width:"100%"}},autoCardtypeDetection:{supportedCardtypes:s.options.supportedCardtypes,callback:this._cardDetectionCallback}}}_cardDetectionCallback(e){if("-"===e||"?"===e)return;const t="https://cdn.pay1.de/cc/"+e.toLowerCase()+"/xl/default.png",n=document.getElementById("errorOutput"),r=document.getElementById("card-logo");r.setAttribute("src",t),n.style.display="none",r.style.display="block"}_createScript(e){const t=document.createElement("script");t.type="text/javascript",t.src="https://secure.pay1.de/client-api/js/v1/payone_hosted.js",t.addEventListener("load",e.bind(this),!1),document.head.appendChild(t)}_handleOrderSubmit(e){document.getElementById("errorOutput").style.display="none";const t=document.getElementById("savedpseudocardpan");if(t&&t.value.length>0)return!0;if(!this.iframe.isComplete()){const t=document.getElementById("iframeErrorOutput");return this.iframeFieldCheckerStarted||setInterval((()=>{this.iframe.isComplete()?t.style.display="none":t.style.display="block"}),250),this.iframeFieldCheckerStarted=!0,this._handleOrderFormError(e),!1}return this.orderFormDisabled?(window.payoneCreditCardCheckCallback=this._payoneCheckCallback.bind(this),this.iframe.creditCardCheck("payoneCreditCardCheckCallback"),this._handleOrderFormError(e),!1):void 0}_handleOrderFormError(e){const t=document.getElementById("confirmFormSubmit");if(e.preventDefault(),t){const e=new l.Z(t);t.disabled=!1,e.remove()}}_handleChangeSavedCard(){const e=document.getElementById("savedpseudocardpan");e.options[e.selectedIndex].value?[...document.getElementsByClassName("credit-card-input")].forEach((function(e){e.classList.add("hide")})):[...document.getElementsByClassName("credit-card-input")].forEach((function(e){e.classList.remove("hide")}))}_payoneCheckCallback(e){if("VALID"===e.status)document.getElementById("pseudocardpan").value=e.pseudocardpan,document.getElementById("truncatedcardpan").value=e.truncatedcardpan,document.getElementById("cardexpiredate").value=e.cardexpiredate,document.getElementById("cardtype").value=e.cardtype,this.orderFormDisabled=!1,document.getElementById("confirmOrderForm").submit();else{const t=document.getElementById("confirmFormSubmit"),n=document.getElementById("errorOutput");t.removeAttribute("disabled"),n.innerHTML=e.errormessage,n.style.display="block"}}}r=s,a={supportedCardtypes:["#","V","A","M","D","J","O","U","P"]},(i=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(i="options"))in r?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a;var d=n(378),c=n(5659),u=n(8254);class m extends o.Z{init(){this.orderFormDisabled=!0,this._client=new u.Z,document.getElementById("confirmOrderForm").addEventListener("submit",this._handleOrderSubmit.bind(this))}_handleOrderSubmit(e){document.getElementById("errorOutput").style.display="none",this.orderFormDisabled&&(this._handleOrderFormError(e),this._getModal(e))}_handleOrderFormError(e){const t=document.getElementById("confirmFormSubmit");if(e.preventDefault(),t){const e=new l.Z(t);t.disabled=!1,e.remove()}}_getModal(e){e.preventDefault(),c.Z.create();const t=this._getRequestData();this._client.abort(),this._client.post(this._getManageMandateUrl(),JSON.stringify(t),(e=>this._openModal(e)))}_submitForm(){this.orderFormDisabled=!1,document.getElementById("confirmOrderForm").submit()}_openModal(e){if((e=JSON.parse(e)).error){const t=document.getElementById("errorOutput");return t.innerHTML=e.error,t.style.display="block",void c.Z.remove()}if("active"===e.mandate.Status)return void this._submitForm();const t=new d.Z(e.modal_content);t.open(this._onOpen.bind(this,t))}_onOpen(e){e.getModal().classList.add("payone-debit-mandate-modal"),window.PluginManager.initializePlugins(),this._registerEvents(),c.Z.remove()}_getRequestData(){return{iban:document.getElementById("iban").value}}_getManageMandateUrl(){return document.getElementById("payone-configuration").getAttribute("data-manage-mandate-url")}_registerEvents(){document.getElementById("mandateSubmit").addEventListener("click",this._onMandateSubmit.bind(this))}_onMandateSubmit(){document.getElementById("accept-mandate").checked&&this._submitForm()}}!function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(m,"options",{editorModalClass:"payone-debit-modal"});class h extends o.Z{init(){this.orderFormDisabled=!0,this._client=new u.Z,this._registerEventListeners()}_registerEventListeners(){const e=document.getElementById("confirmOrderForm");e&&e.addEventListener("submit",this._handleOrderSubmit.bind(this))}_handleOrderSubmit(e){this._hideErrorBox(),this.orderFormDisabled&&(this._validateField(e,"payolutionConsent"),this._validateInput(e,"payolutionBirthday"),e.defaultPrevented||(this._validatePaymentAcceptance(),e.preventDefault()))}_validateField(e,t){const n=document.getElementById(t);n.checked?n.classList.remove("is-invalid"):(n.scrollIntoView({block:"start",behavior:"smooth"}),n.classList.add("is-invalid"),e.preventDefault())}_validateInput(e,t){const n=document.getElementById(t);n.value?n.classList.remove("is-invalid"):(n.scrollIntoView({block:"start",behavior:"smooth"}),n.classList.add("is-invalid"),e.preventDefault())}_validatePaymentAcceptance(){const e=JSON.stringify(this._getRequestData());c.Z.create(),this._client.abort(),this._client.post(this._getValidateUrl(),e,(e=>this._handleValidateResponse(e)))}_handleValidateResponse(e){if(e=JSON.parse(e),c.Z.remove(),"OK"!==e.status)this._showErrorBox();else{const t=document.getElementById("payoneWorkOrder");t&&(t.value=e.workorderid),this._submitForm()}}_getValidateUrl(){return document.getElementById("payone-configuration").getAttribute("data-validate-url")}_showErrorBox(){const e=document.getElementById("payolutionErrorContainer");e&&(e.hidden=!1)}_hideErrorBox(){const e=document.getElementById("payolutionErrorContainer");e&&(e.hidden=!0)}_submitForm(){this.orderFormDisabled=!1,document.getElementById("confirmOrderForm").submit()}_getRequestData(){return{payolutionBirthday:document.getElementById("payolutionBirthday").value}}}class p extends o.Z{init(){this.orderFormDisabled=!0,this._client=new u.Z,this._disableSubmitButton(),this._registerEventListeners()}_registerEventListeners(){const e=document.getElementById("confirmOrderForm"),t=document.getElementById("checkInstallmentButton");e&&e.addEventListener("submit",this._handleOrderSubmit.bind(this)),t&&t.addEventListener("click",this._handleCalculationButtonClick.bind(this))}_handleCalculationButtonClick(e){if(this._hideErrorBox(),this._validateField(e,"payolutionConsent"),this._validateInput(e,"payolutionBirthday"),e.defaultPrevented)return;c.Z.create();const t=JSON.stringify(this._getRequestData());this._client.abort(),this._client.post(this._getCalculationUrl(),t,(e=>this._handleCalculationCallback(e)))}_handleCalculationCallback(e){if(e=JSON.parse(e),c.Z.remove(),"OK"!==e.status)return void this._showErrorBox();const t=document.getElementById("payoneWorkOrder"),n=document.getElementById("payoneCartHash");t.value=e.workorderid,n.value=e.carthash,this._displayInstallmentSelection(e),this._displayCalculationOverview(e),this._registerSelectionEventListeners(),this._enableSecondStep(),this._activateSubmitButton(),this._hideCheckInstallmentButton()}_hideCheckInstallmentButton(){const e=document.getElementById("checkInstallmentButton");e&&e.classList.add("hidden")}_registerSelectionEventListeners(){document.getElementById("payolutionInstallmentDuration").addEventListener("change",(function(e){const t=e.target.value;document.querySelectorAll(".installmentDetail").forEach((function(e){e.dataset.duration===t?e.hidden=!1:e.hidden="hidden"}))}))}_showErrorBox(){const e=document.getElementById("payolutionErrorContainer");e&&(e.hidden=!1)}_hideErrorBox(){const e=document.getElementById("payolutionErrorContainer");e&&(e.hidden=!0)}_enableSecondStep(){document.querySelectorAll(".payolution-installment .hidden").forEach((function(e){e.classList.remove("hidden")}))}_displayInstallmentSelection(e){const t=document.getElementById("installmentSelection");t&&(t.innerHTML=e.installmentSelection)}_displayCalculationOverview(e){const t=document.getElementById("calculationOverview");t&&(t.innerHTML=e.calculationOverview)}_handleOrderSubmit(e){this._validateField(e,"payolutionConsent"),this._validateInput(e,"payolutionBirthday"),this._validateInput(e,"payolutionAccountOwner"),this._validateInput(e,"payolutionIban"),this._validateInput(e,"payolutionBic"),this._validateInput(e,"payolutionInstallmentDuration")}_disableSubmitButton(){this.orderFormDisabled=!0;const e=document.getElementById("confirmFormSubmit");e&&e.setAttribute("disabled","disabled")}_activateSubmitButton(){this.orderFormDisabled=!1;const e=document.getElementById("confirmFormSubmit");e&&e.removeAttribute("disabled")}_getCalculationUrl(){return document.getElementById("payone-configuration").getAttribute("data-calculation-url")}_validateField(e,t){const n=document.getElementById(t);n.checked?n.classList.remove("is-invalid"):(n.scrollIntoView({block:"start",behavior:"smooth"}),n.classList.add("is-invalid"),this._handleOrderFormError(e))}_validateInput(e,t){const n=document.getElementById(t);n.value?n.classList.remove("is-invalid"):(n.scrollIntoView({block:"start",behavior:"smooth"}),n.classList.add("is-invalid"),this._handleOrderFormError(e))}_handleOrderFormError(e){const t=document.getElementById("confirmFormSubmit");if(e.preventDefault(),t){const e=new l.Z(t);t.disabled=!1,e.remove()}}_getRequestData(){const e=document.getElementById("payolutionBirthday"),t=document.getElementById("payoneWorkOrder"),n=document.getElementById("payoneCartHash");return{payolutionBirthday:e.value,workorder:t.value,carthash:n.value}}}var y=n(3206);function b(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class v extends o.Z{init(){null===this.options.supportedNetworks&&(this.options.supportedNetworks=[]),this._httpClient=new u.Z,this.validateMerchantUrl=this.el.dataset.validateMerchantUrl,this.processPaymentUrl=this.el.dataset.processPaymentUrl,this.orderForm=y.Z.querySelector(document,"#confirmOrderForm"),this._registerEventHandler()}createSession(){try{this.session=new ApplePaySession(3,this.options)}catch(e){return void this.handleErrorOnPayment()}this.session.addEventListener("validatemerchant",this.validateMerchant.bind(this)),this.session.addEventListener("paymentauthorized",this.authorizePayment.bind(this))}performPayment(){this.session.begin()}validateMerchant(e){const t=e.validationURL;this._httpClient.abort(),this._httpClient.post(this.validateMerchantUrl,JSON.stringify({validationUrl:t}),(e=>{let t=null;try{t=JSON.parse(e)}catch(e){return void this.handleErrorOnPayment()}t&&t.merchantSessionIdentifier&&t.signature?this.session.completeMerchantValidation(t):this.handleErrorOnPayment()}))}handleErrorOnPayment(){const e=y.Z.querySelector(document,"#payone-apple-pay-error");e.style.display="block",e.scrollIntoView({block:"start"})}authorizePayment(e){let t=y.Z.querySelector(this.orderForm,"input[name='orderId']").value;this._httpClient.abort(),this._httpClient.post(this.processPaymentUrl,JSON.stringify({token:e.payment.token,orderId:t}),(e=>{this.completePayment(e),this.orderForm.submit()}))}completePayment(e){let t="",n="",r="";try{let i=JSON.parse(e);n=i.status,t=i.txid,r=i.userid}catch(e){this.orderForm.submit()}this.updateFormData(n,t,r,e),"APPROVED"!==n&&"PENDING"!==n||this.session.completePayment({status:ApplePaySession.STATUS_SUCCESS,errors:[]}),this.orderForm.submit()}updateFormData(e,t,n,r){y.Z.querySelector(this.orderForm,"input[name='status']").value=e,y.Z.querySelector(this.orderForm,"input[name='txid']").value=t,y.Z.querySelector(this.orderForm,"input[name='userid']").value=n,y.Z.querySelector(this.orderForm,"input[name='response']").value=r}_handleApplePayButtonClick(){this.orderForm.reportValidity()&&(this.createSession(),this.performPayment())}_registerEventHandler(){this.el.addEventListener("click",this._handleApplePayButtonClick.bind(this))}}b(v,"options",{countryCode:"",currencyCode:"",supportedNetworks:[],merchantCapabilities:["supports3DS","supportsDebit","supportsCredit"],total:{label:"",type:"final",amount:"0.01"}}),b(v,"session",void 0),b(v,"client",void 0),b(v,"validateMerchantUrl",void 0),b(v,"processPaymentUrl",void 0),b(v,"orderForm",void 0);class g extends o.Z{init(){this._client=new u.Z,this.ratepayRateInput=y.Z.querySelector(document,this.options.ratepayRateInputSelector),this.calculateInstallmentBtn=y.Z.querySelector(document,this.options.calculateInstallmentBtnSelector),this.ratepayRuntimeInput=y.Z.querySelector(document,this.options.ratepayRuntimeInputSelector),this.ratepayIbanContainer=y.Z.querySelector(document,this.options.ratepayIbanContainerSelector),this.ratepayIbanInput=y.Z.querySelector(document,this.options.ratepayIbanInputSelector),this._registerEventListeners(),this._handleInstallmentRuntimeChange()}_registerEventListeners(){this.calculateInstallmentBtn&&this.calculateInstallmentBtn.addEventListener("click",this._handleCalculateInstallmentButtonClick.bind(this)),this.ratepayRuntimeInput&&this.ratepayRuntimeInput.addEventListener("change",this._handleInstallmentRuntimeChange.bind(this)),$(this.options.ratepayIbanContainerSelector).on("shown.bs.collapse",this._handleOpenedIbanContainer.bind(this)),$(this.options.ratepayIbanContainerSelector).on("hidden.bs.collapse",this._handleClosedIbanContainer.bind(this))}_handleCalculateInstallmentButtonClick(){const e=this.ratepayRateInput.value;this._sendRequest("rate",e)}_handleInstallmentRuntimeChange(){const e=y.Z.querySelector(document,this.options.ratepayRuntimeInputSelector).value;this._sendRequest("time",e)}_sendRequest(e,t){let n={ratepayInstallmentType:e,ratepayInstallmentValue:t};const r=JSON.stringify(n);this._client.abort(),this._client.post("/payone/ratepay/installment/calculation",r,(e=>this._handleCalculationCallback(e)))}_handleCalculationCallback(e){this._replaceCalculationContent(e)}_replaceCalculationContent(e){y.Z.querySelector(document,this.options.ratepayInstallmentPlanContainerSelector).innerHTML=e,this.ratepayInstallmentTable=y.Z.querySelector(document,this.options.ratepayInstallmentTableSelector),this.ratepayRuntimeInput.value=this.ratepayInstallmentTable.dataset.ratepayNumberOfRates,this.ratepayRateInput.value=this.ratepayInstallmentTable.dataset.ratepayRate}_handleOpenedIbanContainer(){this.ratepayIbanInput.required=!0}_handleClosedIbanContainer(){this.ratepayIbanInput.required=!1}}function _(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(g,"options",{ratepayRateInputSelector:"#ratepayRate",ratepayRuntimeInputSelector:"#ratepayRuntime",calculateInstallmentBtnSelector:"#payone-ratepay-calculate-installment-btn",ratepayInstallmentPlanContainerSelector:"#payone-ratepay-installment-plan",ratepayIbanContainerSelector:"#ratepayIbanContainer",ratepayIbanInputSelector:"#ratepayIban",ratepayInstallmentTableSelector:"#ratepayInstallmentTable"});class f extends o.Z{init(){window.klarnaAsyncCallback=this._initKlarnaWidget.bind(this);const e=document.createElement("script");e.src="https://x.klarnacdn.net/kp/lib/v1/api.js",document.body.appendChild(e),this.orderForm=document.getElementById(this.options.selectorFormId),this._registerEventListeners()}_initKlarnaWidget(){Klarna.Payments.init({client_token:this.options.clientToken}),Klarna.Payments.load({container:this.options.selectorContainer,payment_method_category:this.options.paymentMethodIdentifier},(e=>{this.confirmFormSubmit.disabled=!1,ElementLoadingIndicatorUtil.remove(this.el)}))}_registerEventListeners(){this.orderForm&&this.orderForm.addEventListener("beforeSubmit",this._handleOrderSubmit.bind(this))}_handleOrderSubmit(e){e.preventDefault(),Klarna.Payments.authorize({payment_method_category:this.options.paymentMethodIdentifier},{},(e=>{e.approved&&e.authorization_token?(document.querySelector(this.options.selectorTokenInput).value=e.authorization_token,this.orderForm.submit()):e.show_form?new ButtonLoadingIndicator(this.confirmFormSubmit).remove():e.show_form||(window.location.href=window.location.href)}))}}_(f,"options",{clientToken:null,paymentMethodIdentifier:null,selectorContainer:null,selectorTokenInput:'input[name="payoneKlarnaAuthorizationToken"]',selectorFormId:"confirmOrderForm"}),_(f,"orderForm",null),_(f,"confirmFormSubmit",null);const I=window.PluginManager;I.register("PayonePaymentCreditCard",s,"[data-is-payone-credit-card]"),I.register("PayonePaymentDebitCard",m,"[data-is-payone-debit-card]"),I.register("PayonePaymentPayolutionInvoicing",h,"[data-is-payone-payolution-invoicing]"),I.register("PayonePaymentPayolutionInstallment",p,"[data-is-payone-payolution-installment]"),I.register("PayonePaymentApplePay",v,"[data-payone-payment-apple-pay-options]"),I.register("PayonePaymentRatepayInstallment",g,"[data-is-payone-ratepay-installment]"),I.register("PayonePaymentKlarna",f,"[data-payone-payment-klarna]")}},e=>{e.O(0,["vendor-node","vendor-shared"],(()=>{return t=6726,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["payone-payment"],{6726:(e,t,n)=>{var r,i,a,o=n(6285),l=n(1110);class s extends o.Z{init(){this.iframe=null,this.iframeFieldCheckerStarted=!1,this.orderFormDisabled=!0;const e=document.getElementById("payone-request"),t=e.getAttribute("data-payone-language"),n=JSON.parse(e.innerHTML);this._createScript((()=>{const e=this.getClientConfig(t);this.iframe=new window.Payone.ClientApi.HostedIFrames(e,n);const r=document.getElementById("savedpseudocardpan"),i=document.getElementById("confirmOrderForm");r&&r.addEventListener("change",this._handleChangeSavedCard.bind(this)),i&&i.addEventListener("submit",this._handleOrderSubmit.bind(this))}))}getSelectStyle(){return["width: 100%","padding: .5625rem","color: #8798a9","vertical-align: middle","line-height: 1.5","font-weight: 500","background-color: #fff","border: none","border-radius: 3px"]}getFieldStyle(){return["width: 100%","height: 100%","padding: .5625rem","color: #8798a9","vertical-align: middle","line-height: 1.5","font-weight: 500","background-color: #fff","border: none","border-radius: .1875rem"]}getClientConfig(e){return{fields:{cardpan:{selector:"cardpan",type:"text",style:this.getFieldStyle().join("; ")},cardcvc2:{selector:"cardcvc2",type:"password",size:"4",maxlength:"4",length:{V:3,M:3,A:4,D:3,J:0,O:3,P:3,U:3},style:this.getFieldStyle().join("; ")},cardexpiremonth:{selector:"cardexpiremonth",type:"select",size:"2",maxlength:"2",style:this.getSelectStyle().join("; ")},cardexpireyear:{selector:"cardexpireyear",type:"select",style:this.getSelectStyle().join("; ")}},language:window.Payone.ClientApi.Language[e],defaultStyle:{iframe:{height:"100%",width:"100%"}},autoCardtypeDetection:{supportedCardtypes:s.options.supportedCardtypes,callback:this._cardDetectionCallback}}}_cardDetectionCallback(e){if("-"===e||"?"===e)return;const t="https://cdn.pay1.de/cc/"+e.toLowerCase()+"/xl/default.png",n=document.getElementById("errorOutput"),r=document.getElementById("card-logo");r.setAttribute("src",t),n.style.display="none",r.style.display="block"}_createScript(e){const t=document.createElement("script");t.type="text/javascript",t.src="https://secure.pay1.de/client-api/js/v1/payone_hosted.js",t.addEventListener("load",e.bind(this),!1),document.head.appendChild(t)}_handleOrderSubmit(e){document.getElementById("errorOutput").style.display="none";const t=document.getElementById("savedpseudocardpan");if(t&&t.value.length>0)return!0;if(!this.iframe.isComplete()){const t=document.getElementById("iframeErrorOutput");return this.iframeFieldCheckerStarted||setInterval((()=>{this.iframe.isComplete()?t.style.display="none":t.style.display="block"}),250),this.iframeFieldCheckerStarted=!0,this._handleOrderFormError(e),!1}return this.orderFormDisabled?(window.payoneCreditCardCheckCallback=this._payoneCheckCallback.bind(this),this.iframe.creditCardCheck("payoneCreditCardCheckCallback"),this._handleOrderFormError(e),!1):void 0}_handleOrderFormError(e){const t=document.getElementById("confirmFormSubmit");if(e.preventDefault(),t){const e=new l.Z(t);t.disabled=!1,e.remove()}}_handleChangeSavedCard(){const e=document.getElementById("savedpseudocardpan");e.options[e.selectedIndex].value?[...document.getElementsByClassName("credit-card-input")].forEach((function(e){e.classList.add("hide")})):[...document.getElementsByClassName("credit-card-input")].forEach((function(e){e.classList.remove("hide")}))}_payoneCheckCallback(e){if("VALID"===e.status)document.getElementById("pseudocardpan").value=e.pseudocardpan,document.getElementById("truncatedcardpan").value=e.truncatedcardpan,document.getElementById("cardexpiredate").value=e.cardexpiredate,document.getElementById("cardtype").value=e.cardtype,this.orderFormDisabled=!1,document.getElementById("confirmOrderForm").submit();else{const t=document.getElementById("confirmFormSubmit"),n=document.getElementById("errorOutput");t.removeAttribute("disabled"),n.innerHTML=e.errormessage,n.style.display="block"}}}r=s,a={supportedCardtypes:["#","V","A","M","D","J","O","U","P"]},(i=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(i="options"))in r?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a;var d=n(378),c=n(5659),u=n(8254);class m extends o.Z{init(){this.orderFormDisabled=!0,this._client=new u.Z,document.getElementById("confirmOrderForm").addEventListener("submit",this._handleOrderSubmit.bind(this))}_handleOrderSubmit(e){document.getElementById("errorOutput").style.display="none",this.orderFormDisabled&&(this._handleOrderFormError(e),this._getModal(e))}_handleOrderFormError(e){const t=document.getElementById("confirmFormSubmit");if(e.preventDefault(),t){const e=new l.Z(t);t.disabled=!1,e.remove()}}_getModal(e){e.preventDefault(),c.Z.create();const t=this._getRequestData();this._client.abort(),this._client.post(this._getManageMandateUrl(),JSON.stringify(t),(e=>this._openModal(e)))}_submitForm(){this.orderFormDisabled=!1,document.getElementById("confirmOrderForm").submit()}_openModal(e){if((e=JSON.parse(e)).error){const t=document.getElementById("errorOutput");return t.innerHTML=e.error,t.style.display="block",void c.Z.remove()}if("active"===e.mandate.Status)return void this._submitForm();const t=new d.Z(e.modal_content);t.open(this._onOpen.bind(this,t))}_onOpen(e){e.getModal().classList.add("payone-debit-mandate-modal"),window.PluginManager.initializePlugins(),this._registerEvents(),c.Z.remove()}_getRequestData(){return{iban:document.getElementById("iban").value}}_getManageMandateUrl(){return document.getElementById("payone-configuration").getAttribute("data-manage-mandate-url")}_registerEvents(){document.getElementById("mandateSubmit").addEventListener("click",this._onMandateSubmit.bind(this))}_onMandateSubmit(){document.getElementById("accept-mandate").checked&&this._submitForm()}}!function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(m,"options",{editorModalClass:"payone-debit-modal"});class h extends o.Z{init(){this.orderFormDisabled=!0,this._client=new u.Z,this._registerEventListeners()}_registerEventListeners(){const e=document.getElementById("confirmOrderForm");e&&e.addEventListener("submit",this._handleOrderSubmit.bind(this))}_handleOrderSubmit(e){this._hideErrorBox(),this.orderFormDisabled&&(this._validateField(e,"payolutionConsent"),this._validateInput(e,"payolutionBirthday"),e.defaultPrevented||(this._validatePaymentAcceptance(),e.preventDefault()))}_validateField(e,t){const n=document.getElementById(t);n.checked?n.classList.remove("is-invalid"):(n.scrollIntoView({block:"start",behavior:"smooth"}),n.classList.add("is-invalid"),e.preventDefault())}_validateInput(e,t){const n=document.getElementById(t);n.value?n.classList.remove("is-invalid"):(n.scrollIntoView({block:"start",behavior:"smooth"}),n.classList.add("is-invalid"),e.preventDefault())}_validatePaymentAcceptance(){const e=JSON.stringify(this._getRequestData());c.Z.create(),this._client.abort(),this._client.post(this._getValidateUrl(),e,(e=>this._handleValidateResponse(e)))}_handleValidateResponse(e){if(e=JSON.parse(e),c.Z.remove(),"OK"!==e.status)this._showErrorBox();else{const t=document.getElementById("payoneWorkOrder");t&&(t.value=e.workorderid),this._submitForm()}}_getValidateUrl(){return document.getElementById("payone-configuration").getAttribute("data-validate-url")}_showErrorBox(){const e=document.getElementById("payolutionErrorContainer");e&&(e.hidden=!1)}_hideErrorBox(){const e=document.getElementById("payolutionErrorContainer");e&&(e.hidden=!0)}_submitForm(){this.orderFormDisabled=!1,document.getElementById("confirmOrderForm").submit()}_getRequestData(){return{payolutionBirthday:document.getElementById("payolutionBirthday").value}}}class p extends o.Z{init(){this.orderFormDisabled=!0,this._client=new u.Z,this._disableSubmitButton(),this._registerEventListeners()}_registerEventListeners(){const e=document.getElementById("confirmOrderForm"),t=document.getElementById("checkInstallmentButton");e&&e.addEventListener("submit",this._handleOrderSubmit.bind(this)),t&&t.addEventListener("click",this._handleCalculationButtonClick.bind(this))}_handleCalculationButtonClick(e){if(this._hideErrorBox(),this._validateField(e,"payolutionConsent"),this._validateInput(e,"payolutionBirthday"),e.defaultPrevented)return;c.Z.create();const t=JSON.stringify(this._getRequestData());this._client.abort(),this._client.post(this._getCalculationUrl(),t,(e=>this._handleCalculationCallback(e)))}_handleCalculationCallback(e){if(e=JSON.parse(e),c.Z.remove(),"OK"!==e.status)return void this._showErrorBox();const t=document.getElementById("payoneWorkOrder"),n=document.getElementById("payoneCartHash");t.value=e.workorderid,n.value=e.carthash,this._displayInstallmentSelection(e),this._displayCalculationOverview(e),this._registerSelectionEventListeners(),this._enableSecondStep(),this._activateSubmitButton(),this._hideCheckInstallmentButton()}_hideCheckInstallmentButton(){const e=document.getElementById("checkInstallmentButton");e&&e.classList.add("hidden")}_registerSelectionEventListeners(){document.getElementById("payolutionInstallmentDuration").addEventListener("change",(function(e){const t=e.target.value;document.querySelectorAll(".installmentDetail").forEach((function(e){e.dataset.duration===t?e.hidden=!1:e.hidden="hidden"}))}))}_showErrorBox(){const e=document.getElementById("payolutionErrorContainer");e&&(e.hidden=!1)}_hideErrorBox(){const e=document.getElementById("payolutionErrorContainer");e&&(e.hidden=!0)}_enableSecondStep(){document.querySelectorAll(".payolution-installment .hidden").forEach((function(e){e.classList.remove("hidden")}))}_displayInstallmentSelection(e){const t=document.getElementById("installmentSelection");t&&(t.innerHTML=e.installmentSelection)}_displayCalculationOverview(e){const t=document.getElementById("calculationOverview");t&&(t.innerHTML=e.calculationOverview)}_handleOrderSubmit(e){this._validateField(e,"payolutionConsent"),this._validateInput(e,"payolutionBirthday"),this._validateInput(e,"payolutionAccountOwner"),this._validateInput(e,"payolutionIban"),this._validateInput(e,"payolutionBic"),this._validateInput(e,"payolutionInstallmentDuration")}_disableSubmitButton(){this.orderFormDisabled=!0;const e=document.getElementById("confirmFormSubmit");e&&e.setAttribute("disabled","disabled")}_activateSubmitButton(){this.orderFormDisabled=!1;const e=document.getElementById("confirmFormSubmit");e&&e.removeAttribute("disabled")}_getCalculationUrl(){return document.getElementById("payone-configuration").getAttribute("data-calculation-url")}_validateField(e,t){const n=document.getElementById(t);n.checked?n.classList.remove("is-invalid"):(n.scrollIntoView({block:"start",behavior:"smooth"}),n.classList.add("is-invalid"),this._handleOrderFormError(e))}_validateInput(e,t){const n=document.getElementById(t);n.value?n.classList.remove("is-invalid"):(n.scrollIntoView({block:"start",behavior:"smooth"}),n.classList.add("is-invalid"),this._handleOrderFormError(e))}_handleOrderFormError(e){const t=document.getElementById("confirmFormSubmit");if(e.preventDefault(),t){const e=new l.Z(t);t.disabled=!1,e.remove()}}_getRequestData(){const e=document.getElementById("payolutionBirthday"),t=document.getElementById("payoneWorkOrder"),n=document.getElementById("payoneCartHash");return{payolutionBirthday:e.value,workorder:t.value,carthash:n.value}}}var y=n(3206);function b(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class v extends o.Z{init(){null===this.options.supportedNetworks&&(this.options.supportedNetworks=[]),this._httpClient=new u.Z,this.validateMerchantUrl=this.el.dataset.validateMerchantUrl,this.processPaymentUrl=this.el.dataset.processPaymentUrl,this.orderForm=y.Z.querySelector(document,"#confirmOrderForm"),this._registerEventHandler()}createSession(){try{this.session=new ApplePaySession(3,this.options)}catch(e){return void this.handleErrorOnPayment()}this.session.addEventListener("validatemerchant",this.validateMerchant.bind(this)),this.session.addEventListener("paymentauthorized",this.authorizePayment.bind(this))}performPayment(){this.session.begin()}validateMerchant(e){const t=e.validationURL;this._httpClient.abort(),this._httpClient.post(this.validateMerchantUrl,JSON.stringify({validationUrl:t}),(e=>{let t=null;try{t=JSON.parse(e)}catch(e){return void this.handleErrorOnPayment()}t&&t.merchantSessionIdentifier&&t.signature?this.session.completeMerchantValidation(t):this.handleErrorOnPayment()}))}handleErrorOnPayment(){const e=y.Z.querySelector(document,"#payone-apple-pay-error");e.style.display="block",e.scrollIntoView({block:"start"})}authorizePayment(e){let t=y.Z.querySelector(this.orderForm,"input[name='orderId']").value;this._httpClient.abort(),this._httpClient.post(this.processPaymentUrl,JSON.stringify({token:e.payment.token,orderId:t}),(e=>{this.completePayment(e),this.orderForm.submit()}))}completePayment(e){let t="",n="",r="";try{let i=JSON.parse(e);n=i.status,t=i.txid,r=i.userid}catch(e){this.orderForm.submit()}this.updateFormData(n,t,r,e),"APPROVED"!==n&&"PENDING"!==n||this.session.completePayment({status:ApplePaySession.STATUS_SUCCESS,errors:[]}),this.orderForm.submit()}updateFormData(e,t,n,r){y.Z.querySelector(this.orderForm,"input[name='status']").value=e,y.Z.querySelector(this.orderForm,"input[name='txid']").value=t,y.Z.querySelector(this.orderForm,"input[name='userid']").value=n,y.Z.querySelector(this.orderForm,"input[name='response']").value=r}_handleApplePayButtonClick(){this.orderForm.reportValidity()&&(this.createSession(),this.performPayment())}_registerEventHandler(){this.el.addEventListener("click",this._handleApplePayButtonClick.bind(this))}}b(v,"options",{countryCode:"",currencyCode:"",supportedNetworks:[],merchantCapabilities:["supports3DS","supportsDebit","supportsCredit"],total:{label:"",type:"final",amount:"0.01"}}),b(v,"session",void 0),b(v,"client",void 0),b(v,"validateMerchantUrl",void 0),b(v,"processPaymentUrl",void 0),b(v,"orderForm",void 0);class g extends o.Z{init(){this._client=new u.Z,this.ratepayRateInput=y.Z.querySelector(document,this.options.ratepayRateInputSelector),this.calculateInstallmentBtn=y.Z.querySelector(document,this.options.calculateInstallmentBtnSelector),this.ratepayRuntimeInput=y.Z.querySelector(document,this.options.ratepayRuntimeInputSelector),this.ratepayIbanContainer=y.Z.querySelector(document,this.options.ratepayIbanContainerSelector),this.ratepayIbanInput=y.Z.querySelector(document,this.options.ratepayIbanInputSelector),this._registerEventListeners(),this._handleInstallmentRuntimeChange()}_registerEventListeners(){this.calculateInstallmentBtn&&this.calculateInstallmentBtn.addEventListener("click",this._handleCalculateInstallmentButtonClick.bind(this)),this.ratepayRuntimeInput&&this.ratepayRuntimeInput.addEventListener("change",this._handleInstallmentRuntimeChange.bind(this)),$(this.options.ratepayIbanContainerSelector).on("shown.bs.collapse",this._handleOpenedIbanContainer.bind(this)),$(this.options.ratepayIbanContainerSelector).on("hidden.bs.collapse",this._handleClosedIbanContainer.bind(this))}_handleCalculateInstallmentButtonClick(){const e=this.ratepayRateInput.value;this._sendRequest("rate",e)}_handleInstallmentRuntimeChange(){const e=y.Z.querySelector(document,this.options.ratepayRuntimeInputSelector).value;this._sendRequest("time",e)}_sendRequest(e,t){let n={ratepayInstallmentType:e,ratepayInstallmentValue:t};const r=JSON.stringify(n);this._client.abort(),this._client.post("/payone/ratepay/installment/calculation",r,(e=>this._handleCalculationCallback(e)))}_handleCalculationCallback(e){this._replaceCalculationContent(e)}_replaceCalculationContent(e){y.Z.querySelector(document,this.options.ratepayInstallmentPlanContainerSelector).innerHTML=e,this.ratepayInstallmentTable=y.Z.querySelector(document,this.options.ratepayInstallmentTableSelector),this.ratepayRuntimeInput.value=this.ratepayInstallmentTable.dataset.ratepayNumberOfRates,this.ratepayRateInput.value=this.ratepayInstallmentTable.dataset.ratepayRate}_handleOpenedIbanContainer(){this.ratepayIbanInput.required=!0}_handleClosedIbanContainer(){this.ratepayIbanInput.required=!1}}function _(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(g,"options",{ratepayRateInputSelector:"#ratepayRate",ratepayRuntimeInputSelector:"#ratepayRuntime",calculateInstallmentBtnSelector:"#payone-ratepay-calculate-installment-btn",ratepayInstallmentPlanContainerSelector:"#payone-ratepay-installment-plan",ratepayIbanContainerSelector:"#ratepayIbanContainer",ratepayIbanInputSelector:"#ratepayIban",ratepayInstallmentTableSelector:"#ratepayInstallmentTable"});class f extends o.Z{init(){window.klarnaAsyncCallback=this._initKlarnaWidget.bind(this);const e=document.createElement("script");e.src="https://x.klarnacdn.net/kp/lib/v1/api.js",document.body.appendChild(e),this.orderForm=document.getElementById(this.options.selectorFormId),this._registerEventListeners()}_initKlarnaWidget(){Klarna.Payments.init({client_token:this.options.clientToken}),Klarna.Payments.load({container:this.options.selectorContainer,payment_method_category:this.options.paymentMethodIdentifier},(e=>{this.confirmFormSubmit.disabled=!1,ElementLoadingIndicatorUtil.remove(this.el)}))}_registerEventListeners(){this.orderForm&&this.orderForm.addEventListener("submit",this._handleOrderSubmit.bind(this))}_handleOrderSubmit(e){e.preventDefault(),Klarna.Payments.authorize({payment_method_category:this.options.paymentMethodIdentifier},{},(e=>{e.approved&&e.authorization_token?(document.querySelector(this.options.selectorTokenInput).value=e.authorization_token,this.orderForm.submit()):e.show_form?new ButtonLoadingIndicator(this.confirmFormSubmit).remove():e.show_form||(window.location.href=window.location.href)}))}}_(f,"options",{clientToken:null,paymentMethodIdentifier:null,selectorContainer:null,selectorTokenInput:'input[name="payoneKlarnaAuthorizationToken"]',selectorFormId:"confirmOrderForm"}),_(f,"orderForm",null),_(f,"confirmFormSubmit",null);const I=window.PluginManager;I.register("PayonePaymentCreditCard",s,"[data-is-payone-credit-card]"),I.register("PayonePaymentDebitCard",m,"[data-is-payone-debit-card]"),I.register("PayonePaymentPayolutionInvoicing",h,"[data-is-payone-payolution-invoicing]"),I.register("PayonePaymentPayolutionInstallment",p,"[data-is-payone-payolution-installment]"),I.register("PayonePaymentApplePay",v,"[data-payone-payment-apple-pay-options]"),I.register("PayonePaymentRatepayInstallment",g,"[data-is-payone-ratepay-installment]"),I.register("PayonePaymentKlarna",f,"[data-payone-payment-klarna]")}},e=>{e.O(0,["vendor-node","vendor-shared"],(()=>{return t=6726,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/src/Resources/app/storefront/src/klarna/payone-payment.klarna.js b/src/Resources/app/storefront/src/klarna/payone-payment.klarna.js index 8a4f4352a..fe710450e 100644 --- a/src/Resources/app/storefront/src/klarna/payone-payment.klarna.js +++ b/src/Resources/app/storefront/src/klarna/payone-payment.klarna.js @@ -39,7 +39,7 @@ export default class PayonePaymentKlarna extends Plugin { _registerEventListeners() { if (this.orderForm) { - this.orderForm.addEventListener('beforeSubmit', this._handleOrderSubmit.bind(this)); + this.orderForm.addEventListener('submit', this._handleOrderSubmit.bind(this)); } } diff --git a/src/Resources/public/administration/css/payone-payment.css b/src/Resources/public/administration/css/payone-payment.css index d61022e86..a399cb334 100644 --- a/src/Resources/public/administration/css/payone-payment.css +++ b/src/Resources/public/administration/css/payone-payment.css @@ -1 +1 @@ -.payone-ratepay-profile-configurations{margin-top:20px}@media screen and (min-width:768px){.payone-ratepay-profile-configurations{width:50%}}.payone-ratepay-profile-configurations .payone-ratepay-profile-configuration--headline{font-weight:600;margin-top:20px}.payone-ratepay-profile-configurations .sw-description-list dt{text-align:right}.payone-ratepay-profiles .sw-alert{margin:20px auto;width:100%}.payone-payment-detail--capture-modal .sw-modal__body{padding:0}.payone-payment-detail--capture-modal .sw-modal__footer{border-top:1px solid #d1d9e0}.payone-payment-detail--capture-modal .payone-payment-detail--capture-modal--content,.payone-payment-detail--capture-modal .payone-payment-detail--refund-modal--content{padding:20px 30px}.payone-payment-detail--capture-modal .payone-payment-detail--capture-modal--checkbox-shipping-costs{margin-top:3.5rem}.payone-payment-detail--refund-modal .sw-modal__body{padding:0}.payone-payment-detail--refund-modal .sw-modal__footer{border-top:1px solid #d1d9e0}.payone-payment-detail--refund-modal .payone-payment-detail--capture-modal--content,.payone-payment-detail--refund-modal .payone-payment-detail--refund-modal--content{padding:20px 30px}.payone-order-items .sw-data-grid__bulk{display:none}.payone-payment-plugin-icon{height:100%}.payone-feedback__col{padding:0 10px;text-align:center;border-left:1px solid #888}.payone-feedback__icon{margin-bottom:25px}.payone-feedback__icon .sw-icon.sw-icon--large{width:50px;height:50px}.payone-feedback .payone-feedback__col:first-child{border-left:none}.payone-feedback .payone-feedback__desc{font-size:1.1em;letter-spacing:.75px;margin-bottom:25px}.payone-config__wrapper .sw-card .payone-config__collapsible-container{text-align:right}.payone-config__wrapper .sw-card .payone-config__collapsible-container:not(.collapsed){margin-bottom:22px}.payone-config__wrapper .sw-card .payone-config__collapsible-handle{cursor:pointer;color:#52667a;border:1px solid #d1d9e0;border-radius:4px;display:inline-block;width:28px;height:28px;line-height:0;padding:5px}.payone-config__wrapper .sw-card .payone-config__collapsible-handle:hover{background-color:#e3f3ff}.payone-config-reaload__btn{margin:15px 0}.sw-order-payone-card{line-height:15px}.sw-order-payone-card .payone-payment-detail--notification-forwards{margin-top:30px}.sw-order-payone-card dd,.sw-order-payone-card dt{padding:0;border-bottom:none}.sw-order-payone-card dt{font-weight:600}.sw-order-payone-card dt:not(:first-child),.sw-order-payone-card dt:only-of-type{padding-top:10px}.payone-context-button__button{height:48px;line-height:40px}.sw-settings-index__payone-icon{height:40px} \ No newline at end of file +.payone-payment-plugin-icon{height:100%}.payone-ratepay-profile-configurations{margin-top:20px}@media screen and (min-width: 768px){.payone-ratepay-profile-configurations{width:50%}}.payone-ratepay-profile-configurations .payone-ratepay-profile-configuration--headline{font-weight:600;margin-top:20px}.payone-ratepay-profile-configurations .sw-description-list dt{text-align:right}.payone-ratepay-profiles .sw-alert{margin:20px auto;width:100%}.payone-feedback__col{padding:0 10px;text-align:center;border-left:1px solid #888;display:flex;flex-direction:column;justify-content:space-between}.payone-feedback__icon{margin-bottom:25px}.payone-feedback__icon .sw-icon.sw-icon--large{width:50px;height:50px}.payone-feedback .payone-feedback__col:first-child{border-left:none}.payone-feedback .payone-feedback__desc{font-size:1.1em;letter-spacing:.75px;margin-bottom:25px}.payone-config__wrapper .sw-card .payone-config__collapsible-container{text-align:right}.payone-config__wrapper .sw-card .payone-config__collapsible-container:not(.collapsed){margin-bottom:22px}.payone-config__wrapper .sw-card .payone-config__collapsible-handle{cursor:pointer;color:#52667a;border:1px solid #d1d9e0;border-radius:4px;display:inline-block;width:28px;height:28px;line-height:0;padding:5px}.payone-config__wrapper .sw-card .payone-config__collapsible-handle:hover{background-color:#e3f3ff}.payone-config-reaload__btn{margin:15px 0}.payone-payment-detail--capture-modal .sw-modal__body{padding:0}.payone-payment-detail--capture-modal .sw-modal__footer{border-top:1px solid #d1d9e0}.payone-payment-detail--capture-modal .payone-payment-detail--capture-modal--content,.payone-payment-detail--capture-modal .payone-payment-detail--refund-modal--content{padding:20px 30px}.payone-payment-detail--capture-modal .payone-payment-detail--capture-modal--checkbox-shipping-costs{margin-top:3.5rem}.payone-order-items .sw-data-grid__bulk{display:none}.payone-payment-management-card{line-height:15px}.payone-payment-management-card .payone-payment-management-notification-forwards{margin-top:30px}.payone-payment-management-card dt,.payone-payment-management-card dd{padding:0;border-bottom:none}.payone-payment-management-card dt{font-weight:600}.payone-payment-management-card dt:not(:first-child),.payone-payment-management-card dt:only-of-type{padding-top:10px}.payone-payment-detail--refund-modal .sw-modal__body{padding:0}.payone-payment-detail--refund-modal .sw-modal__footer{border-top:1px solid #d1d9e0}.payone-payment-detail--refund-modal .payone-payment-detail--capture-modal--content,.payone-payment-detail--refund-modal .payone-payment-detail--refund-modal--content{padding:20px 30px} diff --git a/src/Resources/public/administration/js/payone-payment.js b/src/Resources/public/administration/js/payone-payment.js index 6f706f48f..124359a0e 100644 --- a/src/Resources/public/administration/js/payone-payment.js +++ b/src/Resources/public/administration/js/payone-payment.js @@ -1 +1 @@ -!function(e){function t(t){for(var n,r,i=t[0],o=t[1],s=0,l=[];s2&&void 0!==arguments[2]?arguments[2]:"payone";return r(this,c),l.call(this,e,t,n)}return t=c,(n=[{key:"requeueNotificationForward",value:function(e){var t="_action/".concat(this.getApiBasePath(),"/requeue-forward");return this.httpClient.post(t,e,{headers:this.getBasicHeaders()}).then((function(e){return u.handleResponse(e)}))}},{key:"capturePayment",value:function(e){var t="_action/".concat(this.getApiBasePath(),"/capture-payment");return this.httpClient.post(t,e,{headers:this.getBasicHeaders()}).then((function(e){return u.handleResponse(e)}))}},{key:"refundPayment",value:function(e){var t="_action/".concat(this.getApiBasePath(),"/refund-payment");return this.httpClient.post(t,e,{headers:this.getBasicHeaders()}).then((function(e){return u.handleResponse(e)}))}}])&&a(t.prototype,n),s&&a(t,s),Object.defineProperty(t,"prototype",{writable:!1}),c}(u);c.addServiceProvider("PayonePaymentService",(function(e){var t=c.getContainer("init");return new p(t.httpClient,e.loginService)}))},"6PZk":function(e,t){try{Shopware.Service("privileges").addPrivilegeMappingEntry({category:"additional_permissions",parent:null,key:"Payone",roles:{payone_order_management:{privileges:["order_transaction:update","order_line_item:update","state_machine_history:create",Shopware.Service("privileges").getPrivileges("order.viewer")],dependencies:[]}}})}catch(e){}},CY1O:function(e){e.exports=JSON.parse('{"payone-payment":{"title":"PAYONE","general":{"mainMenuItemGeneral":"PAYONE","descriptionTextModule":"Einstellungen für PAYONE","headlines":{"ratepayProfiles":"Profile","ratepayProfileConfigurations":"Profil-Konfigurationen"},"label":{"shopId":"Shop-ID","currency":"Währung","error":"Status","invoiceCountry":"Rechnungsland","shippingCountry":"Lieferland","minBasket":"Min. Warenkorb","maxBasket":"Max. Warenkorb","reloadConfigBtn":"Profil-Konfiguration neu laden","reloadConfigInfo":"(Änderungen an der Plugin-Konfiguration werden dabei zuerst gespeichert)"},"actions":{"addShop":"Shop-ID hinzufügen"},"errors":{"existingShopId":"Die eingegebene ShopId existiert bereits.","emptyInputs":"Bitte füllen Sie alle Eingabefelder aus."}},"settingsForm":{"save":"Speichern","test":"API-Zugangsdaten testen","titleSuccess":"Erfolg","titleError":"Fehler","labelShowSpecificStatusMapping":"Statusmappingkonfiguration einblenden","helpTextShowSpecificStatusMapping":"Sie können für jede Zahlungsart ein spezifisches Statusmapping konfigurieren. Existiert eine solche Konfiguration nicht, wird auf die allgemeine Konfiguration zurückgegriffen.","messageSaveError":{"ratepayProfilesUpdateFailed":"Mindestens ein Ratepay Profil konnte nicht erfolgreich gespeichert werden, bitte prüfen Sie Ihre Konfiguration."},"messageTestSuccess":"Die API-Zugangsdaten wurden erfolgreich validiert.","messageTestNoTestedPayments":"Bei der Prüfung wurden keine Zahlarten getestet, weil keine der PAYONE Zahlarten aktiviert ist. Bitte aktivieren Sie mindestens eine PAYONE Zahlart unter Einstellungen --\x3e Shop --\x3e Zahlungsarten.","messageTestError":{"general":"Die API-Zugangsdaten konnten nicht validiert werden.","creditCard":"Die API-Zugangsdaten für PAYONE Kreditkarte sind nicht korrekt.","prepayment":"Die API-Zugangsdaten für PAYONE Vorkasse sind nicht korrekt.","debit":"Die API-Zugangsdaten für PAYONE Lastschrift sind nicht korrekt.","paypalExpress":"Die API-Zugangsdaten für PAYONE PayPal Express sind nicht korrekt.","paypal":"Die API-Zugangsdaten für PAYONE PayPal sind nicht korrekt.","payolutionInstallment":"Die API-Zugangsdaten für PAYONE Unzer Ratenkauf sind nicht korrekt.","payolutionInvoicing":"Die API-Zugangsdaten für PAYONE Unzer Rechnungskauf sind nicht korrekt.","payolutionDebit":"Die API-Zugangsdaten für PAYONE Unzer Lastschrift sind nicht korrekt.","sofort":"Die API-Zugangsdaten für PAYONE Sofort Überweisung sind nicht korrekt.","eps":"Die API-Zugangsdaten für PAYONE eps Überweisung sind nicht korrekt.","iDeal":"Die API-Zugangsdaten für PAYONE iDEAL sind nicht korrekt.","secureInvoice":"Die API-Zugangsdaten für PAYONE Gesicherter Rechnungskauf sind nicht korrekt.","openInvoice":"Die API-Zugangsdaten für PAYONE Rechnungskauf sind nicht korrekt.","paydirekt":"Die API-Zugangsdaten für PAYONE paydirekt sind nicht korrekt.","trustly":"Die API-Zugangsdaten für PAYONE Trustly sind nicht korrekt.","applePay":"Die API-Zugangsdaten für PAYONE Apple Pay sind nicht korrekt.","bancontact":"Die API-Zugangsdaten für PAYONE Bancontact sind nicht korrekt.","ratepayDebit":"Die API-Zugangsdaten für PAYONE Ratepay Lastschrift sind nicht korrekt.","ratepayInstallment":"Die API-Zugangsdaten für PAYONE Ratepay Ratenzahlung sind nicht korrekt.","ratepayInvoicing":"Die API-Zugangsdaten für PAYONE Ratepay Rechnungskauf sind nicht korrekt.","klarnaInvoice":"Die API-Zugangsdaten für PAYONE Klarna Rechnung sind nicht korrekt.","klarnaDirectDebit":"Die API-Zugangsdaten für PAYONE Klarna Sofort bezahlen sind nicht korrekt.","klarnaInstallment":"Die API-Zugangsdaten für PAYONE Klarna Ratenkauf sind nicht korrekt.","przelewy24":"Die API-Zugangsdaten für PAYONE Przelewy24 sind nicht korrekt.","weChatPay":"Die API-Zugangsdaten für PAYONE WeChat Pay sind nicht korrekt.","postfinanceCard":"Die API-Zugangsdaten für PAYONE Postfinance (Card) sind nicht korrekt.","postfinanceWallet":"Die API-Zugangsdaten für PAYONE Postfinance (Wallet) sind nicht korrekt.","alipay":"Die API-Zugangsdaten für PAYONE Alipay sind nicht korrekt.","securedInvoice":"Die API-Zugangsdaten für PAYONE Gesicherter Rechnungskauf sind nicht korrekt.","securedInstallment":"Die API-Zugangsdaten für PAYONE Gesicherter Ratenkauf sind nicht korrekt.","securedDirectDebit":"Die API-Zugangsdaten für PAYONE Gesicherte Lastschrift sind nicht korrekt."}},"supportModal":{"menuButton":"Support","title":"Wie können wir Ihnen helfen?","documentation":{"description":"Lesen Sie unsere Online-Dokumentation","button":"Dokumentation"},"support":{"description":"Kontaktieren Sie unseren Support","button":"Technischer Support"},"repository":{"description":"Melden Sie Fehler und Verbesserungen","button":"GitHub"},"testdata":{"description":"Erstellen Sie hier Ihre persönlichen Testdaten","button":"Testdaten"}},"applePay":{"cert":{"notification":"Für die Nutzung von ApplePay ist ein Zertifikat/Key-Paar zur Authentifizierung des Merchants erforderlich. Die Anlage eines solchen Zertifikats wird hier beschrieben:
\\n https://docs.payone.com/display/public/PLATFORM/Special+Remarks+-+Apple+Pay#SpecialRemarks-ApplePay-Onboarding

\\n\\n Erstellen Sie im Anschluss unter Verwendung des folgenden Befehls eine PEM-Datei des Zertifikates:
\\n
openssl x509 -inform der -in merchant_id.cer -out merchant_id.pem

\\n Hinterlegen Sie das Zertifikat (merchant_id.pem) und den Key (merchant_id.key) in folgendem Verzeichnis:
\\n
%shopwareRoot%/config/apple-pay-cert
"}},"transitionActionNames":{"cancel":"Stornieren","complete":"Abschließen","pay":"Bezahlen","pay_partially":"Teilweise bezahlen","process":"Durchführen","refund":"Rückerstatten","refund_partially":"Teilweise rückerstatten","remind":"Erinnern","reopen":"Wieder öffnen","retour":"Retoure","retour_partially":"Teilweise retounieren","ship":"Versenden","ship_partially":"Teilweise versenden"},"messageNotBlank":"Dieser Wert darf nicht leer sein.","error":{"transaction":{"notFound":"Es wurde keine passende Transaktion gefundend","orderNotFound":"Es wurde keine passende Bestellung gefundend"}}},"sw-privileges":{"additional_permissions":{"Payone":{"label":"PAYONE","payone_order_management":"PAYONE Transaktionsmanagement"}}}}')},GmXf:function(e){e.exports=JSON.parse('{"payonePayment":{"notificationTarget":{"module":{"title":"Payone notification forward","buttonTitle":"Notifications"},"list":{"title":"Notification forward","empty":"No entries","buttonCreate":"Add new notification target"},"detail":{"headline":"Notification forward","placeholder":{"url":"Url","username":"Username","password":"Password"},"label":{"url":"Url","isBasicAuth":"Basic Auth","txactions":"txactions","buttonSave":"Save","buttonCancel":"Cancel","username":"Username","password":"Password"}},"columns":{"url":"Url","isBasicAuth":"Basic Auth","txactions":"txactions"},"actions":{"requeue":"Requeue"},"messages":{"success":"The notification forward has been successfully queued."}}}}')},GqT2:function(e){e.exports=JSON.parse('{"payone-payment":{"title":"PAYONE","general":{"mainMenuItemGeneral":"PAYONE","descriptionTextModule":"Settings for PAYONE","headlines":{"ratepayProfiles":"Profile","ratepayProfileConfigurations":"Profil-Konfigurationen"},"label":{"shopId":"Shop-ID","currency":"Currency","error":"Status","invoiceCountry":"Invoice Country","shippingCountry":"Shipping Country","minBasket":"Min. Basket","maxBasket":"Max. Basket","reloadConfigBtn":"Reload Profile Configuration","reloadConfigInfo":"(Plugin Configuration Changes will be saved first)"},"actions":{"addShop":"Add Shop-ID"},"errors":{"existingShopId":"The entered shop-id already exists.","emptyInputs":"Please fill all input fields."}},"settingsForm":{"save":"Save","test":"Test API Credentials","titleSuccess":"Success","titleError":"Error","labelShowSpecificStatusMapping":"Display state mapping configuration","helpTextShowSpecificStatusMapping":"If not configured the general status mapping config will be applied.","messageSaveError":{"ratepayProfilesUpdateFailed":"At least one Ratepay profile could not be saved successfully, please check your configuration."},"messageTestSuccess":"The API credentials were verified successfully.","messageTestNoTestedPayments":"No payment methods were tested during the check because none of the PAYONE payment methods are activated. Please activate at least one PAYONE payment method under Settings --\x3e Shop --\x3e Payment.","messageTestError":{"general":"The API credentials could not be verified successfully.","creditCard":"The API credentials for PAYONE Credit Card are not valid.","prepayment":"The API credentials for PAYONE Prepayment are not valid.","debit":"The API credentials for PAYONE Direct Debit are not valid.","paypalExpress":"The API credentials for PAYONE PayPal Express are not valid.","paypal":"The API credentials for PAYONE PayPal are not valid.","payolutionInstallment":"The API credentials for PAYONE Unzer Ratenkauf are not valid.","payolutionInvoicing":"The API credentials for PAYONE Unzer Rechnungskauf are not valid.","payolutionDebit":"The API credentials for PAYONE Unzer Lastschrift are not valid.","sofort":"The API credentials for PAYONE Sofort are not valid.","eps":"The API credentials for PAYONE eps are not valid.","iDeal":"The API credentials for PAYONE iDEAL are not valid.","secureInvoice":"The API credentials for PAYONE Secure Invoice are not valid.","openInvoice":"The API credentials for PAYONE Invoice are not valid.","paydirekt":"The API credentials for PAYONE paydirekt are not valid.","trustly":"The API credentials for PAYONE Trustly are not valid.","applePay":"The API credentials for PAYONE Apple Pay are not valid.","bancontact":"The API credentials for PAYONE Bancontact payment are not valid.","ratepayDebit":"The API credentials for PAYONE Ratepay Direct Debit payment are not valid.","ratepayInstallment":"The API credentials for PAYONE Ratepay Installments payment are not valid.","ratepayInvoicing":"The API credentials for PAYONE Ratepay Open Invoice payment are not valid.","klarnaInvoice":"The API credentials for PAYONE Klarna Rechnung are not valid.","klarnaDirectDebit":"The API credentials for PAYONE Klarna Sofort bezahlen are not valid.","klarnaInstallment":"The API credentials for PAYONE Klarna Ratenkauf are not valid.","przelewy24":"The API credentials for PAYONE Przelewy24 are not valid.","weChatPay":"The API credentials for PAYONE WeChat Pay are not valid.","postfinanceCard":"The API credentials for PAYONE Postfinance (Card) are not valid.","postfinanceWallet":"The API credentials for PAYONE Postfinance (Wallet) are not valid.","alipay":"The API credentials for PAYONE Alipay are not valid.","securedInvoice":"The API credentials for PAYONE Secured Invoice are not valid.","securedInstallment":"The API credentials for PAYONE Secured Installment are not valid.","securedDirectDebit":"The API credentials for PAYONE Secured Direct Debit are not valid."}},"supportModal":{"menuButton":"Support","title":"How Can We Help You?","documentation":{"description":"Read our online manual","button":"Online Manual"},"support":{"description":"Contact our technical support","button":"Tech Support"},"repository":{"description":"Report errors on GitHub","button":"GitHub"},"testdata":{"description":"Create your personal test data here","button":"Test Data"}},"applePay":{"cert":{"notification":"The ApplePay merchant authentication requires a certificate/key-pair. Further information:
\\n https://docs.payone.com/display/public/PLATFORM/Special+Remarks+-+Apple+Pay#SpecialRemarks-ApplePay-Onboarding

\\n\\n Create a pem-File afterwards by using the following command:
\\n
openssl x509 -inform der -in merchant_id.cer -out merchant_id.pem

\\n Copy certificate (merchant_id.pem) and key (merchant_id.key) file into the following folder:
\\n
%shopwareRoot%/config/apple-pay-cert
"}},"transitionActionNames":{"cancel":"Cancel","complete":"Complete","pay":"Pay","pay_partially":"Pay partially","process":"Process","refund":"Refund","refund_partially":"Refund partially","remind":"Remind","reopen":"Reopen","retour":"Retour","retour_partially":"Retour partially","ship":"Ship","ship_partially":"Ship partially"},"messageNotBlank":"This field must not be empty.","error":{"transaction":{"notFound":"No matching transaction could be found","orderNotFound":"No matching order could be found"}}},"sw-privileges":{"additional_permissions":{"Payone":{"label":"PAYONE","payone_order_management":"PAYONE transaction management"}}}}')},"Hbf+":function(e,t,n){Shopware.Component.register("payone-capture-button",(function(){return n.e(4).then(n.bind(null,"R+3S"))})),Shopware.Component.register("payone-order-items",(function(){return n.e(5).then(n.bind(null,"EsCN"))})),Shopware.Component.register("payone-payment-management",(function(){return n.e(6).then(n.bind(null,"RXfx"))})),Shopware.Component.register("payone-refund-button",(function(){return n.e(7).then(n.bind(null,"LNMh"))})),Shopware.Component.register("sw-order-detail-payone",(function(){return n.e(12).then(n.bind(null,"lZb8"))})),Shopware.Component.override("sw-order-detail",(function(){return n.e(11).then(n.bind(null,"wAwH"))})),Shopware.Component.extend("payone-data-grid","sw-data-grid",(function(){return n.e(10).then(n.bind(null,"vQ7F"))})),Shopware.Module.register("sw-order-detail-tab-payone",{routeMiddleware:function(e,t){"sw.order.detail"===t.name&&t.children.push({name:"sw.order.detail.payone",path:"payone",component:"sw-order-detail-payone",meta:{parentPath:"sw.order.detail",meta:{parentPath:"sw.order.index",privilege:"order.viewer"}}}),e(t)}})},UwmX:function(e,t,n){"use strict";n.r(t);var r=n("CY1O"),a=n("GqT2");n("tWAi");Shopware.Component.register("payone-payment-plugin-icon",(function(){return n.e(0).then(n.bind(null,"2iz0"))})),Shopware.Component.register("payone-ratepay-profile-configurations",(function(){return n.e(1).then(n.bind(null,"riVl"))})),Shopware.Component.register("payone-ratepay-profiles",(function(){return n.e(2).then(n.bind(null,"6DdA"))})),Shopware.Component.register("payone-settings",(function(){return n.e(3).then(n.bind(null,"VwDc"))})),Shopware.Module.register("payone-payment",{type:"plugin",name:"PayonePayment",title:"payone-payment.general.mainMenuItemGeneral",description:"payone-payment.general.descriptionTextModule",version:"1.0.0",targetVersion:"1.0.0",icon:"default-action-settings",snippets:{"de-DE":r,"en-GB":a},routeMiddleware:function(e,t){e(t)},routes:{index:{component:"payone-settings",path:"index",meta:{parentPath:"sw.settings.index"}}},settingsItem:[{name:"payone-payment",to:"payone.payment.index",label:"payone-payment.general.mainMenuItemGeneral",group:"plugins",iconComponent:"payone-payment-plugin-icon",backgroundEnabled:!1}]});var i=n("uk8h"),o=n("GmXf");Shopware.Component.register("payone-notification-target-detail",n.e(8).then(n.bind(null,"hS/x"))),Shopware.Component.register("payone-notification-target-list",n.e(9).then(n.bind(null,"G2C5"))),Shopware.Module.register("payone-notification-target",{type:"plugin",name:"PayoneNotificationTarget",title:"payonePayment.notificationTarget.module.title",description:"payonePayment.notificationTarget.module.title",color:"#3596d6",icon:"default-shopping-paper-bag-product",snippets:{"de-DE":i,"en-GB":o},routes:{list:{component:"payone-notification-target-list",path:"list"},detail:{component:"payone-notification-target-detail",path:"detail/:id",props:{default:function(e){return{notificationTargetId:e.params.id}}},meta:{parentPath:"payone.notification.target.list"}},create:{component:"payone-notification-target-detail",path:"create",meta:{parentPath:"payone.notification.target.list"}}}});n("Hbf+"),n("2a1E"),n("ldEE"),n("6PZk")},ldEE:function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"payone_payment";return r(this,c),l.call(this,e,t,n)}return t=c,(n=[{key:"validateApiCredentials",value:function(e){var t=this.getBasicHeaders();return this.httpClient.post("_action/".concat(this.getApiBasePath(),"/validate-api-credentials"),{credentials:e},{headers:t}).then((function(e){return u.handleResponse(e)}))}},{key:"getStateMachineTransitionActions",value:function(){var e=this.getBasicHeaders();return this.httpClient.get("_action/".concat(this.getApiBasePath(),"/get-state-machine-transition-actions"),{headers:e}).then((function(e){return u.handleResponse(e)}))}},{key:"hasApplePayCert",value:function(){var e=this.getBasicHeaders();return this.httpClient.get("_action/".concat(this.getApiBasePath(),"/check-apple-pay-cert"),{headers:e}).catch((function(){return!1})).then((function(e){return!!e}))}}])&&a(t.prototype,n),s&&a(t,s),Object.defineProperty(t,"prototype",{writable:!1}),c}(u);c.addServiceProvider("PayonePaymentSettingsService",(function(e){var t=c.getContainer("init");return new p(t.httpClient,e.loginService)}))},tWAi:function(e,t){var n=Shopware.Filter,r=Shopware.Utils.format.currency;n.register("payone_currency",(function(e,t,n,a){return null===e?"-":(n||(n=0),e/=Math.pow(10,n),r(e,t,a))}))},uk8h:function(e){e.exports=JSON.parse('{"payonePayment":{"notificationTarget":{"module":{"title":"Payone Notificationweiterleitungen","buttonTitle":"Notifications"},"list":{"title":"Notificationweiterleitungen","empty":"Keine Einträge","buttonCreate":"Weiterleitungsziel anlegen"},"detail":{"headline":"Notificationweiterleitung","placeholder":{"url":"Url","username":"Benutzer","password":"Passwort"},"label":{"url":"Url","isBasicAuth":"Basic Auth","txactions":"txactions","buttonSave":"Speichern","buttonCancel":"Abbrechen","username":"Benutzer","password":"Passwort"}},"columns":{"url":"Url","isBasicAuth":"Basic Auth","txactions":"txactions"},"actions":{"requeue":"Erneut senden"},"messages":{"success":"Die Weiterleitung wurde erfolgreich in Auftrag gegeben."}}}}')}}); \ No newline at end of file +!function(e){function t(t){for(var n,r,i=t[0],o=t[1],s=0,l=[];s2&&void 0!==arguments[2]?arguments[2]:"payone";return r(this,c),l.call(this,e,t,n)}return t=c,(n=[{key:"requeueNotificationForward",value:function(e){var t="_action/".concat(this.getApiBasePath(),"/requeue-forward");return this.httpClient.post(t,e,{headers:this.getBasicHeaders()}).then((function(e){return u.handleResponse(e)}))}},{key:"capturePayment",value:function(e){var t="_action/".concat(this.getApiBasePath(),"/capture-payment");return this.httpClient.post(t,e,{headers:this.getBasicHeaders()}).then((function(e){return u.handleResponse(e)}))}},{key:"refundPayment",value:function(e){var t="_action/".concat(this.getApiBasePath(),"/refund-payment");return this.httpClient.post(t,e,{headers:this.getBasicHeaders()}).then((function(e){return u.handleResponse(e)}))}}])&&a(t.prototype,n),s&&a(t,s),Object.defineProperty(t,"prototype",{writable:!1}),c}(u);c.addServiceProvider("PayonePaymentService",(function(e){var t=c.getContainer("init");return new p(t.httpClient,e.loginService)}))},LNJw:function(e,t,n){Shopware.Component.register("payone-capture-button",(function(){return n.e(4).then(n.bind(null,"YxV/"))})),Shopware.Component.register("payone-order-items",(function(){return n.e(5).then(n.bind(null,"ckPB"))})),Shopware.Component.register("payone-payment-management",(function(){return n.e(6).then(n.bind(null,"FjD8"))})),Shopware.Component.register("payone-refund-button",(function(){return n.e(7).then(n.bind(null,"akBm"))})),Shopware.Component.register("sw-order-detail-payone",(function(){return n.e(12).then(n.bind(null,"5knj"))})),Shopware.Component.override("sw-order-detail",(function(){return n.e(11).then(n.bind(null,"o09F"))})),Shopware.Component.extend("payone-data-grid","sw-data-grid",(function(){return n.e(10).then(n.bind(null,"2xAX"))})),Shopware.Module.register("sw-order-detail-tab-payone",{routeMiddleware:function(e,t){"sw.order.detail"===t.name&&t.children.push({name:"sw.order.detail.payone",path:"payone",component:"sw-order-detail-payone",meta:{parentPath:"sw.order.detail",meta:{parentPath:"sw.order.index",privilege:"order.viewer"}}}),e(t)}})},VClq:function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"payone_payment";return r(this,c),l.call(this,e,t,n)}return t=c,(n=[{key:"validateApiCredentials",value:function(e){var t=this.getBasicHeaders();return this.httpClient.post("_action/".concat(this.getApiBasePath(),"/validate-api-credentials"),{credentials:e},{headers:t}).then((function(e){return u.handleResponse(e)}))}},{key:"getStateMachineTransitionActions",value:function(){var e=this.getBasicHeaders();return this.httpClient.get("_action/".concat(this.getApiBasePath(),"/get-state-machine-transition-actions"),{headers:e}).then((function(e){return u.handleResponse(e)}))}},{key:"hasApplePayCert",value:function(){var e=this.getBasicHeaders();return this.httpClient.get("_action/".concat(this.getApiBasePath(),"/check-apple-pay-cert"),{headers:e}).catch((function(){return!1})).then((function(e){return!!e}))}}])&&a(t.prototype,n),s&&a(t,s),Object.defineProperty(t,"prototype",{writable:!1}),c}(u);c.addServiceProvider("PayonePaymentSettingsService",(function(e){var t=c.getContainer("init");return new p(t.httpClient,e.loginService)}))},fpSc:function(e){e.exports=JSON.parse('{"payone-payment":{"title":"PAYONE","general":{"mainMenuItemGeneral":"PAYONE","descriptionTextModule":"Einstellungen für PAYONE","headlines":{"ratepayProfiles":"Profile","ratepayProfileConfigurations":"Profil-Konfigurationen"},"label":{"shopId":"Shop-ID","currency":"Währung","error":"Status","invoiceCountry":"Rechnungsland","shippingCountry":"Lieferland","minBasket":"Min. Warenkorb","maxBasket":"Max. Warenkorb","reloadConfigBtn":"Profil-Konfiguration neu laden","reloadConfigInfo":"(Änderungen an der Plugin-Konfiguration werden dabei zuerst gespeichert)"},"actions":{"addShop":"Shop-ID hinzufügen"},"errors":{"existingShopId":"Die eingegebene ShopId existiert bereits.","emptyInputs":"Bitte füllen Sie alle Eingabefelder aus."}},"settingsForm":{"save":"Speichern","test":"API-Zugangsdaten testen","titleSuccess":"Erfolg","titleError":"Fehler","labelShowSpecificStatusMapping":"Statusmappingkonfiguration einblenden","helpTextShowSpecificStatusMapping":"Sie können für jede Zahlungsart ein spezifisches Statusmapping konfigurieren. Existiert eine solche Konfiguration nicht, wird auf die allgemeine Konfiguration zurückgegriffen.","messageSaveError":{"ratepayProfilesUpdateFailed":"Mindestens ein Ratepay Profil konnte nicht erfolgreich gespeichert werden, bitte prüfen Sie Ihre Konfiguration."},"messageTestSuccess":"Die API-Zugangsdaten wurden erfolgreich validiert.","messageTestNoTestedPayments":"Bei der Prüfung wurden keine Zahlarten getestet, weil keine der PAYONE Zahlarten aktiviert ist. Bitte aktivieren Sie mindestens eine PAYONE Zahlart unter Einstellungen --\x3e Shop --\x3e Zahlungsarten.","messageTestError":{"general":"Die API-Zugangsdaten konnten nicht validiert werden.","creditCard":"Die API-Zugangsdaten für PAYONE Kreditkarte sind nicht korrekt.","prepayment":"Die API-Zugangsdaten für PAYONE Vorkasse sind nicht korrekt.","debit":"Die API-Zugangsdaten für PAYONE Lastschrift sind nicht korrekt.","paypalExpress":"Die API-Zugangsdaten für PAYONE PayPal Express sind nicht korrekt.","paypal":"Die API-Zugangsdaten für PAYONE PayPal sind nicht korrekt.","payolutionInstallment":"Die API-Zugangsdaten für PAYONE Unzer Ratenkauf sind nicht korrekt.","payolutionInvoicing":"Die API-Zugangsdaten für PAYONE Unzer Rechnungskauf sind nicht korrekt.","payolutionDebit":"Die API-Zugangsdaten für PAYONE Unzer Lastschrift sind nicht korrekt.","sofort":"Die API-Zugangsdaten für PAYONE Sofort Überweisung sind nicht korrekt.","eps":"Die API-Zugangsdaten für PAYONE eps Überweisung sind nicht korrekt.","iDeal":"Die API-Zugangsdaten für PAYONE iDEAL sind nicht korrekt.","secureInvoice":"Die API-Zugangsdaten für PAYONE Gesicherter Rechnungskauf sind nicht korrekt.","openInvoice":"Die API-Zugangsdaten für PAYONE Rechnungskauf sind nicht korrekt.","paydirekt":"Die API-Zugangsdaten für PAYONE paydirekt sind nicht korrekt.","trustly":"Die API-Zugangsdaten für PAYONE Trustly sind nicht korrekt.","applePay":"Die API-Zugangsdaten für PAYONE Apple Pay sind nicht korrekt.","bancontact":"Die API-Zugangsdaten für PAYONE Bancontact sind nicht korrekt.","ratepayDebit":"Die API-Zugangsdaten für PAYONE Ratepay Lastschrift sind nicht korrekt.","ratepayInstallment":"Die API-Zugangsdaten für PAYONE Ratepay Ratenzahlung sind nicht korrekt.","ratepayInvoicing":"Die API-Zugangsdaten für PAYONE Ratepay Rechnungskauf sind nicht korrekt.","klarnaInvoice":"Die API-Zugangsdaten für PAYONE Klarna Rechnung sind nicht korrekt.","klarnaDirectDebit":"Die API-Zugangsdaten für PAYONE Klarna Sofort bezahlen sind nicht korrekt.","klarnaInstallment":"Die API-Zugangsdaten für PAYONE Klarna Ratenkauf sind nicht korrekt.","przelewy24":"Die API-Zugangsdaten für PAYONE Przelewy24 sind nicht korrekt.","weChatPay":"Die API-Zugangsdaten für PAYONE WeChat Pay sind nicht korrekt.","postfinanceCard":"Die API-Zugangsdaten für PAYONE Postfinance (Card) sind nicht korrekt.","postfinanceWallet":"Die API-Zugangsdaten für PAYONE Postfinance (Wallet) sind nicht korrekt.","alipay":"Die API-Zugangsdaten für PAYONE Alipay sind nicht korrekt.","securedInvoice":"Die API-Zugangsdaten für PAYONE Gesicherter Rechnungskauf sind nicht korrekt.","securedInstallment":"Die API-Zugangsdaten für PAYONE Gesicherter Ratenkauf sind nicht korrekt.","securedDirectDebit":"Die API-Zugangsdaten für PAYONE Gesicherte Lastschrift sind nicht korrekt."}},"supportModal":{"menuButton":"Support","title":"Wie können wir Ihnen helfen?","documentation":{"description":"Lesen Sie unsere Online-Dokumentation","button":"Dokumentation"},"support":{"description":"Kontaktieren Sie unseren Support","button":"Technischer Support"},"repository":{"description":"Melden Sie Fehler und Verbesserungen","button":"GitHub"},"testdata":{"description":"Erstellen Sie hier Ihre persönlichen Testdaten","button":"Testdaten"}},"applePay":{"cert":{"notification":"Für die Nutzung von ApplePay ist ein Zertifikat/Key-Paar zur Authentifizierung des Merchants erforderlich. Die Anlage eines solchen Zertifikats wird hier beschrieben:
\\n https://docs.payone.com/display/public/PLATFORM/Special+Remarks+-+Apple+Pay#SpecialRemarks-ApplePay-Onboarding

\\n\\n Erstellen Sie im Anschluss unter Verwendung des folgenden Befehls eine PEM-Datei des Zertifikates:
\\n
openssl x509 -inform der -in merchant_id.cer -out merchant_id.pem

\\n Hinterlegen Sie das Zertifikat (merchant_id.pem) und den Key (merchant_id.key) in folgendem Verzeichnis:
\\n
%shopwareRoot%/config/apple-pay-cert
"}},"transitionActionNames":{"cancel":"Stornieren","complete":"Abschließen","pay":"Bezahlen","pay_partially":"Teilweise bezahlen","process":"Durchführen","refund":"Rückerstatten","refund_partially":"Teilweise rückerstatten","remind":"Erinnern","reopen":"Wieder öffnen","retour":"Retoure","retour_partially":"Teilweise retounieren","ship":"Versenden","ship_partially":"Teilweise versenden"},"messageNotBlank":"Dieser Wert darf nicht leer sein.","error":{"transaction":{"notFound":"Es wurde keine passende Transaktion gefundend","orderNotFound":"Es wurde keine passende Bestellung gefundend"}}},"sw-privileges":{"additional_permissions":{"Payone":{"label":"PAYONE","payone_order_management":"PAYONE Transaktionsmanagement"}}}}')},ncpO:function(e){e.exports=JSON.parse('{"payone-payment":{"title":"PAYONE","general":{"mainMenuItemGeneral":"PAYONE","descriptionTextModule":"Settings for PAYONE","headlines":{"ratepayProfiles":"Profile","ratepayProfileConfigurations":"Profil-Konfigurationen"},"label":{"shopId":"Shop-ID","currency":"Currency","error":"Status","invoiceCountry":"Invoice Country","shippingCountry":"Shipping Country","minBasket":"Min. Basket","maxBasket":"Max. Basket","reloadConfigBtn":"Reload Profile Configuration","reloadConfigInfo":"(Plugin Configuration Changes will be saved first)"},"actions":{"addShop":"Add Shop-ID"},"errors":{"existingShopId":"The entered shop-id already exists.","emptyInputs":"Please fill all input fields."}},"settingsForm":{"save":"Save","test":"Test API Credentials","titleSuccess":"Success","titleError":"Error","labelShowSpecificStatusMapping":"Display state mapping configuration","helpTextShowSpecificStatusMapping":"If not configured the general status mapping config will be applied.","messageSaveError":{"ratepayProfilesUpdateFailed":"At least one Ratepay profile could not be saved successfully, please check your configuration."},"messageTestSuccess":"The API credentials were verified successfully.","messageTestNoTestedPayments":"No payment methods were tested during the check because none of the PAYONE payment methods are activated. Please activate at least one PAYONE payment method under Settings --\x3e Shop --\x3e Payment.","messageTestError":{"general":"The API credentials could not be verified successfully.","creditCard":"The API credentials for PAYONE Credit Card are not valid.","prepayment":"The API credentials for PAYONE Prepayment are not valid.","debit":"The API credentials for PAYONE Direct Debit are not valid.","paypalExpress":"The API credentials for PAYONE PayPal Express are not valid.","paypal":"The API credentials for PAYONE PayPal are not valid.","payolutionInstallment":"The API credentials for PAYONE Unzer Ratenkauf are not valid.","payolutionInvoicing":"The API credentials for PAYONE Unzer Rechnungskauf are not valid.","payolutionDebit":"The API credentials for PAYONE Unzer Lastschrift are not valid.","sofort":"The API credentials for PAYONE Sofort are not valid.","eps":"The API credentials for PAYONE eps are not valid.","iDeal":"The API credentials for PAYONE iDEAL are not valid.","secureInvoice":"The API credentials for PAYONE Secure Invoice are not valid.","openInvoice":"The API credentials for PAYONE Invoice are not valid.","paydirekt":"The API credentials for PAYONE paydirekt are not valid.","trustly":"The API credentials for PAYONE Trustly are not valid.","applePay":"The API credentials for PAYONE Apple Pay are not valid.","bancontact":"The API credentials for PAYONE Bancontact payment are not valid.","ratepayDebit":"The API credentials for PAYONE Ratepay Direct Debit payment are not valid.","ratepayInstallment":"The API credentials for PAYONE Ratepay Installments payment are not valid.","ratepayInvoicing":"The API credentials for PAYONE Ratepay Open Invoice payment are not valid.","klarnaInvoice":"The API credentials for PAYONE Klarna Rechnung are not valid.","klarnaDirectDebit":"The API credentials for PAYONE Klarna Sofort bezahlen are not valid.","klarnaInstallment":"The API credentials for PAYONE Klarna Ratenkauf are not valid.","przelewy24":"The API credentials for PAYONE Przelewy24 are not valid.","weChatPay":"The API credentials for PAYONE WeChat Pay are not valid.","postfinanceCard":"The API credentials for PAYONE Postfinance (Card) are not valid.","postfinanceWallet":"The API credentials for PAYONE Postfinance (Wallet) are not valid.","alipay":"The API credentials for PAYONE Alipay are not valid.","securedInvoice":"The API credentials for PAYONE Secured Invoice are not valid.","securedInstallment":"The API credentials for PAYONE Secured Installment are not valid.","securedDirectDebit":"The API credentials for PAYONE Secured Direct Debit are not valid."}},"supportModal":{"menuButton":"Support","title":"How Can We Help You?","documentation":{"description":"Read our online manual","button":"Online Manual"},"support":{"description":"Contact our technical support","button":"Tech Support"},"repository":{"description":"Report errors on GitHub","button":"GitHub"},"testdata":{"description":"Create your personal test data here","button":"Test Data"}},"applePay":{"cert":{"notification":"The ApplePay merchant authentication requires a certificate/key-pair. Further information:
\\n https://docs.payone.com/display/public/PLATFORM/Special+Remarks+-+Apple+Pay#SpecialRemarks-ApplePay-Onboarding

\\n\\n Create a pem-File afterwards by using the following command:
\\n
openssl x509 -inform der -in merchant_id.cer -out merchant_id.pem

\\n Copy certificate (merchant_id.pem) and key (merchant_id.key) file into the following folder:
\\n
%shopwareRoot%/config/apple-pay-cert
"}},"transitionActionNames":{"cancel":"Cancel","complete":"Complete","pay":"Pay","pay_partially":"Pay partially","process":"Process","refund":"Refund","refund_partially":"Refund partially","remind":"Remind","reopen":"Reopen","retour":"Retour","retour_partially":"Retour partially","ship":"Ship","ship_partially":"Ship partially"},"messageNotBlank":"This field must not be empty.","error":{"transaction":{"notFound":"No matching transaction could be found","orderNotFound":"No matching order could be found"}}},"sw-privileges":{"additional_permissions":{"Payone":{"label":"PAYONE","payone_order_management":"PAYONE transaction management"}}}}')},pUlF:function(e,t){var n=Shopware.Filter,r=Shopware.Utils.format.currency;n.register("payone_currency",(function(e,t,n,a){return null===e?"-":(n||(n=0),e/=Math.pow(10,n),r(e,t,a))}))},"vW+I":function(e){e.exports=JSON.parse('{"payonePayment":{"notificationTarget":{"module":{"title":"Payone Notificationweiterleitungen","buttonTitle":"Notifications"},"list":{"title":"Notificationweiterleitungen","empty":"Keine Einträge","buttonCreate":"Weiterleitungsziel anlegen"},"detail":{"headline":"Notificationweiterleitung","placeholder":{"url":"Url","username":"Benutzer","password":"Passwort"},"label":{"url":"Url","isBasicAuth":"Basic Auth","txactions":"txactions","buttonSave":"Speichern","buttonCancel":"Abbrechen","username":"Benutzer","password":"Passwort"}},"columns":{"url":"Url","isBasicAuth":"Basic Auth","txactions":"txactions"},"actions":{"requeue":"Erneut senden"},"messages":{"success":"Die Weiterleitung wurde erfolgreich in Auftrag gegeben."}}}}')},x8Qh:function(e){e.exports=JSON.parse('{"payonePayment":{"notificationTarget":{"module":{"title":"Payone notification forward","buttonTitle":"Notifications"},"list":{"title":"Notification forward","empty":"No entries","buttonCreate":"Add new notification target"},"detail":{"headline":"Notification forward","placeholder":{"url":"Url","username":"Username","password":"Password"},"label":{"url":"Url","isBasicAuth":"Basic Auth","txactions":"txactions","buttonSave":"Save","buttonCancel":"Cancel","username":"Username","password":"Password"}},"columns":{"url":"Url","isBasicAuth":"Basic Auth","txactions":"txactions"},"actions":{"requeue":"Requeue"},"messages":{"success":"The notification forward has been successfully queued."}}}}')}}); \ No newline at end of file diff --git a/src/Resources/public/static/js/0.js b/src/Resources/public/static/js/0.js index 735b0b87a..57ba3b94e 100644 --- a/src/Resources/public/static/js/0.js +++ b/src/Resources/public/static/js/0.js @@ -1 +1 @@ -(this["webpackJsonpPluginpayone-payment"]=this["webpackJsonpPluginpayone-payment"]||[]).push([[0],{"2iz0":function(e,t,n){"use strict";n.r(t);n("PaTh"),t.default={template:'{% block payone_payment_plugin_icon %}\n \n{% endblock %}\n'}},PaTh:function(e,t,n){var r=n("euFz");r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n("ydqr").default)("7669284a",r,!0,{})},euFz:function(e,t,n){},ydqr:function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},a=0;an.parts.length&&(r.parts.length=n.parts.length)}else{var i=[];for(a=0;a\n{% endblock %}\n'}},SqvT:function(e,t,n){var r=n("d6Kt");r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n("ydqr").default)("6b6c4413",r,!0,{})},d6Kt:function(e,t,n){},ydqr:function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},s=0;sn.parts.length&&(r.parts.length=n.parts.length)}else{var i=[];for(s=0;s\n

{{ $tc('payone-payment.general.headlines.ratepayProfileConfigurations') }}

\n\n \n \n{% endblock %}\n",inject:["PayonePaymentSettingsService"],props:{value:{type:Object,required:!1,default:function(){return{}}},name:{type:String,required:!0}},data:function(){return{isLoading:!1,configuration:this.value}},created:function(){this.createdComponent()},destroyed:function(){this.destroyedComponent()},computed:{profileConfigurations:function(){var e=this.name,n=[];for(var t in this.configuration){var i="",r="";switch(e){case"PayonePayment.settings.ratepayDebitProfileConfigurations":i=this.configuration[t]["tx-limit-elv-min"],r=this.configuration[t]["tx-limit-elv-max"];break;case"PayonePayment.settings.ratepayInstallmentProfileConfigurations":i=this.configuration[t]["tx-limit-installment-min"],r=this.configuration[t]["tx-limit-installment-max"];break;case"PayonePayment.settings.ratepayInvoicingProfileConfigurations":i=this.configuration[t]["tx-limit-invoice-min"],r=this.configuration[t]["tx-limit-invoice-max"];break;default:return}var o={shopId:t,shopCurrency:this.configuration[t].currency,invoiceCountry:this.configuration[t]["country-code-billing"],shippingCountry:this.configuration[t]["country-code-delivery"],minBasket:i,maxBasket:r};n.push(o)}return n}},methods:{createdComponent:function(){this.$root.$on("payone-ratepay-profiles-update-result",this.onProfilesUpdateResult)},destroyedComponent:function(){this.$root.$off("payone-ratepay-profiles-update-result")},onProfilesUpdateResult:function(e){e.updates[this.name]&&(this.configuration=e.updates[this.name])}}}},ydqr:function(e,n,t){"use strict";function i(e,n){for(var t=[],i={},r=0;rt.parts.length&&(i.parts.length=t.parts.length)}else{var a=[];for(r=0;r\n

{{ $tc('payone-payment.general.headlines.ratepayProfileConfigurations') }}

\n\n \n \n{% endblock %}\n",inject:["PayonePaymentSettingsService"],props:{value:{type:Object,required:!1,default:function(){return{}}},name:{type:String,required:!0}},data:function(){return{isLoading:!1,configuration:this.value}},created:function(){this.createdComponent()},destroyed:function(){this.destroyedComponent()},computed:{profileConfigurations:function(){var e=this.name,n=[];for(var t in this.configuration){var i="",r="";switch(e){case"PayonePayment.settings.ratepayDebitProfileConfigurations":i=this.configuration[t]["tx-limit-elv-min"],r=this.configuration[t]["tx-limit-elv-max"];break;case"PayonePayment.settings.ratepayInstallmentProfileConfigurations":i=this.configuration[t]["tx-limit-installment-min"],r=this.configuration[t]["tx-limit-installment-max"];break;case"PayonePayment.settings.ratepayInvoicingProfileConfigurations":i=this.configuration[t]["tx-limit-invoice-min"],r=this.configuration[t]["tx-limit-invoice-max"];break;default:return}var o={shopId:t,shopCurrency:this.configuration[t].currency,invoiceCountry:this.configuration[t]["country-code-billing"],shippingCountry:this.configuration[t]["country-code-delivery"],minBasket:i,maxBasket:r};n.push(o)}return n}},methods:{createdComponent:function(){this.$root.$on("payone-ratepay-profiles-update-result",this.onProfilesUpdateResult)},destroyedComponent:function(){this.$root.$off("payone-ratepay-profiles-update-result")},onProfilesUpdateResult:function(e){e.updates[this.name]&&(this.configuration=e.updates[this.name])}}}},wvyy:function(e,n,t){},yHFN:function(e,n,t){var i=t("wvyy");i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);(0,t("ydqr").default)("25d7f79e",i,!0,{})},ydqr:function(e,n,t){"use strict";function i(e,n){for(var t=[],i={},r=0;rt.parts.length&&(i.parts.length=t.parts.length)}else{var a=[];for(r=0;r\n \n\n \n \n{% endblock %}\n'}}}]); \ No newline at end of file +(this["webpackJsonpPluginpayone-payment"]=this["webpackJsonpPluginpayone-payment"]||[]).push([[10],{"2xAX":function(e,i,n){"use strict";n.r(i);i.default={template:'{% block sw_data_grid_select_item_checkbox %}\n \n \n\n \n \n{% endblock %}\n'}}}]); \ No newline at end of file diff --git a/src/Resources/public/static/js/11.js b/src/Resources/public/static/js/11.js index 3c15d3300..6706160c9 100644 --- a/src/Resources/public/static/js/11.js +++ b/src/Resources/public/static/js/11.js @@ -1 +1 @@ -(this["webpackJsonpPluginpayone-payment"]=this["webpackJsonpPluginpayone-payment"]||[]).push([[11],{wAwH:function(n,a,t){"use strict";t.r(a);a.default={template:'{% block sw_order_detail_content_tabs_extension %}\n {% parent %}\n\n {% block sw_order_detail_content_tabs_payone %}\n \n {{ $tc(\'sw-order.detail.payone\') }}\n \n {% endblock %}\n\n{% endblock %}',methods:{hasPayoneTransaction:function(n){var a=this,t=!1;return!!n.transactions&&(n.transactions.map((function(n){a.isPayoneTransaction(n)&&a.isActiveTransaction(n)&&(t=!0)})),t)},isPayoneTransaction:function(n){return!!(n.extensions&&n.extensions.payonePaymentOrderTransactionData&&n.extensions.payonePaymentOrderTransactionData.transactionId)&&n.extensions.payonePaymentOrderTransactionData.transactionId},isActiveTransaction:function(n){return"cancelled"!==n.stateMachineState.technicalName}}}}}]); \ No newline at end of file +(this["webpackJsonpPluginpayone-payment"]=this["webpackJsonpPluginpayone-payment"]||[]).push([[11],{o09F:function(n,a,t){"use strict";t.r(a);a.default={template:'{% block sw_order_detail_content_tabs_extension %}\n {% parent %}\n\n {% block sw_order_detail_content_tabs_payone %}\n \n {{ $tc(\'sw-order.detail.payone\') }}\n \n {% endblock %}\n\n{% endblock %}',methods:{hasPayoneTransaction:function(n){var a=this,t=!1;return!!n.transactions&&(n.transactions.map((function(n){a.isPayoneTransaction(n)&&a.isActiveTransaction(n)&&(t=!0)})),t)},isPayoneTransaction:function(n){return!!(n.extensions&&n.extensions.payonePaymentOrderTransactionData&&n.extensions.payonePaymentOrderTransactionData.transactionId)&&n.extensions.payonePaymentOrderTransactionData.transactionId},isActiveTransaction:function(n){return"cancelled"!==n.stateMachineState.technicalName}}}}}]); \ No newline at end of file diff --git a/src/Resources/public/static/js/12.js b/src/Resources/public/static/js/12.js index 17dd30cf2..3c92338de 100644 --- a/src/Resources/public/static/js/12.js +++ b/src/Resources/public/static/js/12.js @@ -1 +1 @@ -(this["webpackJsonpPluginpayone-payment"]=this["webpackJsonpPluginpayone-payment"]||[]).push([[12],{lZb8:function(e,t,r){"use strict";r.r(t);function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=Shopware.Component.getComponentHelper().mapState;t.default={template:'{% block sw_order_detail_payone %}\n
\n \n
\n{% endblock %}\n',props:{orderId:{type:String,required:!0}},computed:function(e){for(var t=1;t\n \n\n{% endblock %}\n',props:{orderId:{type:String,required:!0}},computed:function(e){for(var t=1;t\n \n \n\n{% endblock %}\n',props:{orderId:{type:String,required:!0}},computed:function(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n\n {% block payone_ratepay_shop_ids %}\n

{{ $tc(\'payone-payment.general.headlines.ratepayProfiles\') }}

\n \n\n {% block payone_ratepay_shop_ids_actions %}\n \n\n {% block payone_ratepay_shop_ids_create_actions %}\n
\n \n {{ $tc(\'payone-payment.general.actions.addShop\') }}\n \n
\n {% endblock %}\n
\n {% endblock %}\n\n {% block payone_ratepay_shop_ids_grid %}\n \n {% block payone_ratepay_shop_ids_grid_columns %}\n {% block payone_ratepay_shop_ids_grid_column_status %}\n \n {% endblock %}\n\n {% block payone_ratepay_shop_ids_bulk_actions %}\n \n {% endblock %}\n {% endblock %}\n \n {% endblock %}\n\n {% block payone_ratepay_shop_ids_error %}\n \n {{ $tc(\'payone-payment.general.errors.existingShopId\') }}\n \n\n \n {{ $tc(\'payone-payment.general.errors.emptyInputs\') }}\n \n {% endblock %}\n
\n {% endblock %}\n \n{% endblock %}\n',props:{value:{type:Array,required:!1,default:function(){return[]}},name:{type:String,required:!0}},data:function(){return{selectedItems:{},newItem:null,showDuplicateAlert:!1,showEmptyAlert:!1,profiles:this.value}},computed:{getLineItemColumns:function(){return[{property:"shopId",dataIndex:"shopId",label:this.$tc("payone-payment.general.label.shopId"),allowResize:!1,inlineEdit:"string",width:"200px",primary:!0},{property:"currency",dataIndex:"currency",label:this.$tc("payone-payment.general.label.currency"),allowResize:!1,inlineEdit:"string",width:"200px",primary:!0},{property:"error",label:this.$tc("payone-payment.general.label.error"),allowResize:!1,width:"100px",primary:!0}]}},watch:{profiles:function(e){this.$emit("input",e),this.$emit("change",e)}},created:function(){this.createdComponent()},destroyed:function(){this.destroyedComponent()},methods:{createdComponent:function(){this.$root.$on("payone-ratepay-profiles-update-result",this.onProfilesUpdateResult)},destroyedComponent:function(){this.$root.$off("payone-ratepay-profiles-update-result")},onProfilesUpdateResult:function(e){if(e.updates[this.name]&&(this.profiles=e.updates[this.name]),e.errors[this.name]){var t,n=r(e.errors[this.name]);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.profiles.push(i)}}catch(e){n.e(e)}finally{n.f()}}},onInlineEditCancel:function(e){""===e.shopId&&""===e.currency&&this.profiles.forEach((function(t,n,r){t.id===e.id&&r.splice(n,1)})),this.$emit("item-cancel")},onInlineEditSave:function(e){var t=this;if(""!==e.shopId&&""!==e.currency){this.showEmptyAlert=!1;var n=!1;this.profiles.forEach((function(t){t.id!==e.id&&t.shopId===e.shopId&&(n=!0)})),n?(this.showDuplicateAlert=!0,this.$nextTick((function(){t.$refs.shopIdsDataGrid.currentInlineEditId=e.id,t.$refs.shopIdsDataGrid.enableInlineEdit()}))):this.showDuplicateAlert=!1}else this.showEmptyAlert=!0,this.$nextTick((function(){t.$refs.shopIdsDataGrid.currentInlineEditId=e.id,t.$refs.shopIdsDataGrid.enableInlineEdit()}));this.$emit("update-list",this.profiles)},createNewLineItem:function(){(0===this.profiles.length||""!==this.profiles[this.profiles.length-1].shopId)&&this.createLine()},createLine:function(){var e=this,t=o.createId();this.profiles.push({id:t,shopId:"",currency:""}),this.$nextTick((function(){e.$refs.shopIdsDataGrid.currentInlineEditId=t,e.$refs.shopIdsDataGrid.enableInlineEdit()}))},onDeleteSelectedItem:function(e){this.profiles=this.profiles.filter((function(t){return t.shopId!==e.shopId})),this.$emit("deleted",this.profiles)}}}},fkbi:function(e,t,n){},pHm1:function(e,t,n){var r=n("fkbi");r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n("ydqr").default)("6eb356bc",r,!0,{})},ydqr:function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},i=0;in.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(i=0;i=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n\n {% block payone_ratepay_shop_ids %}\n

{{ $tc(\'payone-payment.general.headlines.ratepayProfiles\') }}

\n \n\n {% block payone_ratepay_shop_ids_actions %}\n \n\n {% block payone_ratepay_shop_ids_create_actions %}\n
\n \n {{ $tc(\'payone-payment.general.actions.addShop\') }}\n \n
\n {% endblock %}\n
\n {% endblock %}\n\n {% block payone_ratepay_shop_ids_grid %}\n \n {% block payone_ratepay_shop_ids_grid_columns %}\n {% block payone_ratepay_shop_ids_grid_column_status %}\n \n {% endblock %}\n\n {% block payone_ratepay_shop_ids_bulk_actions %}\n \n {% endblock %}\n {% endblock %}\n \n {% endblock %}\n\n {% block payone_ratepay_shop_ids_error %}\n \n {{ $tc(\'payone-payment.general.errors.existingShopId\') }}\n \n\n \n {{ $tc(\'payone-payment.general.errors.emptyInputs\') }}\n \n {% endblock %}\n
\n {% endblock %}\n \n{% endblock %}\n',props:{value:{type:Array,required:!1,default:function(){return[]}},name:{type:String,required:!0}},data:function(){return{selectedItems:{},newItem:null,showDuplicateAlert:!1,showEmptyAlert:!1,profiles:this.value}},computed:{getLineItemColumns:function(){return[{property:"shopId",dataIndex:"shopId",label:this.$tc("payone-payment.general.label.shopId"),allowResize:!1,inlineEdit:"string",width:"200px",primary:!0},{property:"currency",dataIndex:"currency",label:this.$tc("payone-payment.general.label.currency"),allowResize:!1,inlineEdit:"string",width:"200px",primary:!0},{property:"error",label:this.$tc("payone-payment.general.label.error"),allowResize:!1,width:"100px",primary:!0}]}},watch:{profiles:function(e){this.$emit("input",e),this.$emit("change",e)}},created:function(){this.createdComponent()},destroyed:function(){this.destroyedComponent()},methods:{createdComponent:function(){this.$root.$on("payone-ratepay-profiles-update-result",this.onProfilesUpdateResult)},destroyedComponent:function(){this.$root.$off("payone-ratepay-profiles-update-result")},onProfilesUpdateResult:function(e){if(e.updates[this.name]&&(this.profiles=e.updates[this.name]),e.errors[this.name]){var t,n=r(e.errors[this.name]);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.profiles.push(i)}}catch(e){n.e(e)}finally{n.f()}}},onInlineEditCancel:function(e){""===e.shopId&&""===e.currency&&this.profiles.forEach((function(t,n,r){t.id===e.id&&r.splice(n,1)})),this.$emit("item-cancel")},onInlineEditSave:function(e){var t=this;if(""!==e.shopId&&""!==e.currency){this.showEmptyAlert=!1;var n=!1;this.profiles.forEach((function(t){t.id!==e.id&&t.shopId===e.shopId&&(n=!0)})),n?(this.showDuplicateAlert=!0,this.$nextTick((function(){t.$refs.shopIdsDataGrid.currentInlineEditId=e.id,t.$refs.shopIdsDataGrid.enableInlineEdit()}))):this.showDuplicateAlert=!1}else this.showEmptyAlert=!0,this.$nextTick((function(){t.$refs.shopIdsDataGrid.currentInlineEditId=e.id,t.$refs.shopIdsDataGrid.enableInlineEdit()}));this.$emit("update-list",this.profiles)},createNewLineItem:function(){(0===this.profiles.length||""!==this.profiles[this.profiles.length-1].shopId)&&this.createLine()},createLine:function(){var e=this,t=o.createId();this.profiles.push({id:t,shopId:"",currency:""}),this.$nextTick((function(){e.$refs.shopIdsDataGrid.currentInlineEditId=t,e.$refs.shopIdsDataGrid.enableInlineEdit()}))},onDeleteSelectedItem:function(e){this.profiles=this.profiles.filter((function(t){return t.shopId!==e.shopId})),this.$emit("deleted",this.profiles)}}}},THZG:function(e,t,n){var r=n("qDZM");r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n("ydqr").default)("aa50bbb0",r,!0,{})},qDZM:function(e,t,n){},ydqr:function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},i=0;in.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(i=0;i\n {% block payone_payment_header %}\n \n {% endblock %}\n\n {% block payone_payment_actions %}\n \n {% endblock %}\n\n {% block payone_payment_settings_content %}\n \n {% endblock %}\n\n{% endblock %}\n',mixins:[a.getByName("notification"),a.getByName("sw-inline-snippet")],inject:["PayonePaymentSettingsService"],data:function(){return{isLoading:!1,isTesting:!1,isSaveSuccessful:!1,isTestSuccessful:!1,isApplePayCertConfigured:!0,config:{},merchantIdFilled:!1,accountIdFilled:!1,portalIdFilled:!1,portalKeyFilled:!1,showValidationErrors:!1,isSupportModalOpen:!1,stateMachineTransitionActions:[],displayStatusMapping:{},collapsibleState:{status_mapping:!0,payment_credit_card:!0,payment_paypal:!0,payment_paypal_express:!0,payment_debit:!0,payment_sofort:!0,payment_payolution_installment:!0,payment_payolution_invoicing:!0,payment_payolution_debit:!0,payment_eps:!0,payment_ideal:!0,payment_paydirekt:!0,payment_prepayment:!0,payment_trustly:!0,payment_secure_invoice:!0,payment_open_invoice:!0,payment_apple_pay:!0,payment_bancontact:!0,payment_ratepay_debit:!0,payment_ratepay_installment:!0,payment_ratepay_invoicing:!0,payment_klarna_invoice:!0,payment_klarna_direct_debit:!0,payment_klarna_installment:!0,payment_przelewy24:!0,payment_we_chat_pay:!0,payment_postfinanceCard:!0,payment_postfinanceWallet:!0,payment_alipay:!0,payment_secured_invoice:!0,payment_secured_installment:!0,payment_secured_direct_debit:!0}}},created:function(){this.createdComponent()},computed:{credentialsMissing:function(){return!(this.merchantIdFilled&&this.accountIdFilled&&this.portalIdFilled&&this.portalKeyFilled)}},metaInfo:function(){return{title:this.$createTitle()}},methods:{createdComponent:function(){var e=this,n=this;this.PayonePaymentSettingsService.getStateMachineTransitionActions().then((function(e){e.data.forEach((function(e){var t="payone-payment.transitionActionNames."+e.label,a=n.$t(t);a===t&&(a=e.label),n.stateMachineTransitionActions.push({label:a,value:e.value})}))})),this.PayonePaymentSettingsService.hasApplePayCert().then((function(n){e.isApplePayCertConfigured=n}))},paymentMethodPrefixes:function(){return["creditCard","debit","paypal","paypalExpress","payolutionInvoicing","payolutionInstallment","payolutionDebit","sofort","eps","iDeal","paydirekt","prepayment","trustly","secureInvoice","openInvoice","applePay","bancontact","ratepayDebit","ratepayInstallment","ratepayInvoicing","klarnaInvoice","klarnaDirectDebit","klarnaInstallment","przelewy24","weChatPay","postfinanceCard","postfinanceWallet","alipay","securedInvoice","securedInstallment","securedDirectDebit"]},isVisiblePaymentMethodCard:function(e){return e.name.startsWith("payment")&&!this.isCollapsed(e)},isCollapsible:function(e){return e.name in this.collapsibleState},displayField:function(e,n,t){return!(t.name in this.collapsibleState)||!this.collapsibleState[t.name]},isCollapsed:function(e){return this.collapsibleState[e.name]},toggleCollapsible:function(e){e.name in this.collapsibleState&&(this.collapsibleState[e.name]=!this.collapsibleState[e.name])},saveFinish:function(){this.isSaveSuccessful=!1},testFinish:function(){this.isTestSuccessful=!1},onConfigChange:function(e){this.config=e,this.checkCredentialsFilled(),this.showValidationErrors=!1},checkCredentialsFilled:function(){this.merchantIdFilled=!!this.getConfigValue("merchantId"),this.accountIdFilled=!!this.getConfigValue("accountId"),this.portalIdFilled=!!this.getConfigValue("portalId"),this.portalKeyFilled=!!this.getConfigValue("portalKey")},getConfigValue:function(e){var n=this.$refs.systemConfig.actualConfigData.null;return null===this.$refs.systemConfig.currentSalesChannelId?this.config["PayonePayment.settings.".concat(e)]:this.config["PayonePayment.settings.".concat(e)]||n["PayonePayment.settings.".concat(e)]},getPaymentConfigValue:function(e,n){var t=e.charAt(0).toUpperCase()+e.slice(1);return this.getConfigValue(n+t)||this.getConfigValue(e)},onSave:function(){var e=this;this.credentialsMissing?this.showValidationErrors=!0:(this.isSaveSuccessful=!1,this.isLoading=!0,this.$refs.systemConfig.saveAll().then((function(n){e.handleRatepayProfileUpdates(n),e.isLoading=!1,e.isSaveSuccessful=!0})).catch((function(){e.isLoading=!1})))},onTest:function(){var e=this;this.isTesting=!0,this.isTestSuccessful=!1;var n={};this.paymentMethodPrefixes().forEach((function(t){n[t]={merchantId:e.getPaymentConfigValue("merchantId",t),accountId:e.getPaymentConfigValue("accountId",t),portalId:e.getPaymentConfigValue("portalId",t),portalKey:e.getPaymentConfigValue("portalKey",t)}})),this.PayonePaymentSettingsService.validateApiCredentials(n).then((function(n){var t=n.testCount,a=n.credentialsValid,i=n.errors;if(a)e.createNotificationSuccess({title:e.$tc("payone-payment.settingsForm.titleSuccess"),message:t>0?e.$tc("payone-payment.settingsForm.messageTestSuccess"):e.$tc("payone-payment.settingsForm.messageTestNoTestedPayments")}),e.isTestSuccessful=!0;else for(var s in i)if(i.hasOwnProperty(s)){e.createNotificationError({title:e.$tc("payone-payment.settingsForm.titleError"),message:e.$tc("payone-payment.settingsForm.messageTestError."+s)});var o=i[s];"string"==typeof o&&e.createNotificationError({title:e.$tc("payone-payment.settingsForm.titleError"),message:o})}e.isTesting=!1})).catch((function(n){e.createNotificationError({title:e.$tc("payone-payment.settingsForm.titleError"),message:e.$tc("payone-payment.settingsForm.messageTestError.general")}),e.isTesting=!1}))},getBind:function(e,n){var t;return n!==this.config&&(this.config=n),this.showValidationErrors&&("PayonePayment.settings.merchantId"!==e.name||this.merchantIdFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")}),"PayonePayment.settings.accountId"!==e.name||this.accountIdFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")}),"PayonePayment.settings.portalId"!==e.name||this.portalIdFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")}),"PayonePayment.settings.portalKey"!==e.name||this.portalKeyFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")})),this.$refs.systemConfig.config.forEach((function(n){n.elements.forEach((function(n){n.name!==e.name||(t=n)}))})),t||e},getElementBind:function(e){var n=s.deepCopyObject(e);return null!==this.currentSalesChannelId&&this.inherit&&this.actualConfigData.hasOwnProperty("null")&&null!==this.actualConfigData.null[n.name]&&("single-select"===n.type||"sw-entity-single-select"===n.config.componentName?n.placeholder=this.$tc("sw-settings.system-config.inherited"):"bool"===n.type?n.config.inheritedValue=this.actualConfigData.null[n.name]||!1:"password"===n.type?(n.placeholderIsPassword=!0,n.placeholder="".concat(this.actualConfigData.null[n.name])):"multi-select"===n.type||o.isUndefined(this.actualConfigData.null[n.name])||(n.placeholder="".concat(this.actualConfigData.null[n.name]))),["single-select","multi-select"].includes(n.type)&&(n.config.labelProperty="name",n.config.valueProperty="id"),n},handleRatepayProfileUpdates:function(e){var n=this.$refs.systemConfig.currentSalesChannelId;if(e.payoneRatepayProfilesUpdateResult&&e.payoneRatepayProfilesUpdateResult[n]){var t=e.payoneRatepayProfilesUpdateResult[n];this.$root.$emit("payone-ratepay-profiles-update-result",t),Array.isArray(t.errors)||this.createNotificationError({title:this.$tc("payone-payment.settingsForm.titleError"),message:this.$tc("payone-payment.settingsForm.messageSaveError.ratepayProfilesUpdateFailed")})}}}}},jqOd:function(e,n,t){},"oAJ+":function(e,n,t){var a=t("jqOd");a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,t("ydqr").default)("8689c210",a,!0,{})},ydqr:function(e,n,t){"use strict";function a(e,n){for(var t=[],a={},i=0;it.parts.length&&(a.parts.length=t.parts.length)}else{var o=[];for(i=0;i\n {% block payone_payment_header %}\n \n {% endblock %}\n\n {% block payone_payment_actions %}\n \n {% endblock %}\n\n {% block payone_payment_settings_content %}\n \n {% endblock %}\n\n{% endblock %}\n',mixins:[a.getByName("notification"),a.getByName("sw-inline-snippet")],inject:["PayonePaymentSettingsService"],data:function(){return{isLoading:!1,isTesting:!1,isSaveSuccessful:!1,isTestSuccessful:!1,isApplePayCertConfigured:!0,config:{},merchantIdFilled:!1,accountIdFilled:!1,portalIdFilled:!1,portalKeyFilled:!1,showValidationErrors:!1,isSupportModalOpen:!1,stateMachineTransitionActions:[],displayStatusMapping:{},collapsibleState:{status_mapping:!0,payment_credit_card:!0,payment_paypal:!0,payment_paypal_express:!0,payment_debit:!0,payment_sofort:!0,payment_payolution_installment:!0,payment_payolution_invoicing:!0,payment_payolution_debit:!0,payment_eps:!0,payment_ideal:!0,payment_paydirekt:!0,payment_prepayment:!0,payment_trustly:!0,payment_secure_invoice:!0,payment_open_invoice:!0,payment_apple_pay:!0,payment_bancontact:!0,payment_ratepay_debit:!0,payment_ratepay_installment:!0,payment_ratepay_invoicing:!0,payment_klarna_invoice:!0,payment_klarna_direct_debit:!0,payment_klarna_installment:!0,payment_przelewy24:!0,payment_we_chat_pay:!0,payment_postfinanceCard:!0,payment_postfinanceWallet:!0,payment_alipay:!0,payment_secured_invoice:!0,payment_secured_installment:!0,payment_secured_direct_debit:!0}}},created:function(){this.createdComponent()},computed:{credentialsMissing:function(){return!(this.merchantIdFilled&&this.accountIdFilled&&this.portalIdFilled&&this.portalKeyFilled)}},metaInfo:function(){return{title:this.$createTitle()}},methods:{createdComponent:function(){var e=this,n=this;this.PayonePaymentSettingsService.getStateMachineTransitionActions().then((function(e){e.data.forEach((function(e){var t="payone-payment.transitionActionNames."+e.label,a=n.$t(t);a===t&&(a=e.label),n.stateMachineTransitionActions.push({label:a,value:e.value})}))})),this.PayonePaymentSettingsService.hasApplePayCert().then((function(n){e.isApplePayCertConfigured=n}))},paymentMethodPrefixes:function(){return["creditCard","debit","paypal","paypalExpress","payolutionInvoicing","payolutionInstallment","payolutionDebit","sofort","eps","iDeal","paydirekt","prepayment","trustly","secureInvoice","openInvoice","applePay","bancontact","ratepayDebit","ratepayInstallment","ratepayInvoicing","klarnaInvoice","klarnaDirectDebit","klarnaInstallment","przelewy24","weChatPay","postfinanceCard","postfinanceWallet","alipay","securedInvoice","securedInstallment","securedDirectDebit"]},isVisiblePaymentMethodCard:function(e){return e.name.startsWith("payment")&&!this.isCollapsed(e)},isCollapsible:function(e){return e.name in this.collapsibleState},displayField:function(e,n,t){return!(t.name in this.collapsibleState)||!this.collapsibleState[t.name]},isCollapsed:function(e){return this.collapsibleState[e.name]},toggleCollapsible:function(e){e.name in this.collapsibleState&&(this.collapsibleState[e.name]=!this.collapsibleState[e.name])},saveFinish:function(){this.isSaveSuccessful=!1},testFinish:function(){this.isTestSuccessful=!1},onConfigChange:function(e){this.config=e,this.checkCredentialsFilled(),this.showValidationErrors=!1},checkCredentialsFilled:function(){this.merchantIdFilled=!!this.getConfigValue("merchantId"),this.accountIdFilled=!!this.getConfigValue("accountId"),this.portalIdFilled=!!this.getConfigValue("portalId"),this.portalKeyFilled=!!this.getConfigValue("portalKey")},getConfigValue:function(e){var n=this.$refs.systemConfig.actualConfigData.null;return null===this.$refs.systemConfig.currentSalesChannelId?this.config["PayonePayment.settings.".concat(e)]:this.config["PayonePayment.settings.".concat(e)]||n["PayonePayment.settings.".concat(e)]},getPaymentConfigValue:function(e,n){var t=e.charAt(0).toUpperCase()+e.slice(1);return this.getConfigValue(n+t)||this.getConfigValue(e)},onSave:function(){var e=this;this.credentialsMissing?this.showValidationErrors=!0:(this.isSaveSuccessful=!1,this.isLoading=!0,this.$refs.systemConfig.saveAll().then((function(n){e.handleRatepayProfileUpdates(n),e.isLoading=!1,e.isSaveSuccessful=!0})).catch((function(){e.isLoading=!1})))},onTest:function(){var e=this;this.isTesting=!0,this.isTestSuccessful=!1;var n={};this.paymentMethodPrefixes().forEach((function(t){n[t]={merchantId:e.getPaymentConfigValue("merchantId",t),accountId:e.getPaymentConfigValue("accountId",t),portalId:e.getPaymentConfigValue("portalId",t),portalKey:e.getPaymentConfigValue("portalKey",t)}})),this.PayonePaymentSettingsService.validateApiCredentials(n).then((function(n){var t=n.testCount,a=n.credentialsValid,i=n.errors;if(a)e.createNotificationSuccess({title:e.$tc("payone-payment.settingsForm.titleSuccess"),message:t>0?e.$tc("payone-payment.settingsForm.messageTestSuccess"):e.$tc("payone-payment.settingsForm.messageTestNoTestedPayments")}),e.isTestSuccessful=!0;else for(var s in i)if(i.hasOwnProperty(s)){e.createNotificationError({title:e.$tc("payone-payment.settingsForm.titleError"),message:e.$tc("payone-payment.settingsForm.messageTestError."+s)});var o=i[s];"string"==typeof o&&e.createNotificationError({title:e.$tc("payone-payment.settingsForm.titleError"),message:o})}e.isTesting=!1})).catch((function(n){e.createNotificationError({title:e.$tc("payone-payment.settingsForm.titleError"),message:e.$tc("payone-payment.settingsForm.messageTestError.general")}),e.isTesting=!1}))},getBind:function(e,n){var t;return n!==this.config&&(this.config=n),this.showValidationErrors&&("PayonePayment.settings.merchantId"!==e.name||this.merchantIdFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")}),"PayonePayment.settings.accountId"!==e.name||this.accountIdFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")}),"PayonePayment.settings.portalId"!==e.name||this.portalIdFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")}),"PayonePayment.settings.portalKey"!==e.name||this.portalKeyFilled||(e.config.error={code:1,detail:this.$tc("payone-payment.messageNotBlank")})),this.$refs.systemConfig.config.forEach((function(n){n.elements.forEach((function(n){n.name!==e.name||(t=n)}))})),t||e},getElementBind:function(e){var n=s.deepCopyObject(e);return null!==this.currentSalesChannelId&&this.inherit&&this.actualConfigData.hasOwnProperty("null")&&null!==this.actualConfigData.null[n.name]&&("single-select"===n.type||"sw-entity-single-select"===n.config.componentName?n.placeholder=this.$tc("sw-settings.system-config.inherited"):"bool"===n.type?n.config.inheritedValue=this.actualConfigData.null[n.name]||!1:"password"===n.type?(n.placeholderIsPassword=!0,n.placeholder="".concat(this.actualConfigData.null[n.name])):"multi-select"===n.type||o.isUndefined(this.actualConfigData.null[n.name])||(n.placeholder="".concat(this.actualConfigData.null[n.name]))),["single-select","multi-select"].includes(n.type)&&(n.config.labelProperty="name",n.config.valueProperty="id"),n},handleRatepayProfileUpdates:function(e){var n=this.$refs.systemConfig.currentSalesChannelId;if(e.payoneRatepayProfilesUpdateResult&&e.payoneRatepayProfilesUpdateResult[n]){var t=e.payoneRatepayProfilesUpdateResult[n];this.$root.$emit("payone-ratepay-profiles-update-result",t),Array.isArray(t.errors)||this.createNotificationError({title:this.$tc("payone-payment.settingsForm.titleError"),message:this.$tc("payone-payment.settingsForm.messageSaveError.ratepayProfilesUpdateFailed")})}}}}},lq05:function(e,n,t){},qRMf:function(e,n,t){var a=t("lq05");a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,t("ydqr").default)("08a3d81c",a,!0,{})},ydqr:function(e,n,t){"use strict";function a(e,n){for(var t=[],a={},i=0;it.parts.length&&(a.parts.length=t.parts.length)}else{var o=[];for(i=0;i\n \n \n {{ $tc(\'sw-order.payone-payment.capture.buttonTitle\') }}\n \n \n\n \n \n \n\n
\n \n \n \n \n \n \n
\n\n \n
\n \n{% endblock %}\n',mixins:[a.getByName("notification")],inject:["PayonePaymentService","repositoryFactory"],props:{order:{type:Object,required:!0},transaction:{type:Object,required:!0}},computed:{decimalPrecision:function(){return this.order&&this.order.currency?this.order.currency.decimalPrecision?this.order.currency.decimalPrecision:this.order.currency.itemRounding?this.order.currency.itemRounding.decimals:void 0:2},totalTransactionAmount:function(){return Math.round(this.transaction.amount.totalPrice*Math.pow(10,this.decimalPrecision),0)},capturedAmount:function(){return this.transaction.extensions&&this.transaction.extensions.payonePaymentOrderTransactionData&&this.transaction.extensions.payonePaymentOrderTransactionData.capturedAmount?this.transaction.extensions.payonePaymentOrderTransactionData.capturedAmount:0},remainingAmount:function(){return this.totalTransactionAmount-this.capturedAmount},maxCaptureAmount:function(){return this.remainingAmount/Math.pow(10,this.decimalPrecision)},buttonEnabled:function(){return!(!this.transaction.extensions||!this.transaction.extensions.payonePaymentOrderTransactionData)&&(this.remainingAmount>0&&this.capturedAmount>0||this.transaction.extensions.payonePaymentOrderTransactionData.allowCapture)},isItemSelected:function(){var e=!1;return this.selection.forEach((function(t){t.selected&&(e=!0)})),e},hasRemainingShippingCosts:function(){var e=this;if(this.order.shippingCosts.totalPrice<=0)return!1;var t=this.order.shippingCosts.totalPrice*Math.pow(10,this.decimalPrecision),n=0;return this.order.lineItems.forEach((function(t){t.customFields&&t.customFields.payone_captured_quantity&&0=t)}},data:function(){return{isLoading:!1,hasError:!1,showCaptureModal:!1,isCaptureSuccessful:!1,selection:[],captureAmount:0,includeShippingCosts:!1}},methods:{calculateCaptureAmount:function(){var e=0;this.selection.forEach((function(t){t.selected&&(e+=t.unit_price*t.quantity)})),e>this.remainingAmount&&(e=this.remainingAmount),this.captureAmount=e},openCaptureModal:function(){this.showCaptureModal=!0,this.isCaptureSuccessful=!1,this.selection=[]},closeCaptureModal:function(){this.showCaptureModal=!1},onCaptureFinished:function(){this.isCaptureSuccessful=!1},captureOrder:function(){var e=this,t={orderTransactionId:this.transaction.id,payone_order_id:this.transaction.extensions.payonePaymentOrderTransactionData.transactionId,salesChannel:this.order.salesChannel,amount:this.captureAmount,orderLines:[],complete:this.captureAmount===this.remainingAmount,includeShippingCosts:!1};this.isLoading=!0,this.selection.forEach((function(n){e.order.lineItems.forEach((function(e){if(e.id===n.id&&n.selected&&00&&this.selection.push({id:"shipping",quantity:1,unit_price:this.order.shippingCosts.totalPrice,selected:!1})}}}},TSIe:function(e,t,n){var i=n("MK54");i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);(0,n("ydqr").default)("5d3c9d2a",i,!0,{})},ydqr:function(e,t,n){"use strict";function i(e,t){for(var n=[],i={},r=0;rn.parts.length&&(i.parts.length=n.parts.length)}else{var a=[];for(r=0;r\n \n \n {{ $tc(\'sw-order.payone-payment.capture.buttonTitle\') }}\n \n \n\n \n \n \n\n
\n \n \n \n \n \n \n
\n\n \n
\n \n{% endblock %}\n',mixins:[a.getByName("notification")],inject:["PayonePaymentService","repositoryFactory"],props:{order:{type:Object,required:!0},transaction:{type:Object,required:!0}},computed:{decimalPrecision:function(){return this.order&&this.order.currency?this.order.currency.decimalPrecision?this.order.currency.decimalPrecision:this.order.currency.itemRounding?this.order.currency.itemRounding.decimals:void 0:2},totalTransactionAmount:function(){return Math.round(this.transaction.amount.totalPrice*Math.pow(10,this.decimalPrecision),0)},capturedAmount:function(){return this.transaction.extensions&&this.transaction.extensions.payonePaymentOrderTransactionData&&this.transaction.extensions.payonePaymentOrderTransactionData.capturedAmount?this.transaction.extensions.payonePaymentOrderTransactionData.capturedAmount:0},remainingAmount:function(){return this.totalTransactionAmount-this.capturedAmount},maxCaptureAmount:function(){return this.remainingAmount/Math.pow(10,this.decimalPrecision)},buttonEnabled:function(){return!(!this.transaction.extensions||!this.transaction.extensions.payonePaymentOrderTransactionData)&&(this.remainingAmount>0&&this.capturedAmount>0||this.transaction.extensions.payonePaymentOrderTransactionData.allowCapture)},isItemSelected:function(){var e=!1;return this.selection.forEach((function(t){t.selected&&(e=!0)})),e},hasRemainingShippingCosts:function(){var e=this;if(this.order.shippingCosts.totalPrice<=0)return!1;var t=this.order.shippingCosts.totalPrice*Math.pow(10,this.decimalPrecision),n=0;return this.order.lineItems.forEach((function(t){t.customFields&&t.customFields.payone_captured_quantity&&0=t)}},data:function(){return{isLoading:!1,hasError:!1,showCaptureModal:!1,isCaptureSuccessful:!1,selection:[],captureAmount:0,includeShippingCosts:!1}},methods:{calculateCaptureAmount:function(){var e=0;this.selection.forEach((function(t){t.selected&&(e+=t.unit_price*t.quantity)})),e>this.remainingAmount&&(e=this.remainingAmount),this.captureAmount=e},openCaptureModal:function(){this.showCaptureModal=!0,this.isCaptureSuccessful=!1,this.selection=[]},closeCaptureModal:function(){this.showCaptureModal=!1},onCaptureFinished:function(){this.isCaptureSuccessful=!1},captureOrder:function(){var e=this,t={orderTransactionId:this.transaction.id,payone_order_id:this.transaction.extensions.payonePaymentOrderTransactionData.transactionId,salesChannel:this.order.salesChannel,amount:this.captureAmount,orderLines:[],complete:this.captureAmount===this.remainingAmount,includeShippingCosts:!1};this.isLoading=!0,this.selection.forEach((function(n){e.order.lineItems.forEach((function(e){if(e.id===n.id&&n.selected&&00&&this.selection.push({id:"shipping",quantity:1,unit_price:this.order.shippingCosts.totalPrice,selected:!1})}}}},"dI/e":function(e,t,n){},ydqr:function(e,t,n){"use strict";function i(e,t){for(var n=[],i={},r=0;rn.parts.length&&(i.parts.length=n.parts.length)}else{var a=[];for(r=0;r\n \n\n \n\n \n\n \n \n \n{% endblock %}\n',props:{order:{type:Object,required:!0},mode:{type:String,required:!1}},computed:{orderItems:function(){var e=this,t=[];return this.order.lineItems.forEach((function(n){var r=e.$options.filters.currency(n.totalPrice,e.order.currency.shortName,e.order.decimal_precision),i=!1,o=n.quantity;n.customFields&&("refund"===e.mode?(n.customFields.payone_captured_quantity&&0>n.customFields.payone_captured_quantity&&(o=n.customFields.payone_captured_quantity),n.customFields.payone_refunded_quantity&&(o-=n.customFields.payone_refunded_quantity)):"capture"===e.mode&&n.customFields.payone_captured_quantity&&0o&&(i=!0),t.push({id:n.id,product:n.label,quantity:o,disabled:i,selected:!1,price:r,orderItem:n})})),this.order.shippingCosts.totalPrice>0&&t.push({id:"shipping",product:this.$tc("sw-order.payone-payment.modal.shippingCosts"),quantity:1,disabled:!1,selected:!1,price:this.$options.filters.currency(this.order.shippingCosts.totalPrice,this.order.currency.shortName,this.order.decimal_precision),orderItem:{}}),t},orderItemColumns:function(){return[{property:"product",label:this.$tc("sw-order.payone-payment.modal.columns.product"),rawData:!0},{property:"quantity",label:this.$tc("sw-order.payone-payment.modal.columns.quantity"),rawData:!0},{property:"price",label:this.$tc("sw-order.payone-payment.modal.columns.price"),rawData:!0}]}},methods:{onSelectItem:function(e,t,n){this.$emit("select-item",t.id,n)},onChangeQuantity:function(e,t){this.$emit("change-quantity",t,e)}}}},naOn:function(e,t,n){var r=n("DKmX");r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n("ydqr").default)("7dad8d82",r,!0,{})},ydqr:function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},i=0;in.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(i=0;i\n \n\n \n\n \n\n \n \n \n{% endblock %}\n',props:{order:{type:Object,required:!0},mode:{type:String,required:!1}},computed:{orderItems:function(){var e=this,t=[];return this.order.lineItems.forEach((function(n){var r=e.$options.filters.currency(n.totalPrice,e.order.currency.shortName,e.order.decimal_precision),i=!1,o=n.quantity;n.customFields&&("refund"===e.mode?(n.customFields.payone_captured_quantity&&0>n.customFields.payone_captured_quantity&&(o=n.customFields.payone_captured_quantity),n.customFields.payone_refunded_quantity&&(o-=n.customFields.payone_refunded_quantity)):"capture"===e.mode&&n.customFields.payone_captured_quantity&&0o&&(i=!0),t.push({id:n.id,product:n.label,quantity:o,disabled:i,selected:!1,price:r,orderItem:n})})),this.order.shippingCosts.totalPrice>0&&t.push({id:"shipping",product:this.$tc("sw-order.payone-payment.modal.shippingCosts"),quantity:1,disabled:!1,selected:!1,price:this.$options.filters.currency(this.order.shippingCosts.totalPrice,this.order.currency.shortName,this.order.decimal_precision),orderItem:{}}),t},orderItemColumns:function(){return[{property:"product",label:this.$tc("sw-order.payone-payment.modal.columns.product"),rawData:!0},{property:"quantity",label:this.$tc("sw-order.payone-payment.modal.columns.quantity"),rawData:!0},{property:"price",label:this.$tc("sw-order.payone-payment.modal.columns.price"),rawData:!0}]}},methods:{onSelectItem:function(e,t,n){this.$emit("select-item",t.id,n)},onChangeQuantity:function(e,t){this.$emit("change-quantity",t,e)}}}},gCjC:function(e,t,n){},ydqr:function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},i=0;in.parts.length&&(r.parts.length=n.parts.length)}else{var s=[];for(i=0;i\n \n \n{% endblock %}\n',inject:["acl","PayonePaymentService","repositoryFactory"],mixins:[a.getByName("notification")],props:{order:{type:Object,required:!0}},data:function(){return{notificationForwards:null}},computed:{payoneTransactions:function(){var e=this;return this.order.transactions.filter((function(n){return e.isPayoneTransaction(n)})).sort((function(e,n){return e.createdAtn.createdAt?-1:0}))},notificationForwardRepository:function(){return this.repositoryFactory.create("payone_payment_notification_forward")},notificationTargetColumns:function(){return[{property:"txaction",type:"text",width:"100px"},{property:"notificationTarget.url",type:"text"},{property:"response",width:"100px"},{property:"updatedAt",align:"right",type:"date"}]}},methods:{isPayoneTransaction:function(e){return!!(e.extensions&&e.extensions.payonePaymentOrderTransactionData&&e.extensions.payonePaymentOrderTransactionData.transactionId)&&e.extensions.payonePaymentOrderTransactionData.transactionId},isActiveTransaction:function(e){return"cancelled"!==e.stateMachineState.technicalName},hasNotificationForwards:function(e){return null===this.notificationForwards?(this.getNotificationForwards(e),!1):this.notificationForwards.length>0},getNotificationForwards:function(e){var n=this,t=new r;return t.addAssociation("notificationTarget"),t.addSorting(r.sort("updatedAt","DESC",!0)),t.addFilter(r.equals("transactionId",e.id)),t.setLimit(500),this.notificationForwardRepository.search(t,Shopware.Context.api).then((function(e){n.notificationForwards=e}))},requeue:function(e,n){var t=this,a={notificationForwardId:e.id};this.PayonePaymentService.requeueNotificationForward(a).then((function(){t.createNotificationSuccess({title:t.$tc("payonePayment.notificationTarget.actions.requeue"),message:t.$tc("payonePayment.notificationTarget.messages.success")}),t.getNotificationForwards(n)})).catch((function(e){t.createNotificationError({title:t.$tc("payonePayment.notificationTarget.actions.requeue"),message:e.message})})).finally((function(){t.$nextTick().then((function(){t.$emit("reload")}))}))},can:function(e){try{return this.acl.can(e)}catch(e){return!0}},reloadEntityData:function(){this.$emit("reload-entity-data")},getPayoneCardType:function(e){var n,t,a=null===(n=e.extensions.payonePaymentOrderTransactionData)||void 0===n||null===(t=n.additionalData)||void 0===t?void 0:t.card_type;return a?this.$tc("sw-order.payone-payment.creditCard.cardTypes."+a):null}}}},ydqr:function(e,n,t){"use strict";function a(e,n){for(var t=[],a={},r=0;rt.parts.length&&(a.parts.length=t.parts.length)}else{var i=[];for(r=0;r\n \n \n{% endblock %}\n',inject:["acl","PayonePaymentService","repositoryFactory"],mixins:[a.getByName("notification")],props:{order:{type:Object,required:!0}},data:function(){return{notificationForwards:null}},computed:{payoneTransactions:function(){var e=this;return this.order.transactions.filter((function(n){return e.isPayoneTransaction(n)})).sort((function(e,n){return e.createdAtn.createdAt?-1:0}))},notificationForwardRepository:function(){return this.repositoryFactory.create("payone_payment_notification_forward")},notificationTargetColumns:function(){return[{property:"txaction",type:"text",width:"100px"},{property:"notificationTarget.url",type:"text"},{property:"response",width:"100px"},{property:"updatedAt",align:"right",type:"date"}]}},methods:{isPayoneTransaction:function(e){return!!(e.extensions&&e.extensions.payonePaymentOrderTransactionData&&e.extensions.payonePaymentOrderTransactionData.transactionId)&&e.extensions.payonePaymentOrderTransactionData.transactionId},isActiveTransaction:function(e){return"cancelled"!==e.stateMachineState.technicalName},hasNotificationForwards:function(e){return null===this.notificationForwards?(this.getNotificationForwards(e),!1):this.notificationForwards.length>0},getNotificationForwards:function(e){var n=this,t=new r;return t.addAssociation("notificationTarget"),t.addSorting(r.sort("updatedAt","DESC",!0)),t.addFilter(r.equals("transactionId",e.id)),t.setLimit(500),this.notificationForwardRepository.search(t,Shopware.Context.api).then((function(e){n.notificationForwards=e}))},requeue:function(e,n){var t=this,a={notificationForwardId:e.id};this.PayonePaymentService.requeueNotificationForward(a).then((function(){t.createNotificationSuccess({title:t.$tc("payonePayment.notificationTarget.actions.requeue"),message:t.$tc("payonePayment.notificationTarget.messages.success")}),t.getNotificationForwards(n)})).catch((function(e){t.createNotificationError({title:t.$tc("payonePayment.notificationTarget.actions.requeue"),message:e.message})})).finally((function(){t.$nextTick().then((function(){t.$emit("reload")}))}))},can:function(e){try{return this.acl.can(e)}catch(e){return!0}},reloadEntityData:function(){this.$emit("reload-entity-data")},getPayoneCardType:function(e){var n,t,a=null===(n=e.extensions.payonePaymentOrderTransactionData)||void 0===n||null===(t=n.additionalData)||void 0===t?void 0:t.card_type;return a?this.$tc("sw-order.payone-payment.creditCard.cardTypes."+a):null}}}},"yD9+":function(e,n,t){var a=t("2cJs");a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,t("ydqr").default)("69ded2df",a,!0,{})},ydqr:function(e,n,t){"use strict";function a(e,n){for(var t=[],a={},r=0;rt.parts.length&&(a.parts.length=t.parts.length)}else{var i=[];for(r=0;r\n \n \n {{ $tc(\'sw-order.payone-payment.refund.buttonTitle\') }}\n \n \n\n \n \n \n\n
\n \n \n \n \n \n \n
\n\n \n
\n \n{% endblock %}\n',mixins:[s.getByName("notification")],inject:["PayonePaymentService"],props:{order:{type:Object,required:!0},transaction:{type:Object,required:!0}},data:function(){return{isLoading:!1,hasError:!1,showRefundModal:!1,isRefundSuccessful:!1,selection:[],refundAmount:0,includeShippingCosts:!1}},computed:{decimalPrecision:function(){return this.order&&this.order.currency?this.order.currency.decimalPrecision?this.order.currency.decimalPrecision:this.order.currency.itemRounding?this.order.currency.itemRounding.decimals:void 0:2},remainingAmount:function(){return this.transaction.extensions&&this.transaction.extensions.payonePaymentOrderTransactionData&&this.transaction.extensions.payonePaymentOrderTransactionData.capturedAmount?this.transaction.extensions.payonePaymentOrderTransactionData.capturedAmount-this.refundedAmount:0},refundedAmount:function(){return this.transaction.extensions&&this.transaction.extensions.payonePaymentOrderTransactionData&&!this.transaction.extensions.payonePaymentOrderTransactionData.refundedAmount?this.transaction.extensions.payonePaymentOrderTransactionData.refundedAmount:0},maxRefundAmount:function(){return this.remainingAmount/Math.pow(10,this.decimalPrecision)},buttonEnabled:function(){return!(!this.transaction.extensions||!this.transaction.extensions.payonePaymentOrderTransactionData)&&(this.remainingAmount>0&&this.refundedAmount>0||this.transaction.extensions.payonePaymentOrderTransactionData.allowRefund)},hasRemainingRefundableShippingCosts:function(){var e=this;if(this.order.shippingCosts.totalPrice<=0)return!1;var n=this.order.shippingCosts.totalPrice*Math.pow(10,this.decimalPrecision),t=0;return this.order.lineItems.forEach((function(n){n.customFields&&n.customFields.payone_refunded_quantity&&0=n)}},methods:{calculateRefundAmount:function(){var e=0;this.selection.forEach((function(n){n.selected&&(e+=n.unit_price*n.quantity)})),Math.round(e*Math.pow(10,this.decimalPrecision)>this.remainingAmount)&&(e=this.remainingAmount/Math.pow(10,this.decimalPrecision)),this.refundAmount=e},openRefundModal:function(){this.showRefundModal=!0,this.isRefundSuccessful=!1,this.selection=[]},closeRefundModal:function(){this.showRefundModal=!1},onRefundFinished:function(){this.isRefundSuccessful=!1},refundOrder:function(){var e=this,n={orderTransactionId:this.transaction.id,payone_order_id:this.transaction.extensions.payonePaymentOrderTransactionData.transactionId,salesChannel:this.order.salesChannel,amount:this.refundAmount,orderLines:[],complete:this.refundAmount===this.maxRefundAmount,includeShippingCosts:!1};this.isLoading=!0,this.selection.forEach((function(t){e.order.lineItems.forEach((function(i){if(i.id===t.id&&t.selected&&00&&this.selection.push({id:"shipping",quantity:1,unit_price:this.order.shippingCosts.totalPrice,selected:!1})}}}},YRDH:function(e,n,t){var i=t("Jp+7");i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);(0,t("ydqr").default)("24043130",i,!0,{})},ydqr:function(e,n,t){"use strict";function i(e,n){for(var t=[],i={},r=0;rt.parts.length&&(i.parts.length=t.parts.length)}else{var s=[];for(r=0;r\n \n \n {{ $tc(\'sw-order.payone-payment.refund.buttonTitle\') }}\n \n \n\n \n \n \n\n
\n \n \n \n \n \n \n
\n\n \n
\n \n{% endblock %}\n',mixins:[s.getByName("notification")],inject:["PayonePaymentService"],props:{order:{type:Object,required:!0},transaction:{type:Object,required:!0}},data:function(){return{isLoading:!1,hasError:!1,showRefundModal:!1,isRefundSuccessful:!1,selection:[],refundAmount:0,includeShippingCosts:!1}},computed:{decimalPrecision:function(){return this.order&&this.order.currency?this.order.currency.decimalPrecision?this.order.currency.decimalPrecision:this.order.currency.itemRounding?this.order.currency.itemRounding.decimals:void 0:2},remainingAmount:function(){return this.transaction.extensions&&this.transaction.extensions.payonePaymentOrderTransactionData&&this.transaction.extensions.payonePaymentOrderTransactionData.capturedAmount?this.transaction.extensions.payonePaymentOrderTransactionData.capturedAmount-this.refundedAmount:0},refundedAmount:function(){return this.transaction.extensions&&this.transaction.extensions.payonePaymentOrderTransactionData&&!this.transaction.extensions.payonePaymentOrderTransactionData.refundedAmount?this.transaction.extensions.payonePaymentOrderTransactionData.refundedAmount:0},maxRefundAmount:function(){return this.remainingAmount/Math.pow(10,this.decimalPrecision)},buttonEnabled:function(){return!(!this.transaction.extensions||!this.transaction.extensions.payonePaymentOrderTransactionData)&&(this.remainingAmount>0&&this.refundedAmount>0||this.transaction.extensions.payonePaymentOrderTransactionData.allowRefund)},hasRemainingRefundableShippingCosts:function(){var e=this;if(this.order.shippingCosts.totalPrice<=0)return!1;var n=this.order.shippingCosts.totalPrice*Math.pow(10,this.decimalPrecision),t=0;return this.order.lineItems.forEach((function(n){n.customFields&&n.customFields.payone_refunded_quantity&&0=n)}},methods:{calculateRefundAmount:function(){var e=0;this.selection.forEach((function(n){n.selected&&(e+=n.unit_price*n.quantity)})),Math.round(e*Math.pow(10,this.decimalPrecision)>this.remainingAmount)&&(e=this.remainingAmount/Math.pow(10,this.decimalPrecision)),this.refundAmount=e},openRefundModal:function(){this.showRefundModal=!0,this.isRefundSuccessful=!1,this.selection=[]},closeRefundModal:function(){this.showRefundModal=!1},onRefundFinished:function(){this.isRefundSuccessful=!1},refundOrder:function(){var e=this,n={orderTransactionId:this.transaction.id,payone_order_id:this.transaction.extensions.payonePaymentOrderTransactionData.transactionId,salesChannel:this.order.salesChannel,amount:this.refundAmount,orderLines:[],complete:this.refundAmount===this.maxRefundAmount,includeShippingCosts:!1};this.isLoading=!0,this.selection.forEach((function(t){e.order.lineItems.forEach((function(i){if(i.id===t.id&&t.selected&&00&&this.selection.push({id:"shipping",quantity:1,unit_price:this.order.shippingCosts.totalPrice,selected:!1})}}}},qHQE:function(e,n,t){var i=t("y+rm");i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);(0,t("ydqr").default)("dae34a40",i,!0,{})},"y+rm":function(e,n,t){},ydqr:function(e,n,t){"use strict";function i(e,n){for(var t=[],i={},r=0;rt.parts.length&&(i.parts.length=t.parts.length)}else{var s=[];for(r=0;r\n\n {% block payone_notification_target_detail_header %}\n \n {% endblock %}\n\n {% block payone_notification_target_detail_actions %}\n \n {% endblock %}\n\n {% block payone_notification_target_detail_content %}\n \n\n {% block payone_notification_target_detail_base_basic_info_card %}\n \n \n \n {% endblock %}\n \n {% endblock %}\n\n \n{% endblock %}\n',inject:["repositoryFactory"],mixins:[a.getByName("notification")],shortcuts:{"SYSTEMKEY+S":"onSave",ESCAPE:"onCancel"},props:{notificationTargetId:{type:String,required:!1,default:null}},data:function(){return{notificationTarget:null,isLoading:!1,isSaveSuccessful:!1}},metaInfo:function(){return{title:this.$createTitle(this.identifier)}},computed:{notificationTargetIsLoading:function(){return this.isLoading||null==this.notificationTarget},notificationTargetRepository:function(){return this.repositoryFactory.create("payone_payment_notification_target")}},watch:{notificationTargetId:function(){this.createdComponent()}},created:function(){this.createdComponent()},methods:{updateSelection:function(t){this.notificationTarget.txactions=t},createdComponent:function(){this.notificationTargetId?this.loadEntityData():(Shopware.State.commit("context/resetLanguageToDefault"),this.notificationTarget=this.notificationTargetRepository.create(Shopware.Context.api))},loadEntityData:function(){var t=this;this.isLoading=!0,this.notificationTargetRepository.get(this.notificationTargetId,Shopware.Context.api).then((function(n){t.isLoading=!1,t.notificationTarget=n,null!==n.txactions&&(n.txactions.length||(t.notificationTarget.txactions=null))}))},isInvalid:function(){return!0===this.notificationTarget.isBasicAuth&&((!this.notificationTarget.username||!this.notificationTarget.password)&&(this.createNotificationError({message:this.$tc("global.notification.notificationSaveErrorMessageRequiredFieldsInvalid")}),!0))},onSave:function(){var t=this;this.isInvalid()||(this.isLoading=!0,this.notificationTargetRepository.save(this.notificationTarget,Shopware.Context.api).then((function(){t.isLoading=!1,t.isSaveSuccessful=!0,null!==t.notificationTargetId?t.loadEntityData():t.$router.push({name:"payone.notification.target.detail",params:{id:t.notificationTarget.id}})})).catch((function(n){throw t.isLoading=!1,t.createNotificationError({message:t.$tc("global.notification.notificationSaveErrorMessageRequiredFieldsInvalid")}),n})))},onCancel:function(){this.$router.push({name:"payone.notification.target.list"})}}}}}]); \ No newline at end of file +(this["webpackJsonpPluginpayone-payment"]=this["webpackJsonpPluginpayone-payment"]||[]).push([[8],{E0nA:function(t,n,i){"use strict";i.r(n);var a=Shopware.Mixin;n.default={template:'{% block payone_notification_target_detail %}\n \n\n {% block payone_notification_target_detail_header %}\n \n {% endblock %}\n\n {% block payone_notification_target_detail_actions %}\n \n {% endblock %}\n\n {% block payone_notification_target_detail_content %}\n \n\n {% block payone_notification_target_detail_base_basic_info_card %}\n \n \n \n {% endblock %}\n \n {% endblock %}\n\n \n{% endblock %}\n',inject:["repositoryFactory"],mixins:[a.getByName("notification")],shortcuts:{"SYSTEMKEY+S":"onSave",ESCAPE:"onCancel"},props:{notificationTargetId:{type:String,required:!1,default:null}},data:function(){return{notificationTarget:null,isLoading:!1,isSaveSuccessful:!1}},metaInfo:function(){return{title:this.$createTitle(this.identifier)}},computed:{notificationTargetIsLoading:function(){return this.isLoading||null==this.notificationTarget},notificationTargetRepository:function(){return this.repositoryFactory.create("payone_payment_notification_target")}},watch:{notificationTargetId:function(){this.createdComponent()}},created:function(){this.createdComponent()},methods:{updateSelection:function(t){this.notificationTarget.txactions=t},createdComponent:function(){this.notificationTargetId?this.loadEntityData():(Shopware.State.commit("context/resetLanguageToDefault"),this.notificationTarget=this.notificationTargetRepository.create(Shopware.Context.api))},loadEntityData:function(){var t=this;this.isLoading=!0,this.notificationTargetRepository.get(this.notificationTargetId,Shopware.Context.api).then((function(n){t.isLoading=!1,t.notificationTarget=n,null!==n.txactions&&(n.txactions.length||(t.notificationTarget.txactions=null))}))},isInvalid:function(){return!0===this.notificationTarget.isBasicAuth&&((!this.notificationTarget.username||!this.notificationTarget.password)&&(this.createNotificationError({message:this.$tc("global.notification.notificationSaveErrorMessageRequiredFieldsInvalid")}),!0))},onSave:function(){var t=this;this.isInvalid()||(this.isLoading=!0,this.notificationTargetRepository.save(this.notificationTarget,Shopware.Context.api).then((function(){t.isLoading=!1,t.isSaveSuccessful=!0,null!==t.notificationTargetId?t.loadEntityData():t.$router.push({name:"payone.notification.target.detail",params:{id:t.notificationTarget.id}})})).catch((function(n){throw t.isLoading=!1,t.createNotificationError({message:t.$tc("global.notification.notificationSaveErrorMessageRequiredFieldsInvalid")}),n})))},onCancel:function(){this.$router.push({name:"payone.notification.target.list"})}}}}}]); \ No newline at end of file diff --git a/src/Resources/public/static/js/9.js b/src/Resources/public/static/js/9.js index 822895382..d083c6657 100644 --- a/src/Resources/public/static/js/9.js +++ b/src/Resources/public/static/js/9.js @@ -1 +1 @@ -(this["webpackJsonpPluginpayone-payment"]=this["webpackJsonpPluginpayone-payment"]||[]).push([[9],{G2C5:function(t,n,e){"use strict";e.r(n);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,i)}return e}function a(t){for(var n=1;n\n\n {% block payone_notification_target_list_smart_bar_header %}\n \n {% endblock %}\n\n {% block payone_notification_target_list_actions %}\n \n {% endblock %}\n\n {% block payone_notification_target_list_content %}\n \n {% endblock %}\n\n {% block payone_notification_target_list_sidebar %}\n \n {% endblock %}\n \n{% endblock %}\n',inject:["repositoryFactory"],mixins:[c.getByName("listing")],data:function(){return{isLoading:!1,items:null,sortBy:"createdAt",criteriaLimit:500,criteriaPage:1,limit:500}},metaInfo:function(){return{title:this.$createTitle()}},computed:{notificationTargetColumns:function(){return[{dataIndex:"url",property:"url",label:"payonePayment.notificationTarget.columns.url",primary:!0},{dataIndex:"isBasicAuth",property:"isBasicAuth",label:"payonePayment.notificationTarget.columns.isBasicAuth"},{property:"txactions",label:"payonePayment.notificationTarget.columns.txactions"}]},repository:function(){return this.repositoryFactory.create("payone_payment_notification_target")},criteria:function(){var t=new l(this.criteriaPage,this.criteriaLimit);return t}},created:function(){this.createdComponent()},methods:{renderTxactions:function(t){return null!==t&&t.length?t.join(", "):""},createdComponent:function(){this.getList()},getList:function(){var t=this;this.isLoading=!0;var n=a(a({},Shopware.Context.api),{},{inheritance:!0});return this.repository.search(this.criteria,n).then((function(n){t.total=n.total,t.items=n,t.isLoading=!1}))},onDelete:function(t){this.$refs.listing.deleteItem(t),this.getList()}}}}}]); \ No newline at end of file +(this["webpackJsonpPluginpayone-payment"]=this["webpackJsonpPluginpayone-payment"]||[]).push([[9],{fBd9:function(t,n,e){"use strict";e.r(n);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,i)}return e}function a(t){for(var n=1;n\n\n {% block payone_notification_target_list_smart_bar_header %}\n \n {% endblock %}\n\n {% block payone_notification_target_list_actions %}\n \n {% endblock %}\n\n {% block payone_notification_target_list_content %}\n \n {% endblock %}\n\n {% block payone_notification_target_list_sidebar %}\n \n {% endblock %}\n \n{% endblock %}\n',inject:["repositoryFactory"],mixins:[c.getByName("listing")],data:function(){return{isLoading:!1,items:null,sortBy:"createdAt",criteriaLimit:500,criteriaPage:1,limit:500}},metaInfo:function(){return{title:this.$createTitle()}},computed:{notificationTargetColumns:function(){return[{dataIndex:"url",property:"url",label:"payonePayment.notificationTarget.columns.url",primary:!0},{dataIndex:"isBasicAuth",property:"isBasicAuth",label:"payonePayment.notificationTarget.columns.isBasicAuth"},{property:"txactions",label:"payonePayment.notificationTarget.columns.txactions"}]},repository:function(){return this.repositoryFactory.create("payone_payment_notification_target")},criteria:function(){var t=new l(this.criteriaPage,this.criteriaLimit);return t}},created:function(){this.createdComponent()},methods:{renderTxactions:function(t){return null!==t&&t.length?t.join(", "):""},createdComponent:function(){this.getList()},getList:function(){var t=this;this.isLoading=!0;var n=a(a({},Shopware.Context.api),{},{inheritance:!0});return this.repository.search(this.criteria,n).then((function(n){t.total=n.total,t.items=n,t.isLoading=!1}))},onDelete:function(t){this.$refs.listing.deleteItem(t),this.getList()}}}}}]); \ No newline at end of file diff --git a/src/Resources/views/storefront/payone/payolution/consent-checkbox.html.twig b/src/Resources/views/storefront/payone/payolution/consent-checkbox.html.twig index 6024f32db..2e5c0b53e 100644 --- a/src/Resources/views/storefront/payone/payolution/consent-checkbox.html.twig +++ b/src/Resources/views/storefront/payone/payolution/consent-checkbox.html.twig @@ -1,5 +1,4 @@ {% block payone_payolution_consent_checkbox %} - {% if context.customer.activeBillingAddress and context.customer.activeBillingAddress.company is empty %}