From 3f291ef7ea59e8baa2e2d7f7b92149155b02ff07 Mon Sep 17 00:00:00 2001 From: andrewrowanwallee Date: Wed, 5 Mar 2025 12:03:51 +0100 Subject: [PATCH] Release 6.1.12 --- CHANGELOG.md | 7 + CHANGELOG_de-DE.md | 7 + README.md | 2 +- composer.json | 124 +++++++++--------- docs/en/documentation.html | 2 +- .../PaymentMethodConfigurationService.php | 32 +++-- .../Service/TransactionService.php | 13 +- .../WebHooks/Controller/WebHookController.php | 43 ++++-- .../Strategy/WebHookRefundStrategy.php | 36 ++--- .../WebHooks/Strategy/WebHookStrategyBase.php | 48 +++++-- src/Core/Util/Payload/TransactionPayload.php | 61 +++++---- .../v-r-payment-payment.js | 1 + .../administration/js/v-r-payment-payment.js | 2 +- 13 files changed, 219 insertions(+), 159 deletions(-) create mode 100644 src/Resources/app/storefront/dist/storefront/js/v-r-payment-payment/v-r-payment-payment.js diff --git a/CHANGELOG.md b/CHANGELOG.md index c21a9e8..13bc16b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 6.1.12 +- Compatibility with 6.6.10.x +- Prevent duplicate transactions being created when the first times out +- Fix for error when changing space credentials +- Payment status now shows refunded/partially refunded +- Order delivery status now shows 'open' instead of 'hold' + # 6.1.11 - Implement payment page integration. - Fixed bug with duplicate payment methods appearing diff --git a/CHANGELOG_de-DE.md b/CHANGELOG_de-DE.md index 0be6c97..21d58a6 100644 --- a/CHANGELOG_de-DE.md +++ b/CHANGELOG_de-DE.md @@ -1,3 +1,10 @@ +# 6.1.12 +- Kompatibilität mit 6.6.10.x +- Verhindern Sie, dass beim ersten Timeout doppelte Transaktionen erstellt werden +- Fehler beim Ändern der Space-Anmeldeinformationen behoben +- Der Zahlungsstatus zeigt jetzt „erstattet/teilweise erstattet“ an +- Der Lieferstatus der Bestellung wird jetzt „Offen“ statt „Halten“ angezeigt. + # 6.1.11 - Integration der Zahlungsseite implementieren. - Fehler mit doppelten angezeigten Zahlungsmethoden behoben diff --git a/README.md b/README.md index 579d39f..7e1d57d 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ tail -f var/log/vrpayment_payment*.log ## Documentation -[Documentation](https://gateway.vr-payment.de/doc/shopware-6/6.1.11/docs/en/documentation.html) +[Documentation](https://gateway.vr-payment.de/doc/shopware-6/6.1.12/docs/en/documentation.html) ## License diff --git a/composer.json b/composer.json index cfba3ae..77de7a4 100644 --- a/composer.json +++ b/composer.json @@ -1,63 +1,63 @@ { - "authors": [ - { - "homepage": "https://www.vr-payment.de/", - "name": "VRPay" - } - ], - "autoload": { - "psr-4": { - "VRPaymentPayment\\": "src/" - } - }, - "description": "VRPayment integration for Shopware 6", - "extra": { - "copyright": "(c) by VRPay", - "description": { - "de-DE": "VRPayment integration f\u00fcr Shopware 6", - "en-GB": "VRPayment integration for Shopware 6", - "fr-FR": "Int\u00e9gration de VRPayment pour Shopware 6", - "it-IT": "Integrazione VRPayment per Shopware" - }, - "label": { - "de-DE": "VRPayment Produkte f\u00fcr Shopware 6", - "en-GB": "VRPayment Products for Shopware 6", - "fr-FR": "VRPayment Produits for Shopware 6", - "it-IT": "VRPayment Prodotti per Shopware 6" - }, - "manufacturerLink": { - "de-DE": "https://www.vr-payment.de/", - "en-GB": "https://www.vr-payment.de/", - "fr-FR": "https://www.vr-payment.de/", - "it-IT": "https://www.vr-payment.de/" - }, - "supportLink": { - "de-DE": "https://www.vr-payment.de/hotline", - "en-GB": "https://www.vr-payment.de/hotline", - "fr-FR": "https://www.vr-payment.de/hotline", - "it-IT": "https://www.vr-payment.de/hotline" - }, - "shopware-plugin-class": "VRPaymentPayment\\VRPaymentPayment" - }, - "homepage": "https://www.vr-payment.de//", - "keywords": [ - "VRPay", - "payment", - "php", - "shopware" - ], - "license": "Apache-2.0", - "name": "vrpayment/shopware-6", - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "php": ">=8.2", - "shopware/core": "6.6.*", - "shopware/administration": "~6.6.0", - "shopware/storefront": "6.6.*", - "vrpayment/sdk": "4.6.0" - }, - "type": "shopware-platform-plugin", - "version": "6.1.11" -} \ No newline at end of file + "authors": [ + { + "homepage": "https://www.vr-payment.de/", + "name": "VRPay" + } + ], + "autoload": { + "psr-4": { + "VRPaymentPayment\\": "src/" + } + }, + "description": "VRPayment integration for Shopware 6", + "extra": { + "copyright": "(c) by VRPay", + "description": { + "de-DE": "VRPayment integration für Shopware 6", + "en-GB": "VRPayment integration for Shopware 6", + "fr-FR": "Intégration de VRPayment pour Shopware 6", + "it-IT": "Integrazione VRPayment per Shopware" + }, + "label": { + "de-DE": "VRPayment Produkte für Shopware 6", + "en-GB": "VRPayment Products for Shopware 6", + "fr-FR": "VRPayment Produits for Shopware 6", + "it-IT": "VRPayment Prodotti per Shopware 6" + }, + "manufacturerLink": { + "de-DE": "https://www.vr-payment.de/", + "en-GB": "https://www.vr-payment.de/", + "fr-FR": "https://www.vr-payment.de/", + "it-IT": "https://www.vr-payment.de/" + }, + "supportLink": { + "de-DE": "https://www.vr-payment.de/hotline", + "en-GB": "https://www.vr-payment.de/hotline", + "fr-FR": "https://www.vr-payment.de/hotline", + "it-IT": "https://www.vr-payment.de/hotline" + }, + "shopware-plugin-class": "VRPaymentPayment\\VRPaymentPayment" + }, + "homepage": "https://www.vr-payment.de//", + "keywords": [ + "VRPay", + "payment", + "php", + "shopware" + ], + "license": "Apache-2.0", + "name": "vrpayment/shopware-6", + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "php": ">=8.2", + "shopware/core": "~6.6.0", + "shopware/administration": "~6.6.0", + "shopware/storefront":"~6.6.0", + "vrpayment/sdk": "^4.0.0" + }, + "type": "shopware-platform-plugin", + "version": "6.1.12" +} diff --git a/docs/en/documentation.html b/docs/en/documentation.html index d1c2364..5aac41a 100644 --- a/docs/en/documentation.html +++ b/docs/en/documentation.html @@ -23,7 +23,7 @@
  • - + Source
  • diff --git a/src/Core/Api/PaymentMethodConfiguration/Service/PaymentMethodConfigurationService.php b/src/Core/Api/PaymentMethodConfiguration/Service/PaymentMethodConfigurationService.php index bd6d898..508f807 100644 --- a/src/Core/Api/PaymentMethodConfiguration/Service/PaymentMethodConfigurationService.php +++ b/src/Core/Api/PaymentMethodConfiguration/Service/PaymentMethodConfigurationService.php @@ -213,8 +213,7 @@ class PaymentMethodConfigurationService { { // Configuration $settings = $this->settingsService->getSettings($this->getSalesChannelId()); - $this->setSpaceId($settings->getSpaceId()) - ->setApiClient($settings->getApiClient()); + $this->setSpaceId($settings->getSpaceId())->setApiClient($settings->getApiClient()); $this->disablePaymentMethodConfigurations($context); $this->enablePaymentMethodConfigurations($context); @@ -254,9 +253,14 @@ class PaymentMethodConfigurationService { $paymentMethodData = []; $salesChannelPaymentMethodData = []; - $criteria = (new Criteria())->addFilter(new EqualsFilter('spaceId', $this->getSpaceId())); + $criteria = (new Criteria())->addFilter(new EqualsFilter('state', 'ACTIVE')); - $paymentMethodConfigurationEntities = $this->vRPaymentPaymentMethodConfigurationRepository + /** + * @var $vRPaymentPMConfigurationRepository + */ + $vRPaymentPMConfigurationRepository = $this->container->get(PaymentMethodConfigurationEntityDefinition::ENTITY_NAME . '.repository'); + + $paymentMethodConfigurationEntities = $vRPaymentPMConfigurationRepository ->search($criteria, $context) ->getEntities(); @@ -275,16 +279,11 @@ class PaymentMethodConfigurationService { 'id' => $paymentMethodConfigurationEntity->getId(), 'active' => false, ]; - - $salesChannelPaymentMethodData[] = [ - 'paymentMethodId' => $paymentMethodConfigurationEntity->getId(), - ]; } try { $this->vRPaymentPaymentMethodConfigurationRepository->update($data, $context); $this->paymentMethodRepository->update($paymentMethodData, $context); - $this->salesChannelPaymentRepository->delete($salesChannelPaymentMethodData, $context); } catch (\Exception $exception) { $this->logger->critical($exception->getMessage()); } @@ -369,7 +368,13 @@ class PaymentMethodConfigurationService { ]; $this->upsertPaymentMethod($id, $paymentMethodConfiguration, $context); - $this->vRPaymentPaymentMethodConfigurationRepository->upsert([$data], $context); + + try { + $this->container->get(PaymentMethodConfigurationEntityDefinition::ENTITY_NAME . '.repository')->upsert([$data], $context); + } catch (\Exception $e) { + $this->logger->error($e->getMessage(), [$e->getTraceAsString()]); + } + } } @@ -500,7 +505,12 @@ class PaymentMethodConfigurationService { $data = array_filter($data); - $this->paymentMethodRepository->upsert([$data], $context); + try { + $this->paymentMethodRepository->upsert([$data], $context); + } catch (\Exception $e) { + $this->logger->error($e->getMessage(), [$e->getTraceAsString()]); + } + } /** diff --git a/src/Core/Api/Transaction/Service/TransactionService.php b/src/Core/Api/Transaction/Service/TransactionService.php index 84f7642..64f4754 100644 --- a/src/Core/Api/Transaction/Service/TransactionService.php +++ b/src/Core/Api/Transaction/Service/TransactionService.php @@ -132,13 +132,12 @@ class TransactionService $settings = $this->settingsService->getSettings($salesChannelId); $apiClient = $settings->getApiClient(); - $failedStates = [ - TransactionState::DECLINE, - TransactionState::FAILED, - TransactionState::VOIDED, - ]; - $pendingTransaction = $this->read($_SESSION['transactionId'], $salesChannelId); - if (in_array($pendingTransaction->getState(), $failedStates)) { + $transactionId = $_SESSION['transactionId'] ?? null; + if ($transactionId !== null) { + $pendingTransaction = $this->read($_SESSION['transactionId'], $salesChannelId); + } + + if ($transactionId === null || $pendingTransaction === null || $pendingTransaction->getState() !== TransactionState::PENDING) { unset($_SESSION['transactionId']); $pendingTransactionId = $this->createPendingTransaction($salesChannelContext); $pendingTransaction = $this->read($pendingTransactionId, $salesChannelId); diff --git a/src/Core/Api/WebHooks/Controller/WebHookController.php b/src/Core/Api/WebHooks/Controller/WebHookController.php index be0952e..5658540 100644 --- a/src/Core/Api/WebHooks/Controller/WebHookController.php +++ b/src/Core/Api/WebHooks/Controller/WebHookController.php @@ -638,25 +638,46 @@ class WebHookController extends AbstractController { private function unholdDelivery(string $orderId, Context $context): void { try { - /** - * @var OrderDeliveryStateHandler $orderDeliveryStateHandler - */ - $order = $this->getOrderEntity($orderId, $context); - /** - * @var OrderDeliveryEntity $orderDelivery - */ + $criteria = new Criteria([$orderId]); + $criteria->addAssociation('deliveries.stateMachineState'); + $order = $this->container->get('order.repository') + ->search($criteria, $context) + ->first(); + + if (!$order) { + $this->logger->info('Order not found: ' . $orderId); + return; + } + + /** @var OrderDeliveryEntity|null $orderDelivery */ $orderDelivery = $order->getDeliveries()?->last(); - + if (null === $orderDelivery) { + $this->logger->info('No deliveries found for order: ' . $orderId); return; } - if ($orderDelivery->getStateMachineState()?->getTechnicalName() !== OrderDeliveryStateHandler::STATE_HOLD){ + + $orderDeliveryState = $orderDelivery->getStateMachineState(); + if (!$orderDeliveryState) { + $this->logger->info('Order delivery state is null for order: ' . $orderId); return; } + + $technicalName = $orderDeliveryState->getTechnicalName(); + $this->logger->info('Order delivery state: ' . $technicalName); + + if ($technicalName !== OrderDeliveryStateHandler::STATE_HOLD) { + $this->logger->info('Order delivery is not on hold, skipping unhold process.'); + return; + } + + /** @var OrderDeliveryStateHandler $orderDeliveryStateHandler */ $orderDeliveryStateHandler = $this->container->get(OrderDeliveryStateHandler::class); $orderDeliveryStateHandler->unhold($orderDelivery->getId(), $context); + + $this->logger->info('Successfully unheld order delivery for order: ' . $orderId); } catch (\Exception $exception) { - $this->logger->info($exception->getMessage(), $exception->getTrace()); + $this->logger->error('Error unholding order delivery: ' . $exception->getMessage(), $exception->getTrace()); } } @@ -689,7 +710,7 @@ class WebHookController extends AbstractController { * @var OrderDeliveryEntity $orderDelivery */ $orderDelivery = $order->getDeliveries()?->last(); - + if (null === $orderDelivery) { return; } diff --git a/src/Core/Api/WebHooks/Strategy/WebHookRefundStrategy.php b/src/Core/Api/WebHooks/Strategy/WebHookRefundStrategy.php index 0eeeb01..1359aea 100644 --- a/src/Core/Api/WebHooks/Strategy/WebHookRefundStrategy.php +++ b/src/Core/Api/WebHooks/Strategy/WebHookRefundStrategy.php @@ -125,41 +125,21 @@ class WebHookRefundStrategy extends WebHookStrategyBase implements WebhookStrate $orderId = $this->getOrderIdByTransaction($refund); if(!empty($orderId)) { - $this->executeLocked($orderId, $context, function () use ($orderId, $refund, $context, $request) { + if ($request->getListenerEntityTechnicalName() == WebHookRequest::REFUND && $request->getState() == RefundState::SUCCESSFUL) { + $this->refundService->upsert($refund, $context); + $orderTransactionId = $refund->getTransaction()->getMetaData()[TransactionPayload::VRPAYMENT_METADATA_ORDER_TRANSACTION_ID]; + $orderTransaction = $this->getOrderTransaction($orderId, $context); - $this->refundService->upsert($refund, $context); - - $orderTransactionId = $refund->getTransaction()->getMetaData()[TransactionPayload::VRPAYMENT_METADATA_ORDER_TRANSACTION_ID]; - $orderTransaction = $this->getOrderTransaction($orderId, $context); - if ( - in_array( - $orderTransaction->getStateMachineState()?->getTechnicalName(), - [ - OrderTransactionStates::STATE_PAID, - OrderTransactionStates::STATE_PARTIALLY_PAID, - ] - ) && - ($request->getState() == RefundState::SUCCESSFUL) - ) { - if ($refund->getAmount() == $orderTransaction->getAmount()->getTotalPrice()) { - $this->orderTransactionStateHandler->refund($orderTransactionId, $context); - } else { - if ($refund->getAmount() < $orderTransaction->getAmount()->getTotalPrice()) { - $this->orderTransactionStateHandler->refundPartially($orderTransactionId, $context); - } - } - } elseif ($orderTransaction->getStateMachineState()?->getTechnicalName() === - OrderTransactionStates::STATE_PARTIALLY_REFUNDED && - ($request->getState() == RefundState::SUCCESSFUL) - ) { $transactionByOrderTransactionId = $this->transactionService->getByOrderTransactionId($orderTransactionId, $context); $totalRefundedAmount = $this->getTotalRefundedAmount($transactionByOrderTransactionId->getTransactionId(), $context); - if (floatval($orderTransaction->getAmount()->getTotalPrice()) - $totalRefundedAmount <= 0) { + $leftToRefund = floatval($orderTransaction->getAmount()->getTotalPrice()) - $totalRefundedAmount; + if ($leftToRefund > 0) { + $this->orderTransactionStateHandler->refundPartially($orderTransactionId, $context); + } elseif ($leftToRefund === floatval(0)) { // This trick is used, because it's float type and 0 is int $this->orderTransactionStateHandler->refund($orderTransactionId, $context); } } - }); } diff --git a/src/Core/Api/WebHooks/Strategy/WebHookStrategyBase.php b/src/Core/Api/WebHooks/Strategy/WebHookStrategyBase.php index ff96b1b..e77e898 100644 --- a/src/Core/Api/WebHooks/Strategy/WebHookStrategyBase.php +++ b/src/Core/Api/WebHooks/Strategy/WebHookStrategyBase.php @@ -306,6 +306,14 @@ abstract class WebHookStrategyBase implements WebHookStrategyInterface { return $this->getOrderEntity($orderId, $context)->getTransactions()->last(); } + /** + * Unholds the delivery of an order. + * + * This method changes the state of an order's last delivery from 'held' to 'released', allowing further processing like shipping. + * + * @param string $orderId The unique identifier of the order. + * @param Context $context The context of the current operation, including scope and permissions. + */ /** * Unholds the delivery of an order. * @@ -317,22 +325,46 @@ abstract class WebHookStrategyBase implements WebHookStrategyInterface { protected function unholdDelivery(string $orderId, Context $context): void { try { - $order = $this->getOrderEntity($orderId, $context); - /** @var OrderDeliveryEntity $orderDelivery */ - $orderDelivery = $order->getDeliveries()?->last(); - - if (null === $orderDelivery) { + $criteria = new Criteria([$orderId]); + $criteria->addAssociation('deliveries.stateMachineState'); + $order = $this->container->get('order.repository') + ->search($criteria, $context) + ->first(); + + if (!$order) { + $this->logger->info('Order not found: ' . $orderId); return; } - if ($orderDelivery->getStateMachineState()?->getTechnicalName() !== OrderDeliveryStateHandler::STATE_HOLD){ + /** @var OrderDeliveryEntity|null $orderDelivery */ + $orderDelivery = $order->getDeliveries()?->last(); + + if (null === $orderDelivery) { + $this->logger->info('No deliveries found for order: ' . $orderId); return; } + + $orderDeliveryState = $orderDelivery->getStateMachineState(); + if (!$orderDeliveryState) { + $this->logger->info('Order delivery state is null for order: ' . $orderId); + return; + } + + $technicalName = $orderDeliveryState->getTechnicalName(); + $this->logger->info('Order delivery state: ' . $technicalName); + + if ($technicalName !== OrderDeliveryStateHandler::STATE_HOLD) { + $this->logger->info('Order delivery is not on hold, skipping unhold process.'); + return; + } + /** @var OrderDeliveryStateHandler $orderDeliveryStateHandler */ $orderDeliveryStateHandler = $this->container->get(OrderDeliveryStateHandler::class); $orderDeliveryStateHandler->unhold($orderDelivery->getId(), $context); + + $this->logger->info('Successfully unheld order delivery for order: ' . $orderId); } catch (\Exception $exception) { - $this->logger->info($exception->getMessage(), $exception->getTrace()); + $this->logger->error('Error unholding order delivery: ' . $exception->getMessage(), $exception->getTrace()); } } @@ -362,7 +394,7 @@ abstract class WebHookStrategyBase implements WebHookStrategyInterface { $orderDeliveryStateHandler = $this->container->get(OrderDeliveryStateHandler::class); /** @var OrderDeliveryEntity $orderDelivery */ $orderDelivery = $order->getDeliveries()?->last(); - + if (null === $orderDelivery) { return; } diff --git a/src/Core/Util/Payload/TransactionPayload.php b/src/Core/Util/Payload/TransactionPayload.php index 8a697d5..a9b21bb 100644 --- a/src/Core/Util/Payload/TransactionPayload.php +++ b/src/Core/Util/Payload/TransactionPayload.php @@ -209,7 +209,7 @@ class TransactionPayload extends AbstractPayload return $transactionPayload; } - + /** * Get transaction line items * @@ -220,30 +220,30 @@ class TransactionPayload extends AbstractPayload { $lineItems = []; $items = $this->transaction->getOrder()->getLineItems(); - + foreach ($items as $shopLineItem) { if ($this->shouldSkipLineItem($shopLineItem)) { continue; } - + if ($this->isCustomProductOption($shopLineItem)) { $shopLineItem = $this->updateCustomProductOptionLabel($shopLineItem); } - + $lineItem = $this->createLineItem($shopLineItem); $this->validateLineItem($lineItem); - + $lineItems[] = $lineItem; } - + $this->processDiscounts($items, $lineItems); $this->sortLineItemsByName($lineItems); - + $this->addOptionalLineItems($lineItems); - + return $lineItems; } - + /** * Determine if a line item should be skipped. */ @@ -272,7 +272,7 @@ class TransactionPayload extends AbstractPayload $shopLineItem->setLabel($customProductOptionParentLabel . ': ' . $shopLineItem->getLabel()); return $shopLineItem; } - + /** * Validate the created line item. */ @@ -283,7 +283,7 @@ class TransactionPayload extends AbstractPayload throw new InvalidPayloadException('LineItem payload invalid: ' . json_encode($lineItem->listInvalidProperties())); } } - + /** * Process discounts from the order items and add them to the line items array. */ @@ -293,12 +293,14 @@ class TransactionPayload extends AbstractPayload $discounts = array_filter($itemsArray, function ($orderItem) { return $orderItem->getType() === 'promotion'; }); - + if ($discounts) { - $this->addDiscountLineItem(current($discounts), $lineItems); + foreach ($discounts as $discount) { + $this->addDiscountLineItem($discount, $lineItems); + } } } - + /** * Add discount line item. */ @@ -306,23 +308,24 @@ class TransactionPayload extends AbstractPayload { $calculatedPrice = $discount->getPrice(); $calculatedTaxesCollection = $calculatedPrice->getCalculatedTaxes(); - + foreach ($calculatedTaxesCollection as $calculatedTax) { $rate = $calculatedTax->getTaxRate(); $lineItem = new LineItemCreate(); $amount = $this->calculateDiscountAmount($calculatedTax); - + + $discountName = $discount->getLabel(); $lineItem->setAmountIncludingTax($amount) ->setName(sprintf('DISCOUNT: %s (%s%% tax)', $discount->getLabel(), $rate)) ->setQuantity(1) ->setShippingRequired(false) - ->setSku('sku-discount-' . $rate, 200) + ->setSku('sku-discount-' . $rate . '-' . $discountName, 200) ->setType(LineItemType::DISCOUNT) - ->setUniqueId('coupon-sku-discount-' . $rate . '-' . $rate); - + ->setUniqueId('coupon-sku-discount-' . $rate . '-' . $rate . '-' . $discountName); + $taxRate = new TaxCreate(['title' => 'Discount Tax: ' . $rate, 'rate' => $rate]); $lineItem->setTaxes([$taxRate]); - + $lineItems[] = $lineItem; } } @@ -348,7 +351,7 @@ class TransactionPayload extends AbstractPayload return strcmp($lineItem1->getName(), $lineItem2->getName()); }); } - + /** * Add optional shipping and adjustment line items. */ @@ -363,7 +366,7 @@ class TransactionPayload extends AbstractPayload $lineItems = array_merge($lineItems, $multipleShippingLineItems); } } - + if ($adjustmentLineItem = $this->getAdjustmentLineItem($lineItems)) { $lineItems[] = $adjustmentLineItem; } @@ -554,7 +557,7 @@ class TransactionPayload extends AbstractPayload } return null; } - + /** * @return array */ @@ -564,9 +567,9 @@ class TransactionPayload extends AbstractPayload if ($this->transaction->getOrder()->getShippingTotal() > 0) { $lineItems = []; $shippingName = $this->salesChannelContext->getShippingMethod()->getName() ?? $this->translator->trans('vrpayment.payload.shipping.name'); - + $isFirst = true; - + foreach ($this->transaction->getOrder()->getShippingCosts()->getCalculatedTaxes() as $taxItem) { $amount = self::round($taxItem->getPrice()); if ($this->transaction->getOrder()->getTaxStatus() === 'net') { @@ -576,7 +579,7 @@ class TransactionPayload extends AbstractPayload $tax = (new TaxCreate()) ->setRate($taxRate) ->setTitle('Tax rate: '.$taxRate); - + $name = $taxRate . '%-' . $shippingName; $lineItem = (new LineItemCreate()) ->setAmountIncludingTax($amount) @@ -586,18 +589,18 @@ class TransactionPayload extends AbstractPayload ->setSku($this->fixLength($name . '-Shipping', 200)) ->setType($isFirst ? LineItemType::SHIPPING : LineItemType::FEE) // First item as SHIPPING, rest as FEE ->setUniqueId($this->fixLength($name . '-Shipping', 200)); - + if (!$lineItem->valid()) { $this->logger->critical('Shipping LineItem payload invalid:', $lineItem->listInvalidProperties()); throw new InvalidPayloadException('Shipping LineItem payload invalid:' . json_encode($lineItem->listInvalidProperties())); } - + $lineItems[] = $lineItem; $isFirst = false; } return $lineItems; } - + } catch (\Exception $exception) { $this->logger->critical(__CLASS__ . ' : ' . __FUNCTION__ . ' : ' . $exception->getMessage()); } diff --git a/src/Resources/app/storefront/dist/storefront/js/v-r-payment-payment/v-r-payment-payment.js b/src/Resources/app/storefront/dist/storefront/js/v-r-payment-payment/v-r-payment-payment.js new file mode 100644 index 0000000..cde177f --- /dev/null +++ b/src/Resources/app/storefront/dist/storefront/js/v-r-payment-payment/v-r-payment-payment.js @@ -0,0 +1 @@ +(()=>{"use strict";var e={857:e=>{var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function i(e,t,r){return e.concat(t).map(function(e){return n(e,r)})}function s(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function o(e,t){try{return t in e}catch(e){return!1}}function a(e,r,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=n;var u,c,d=Array.isArray(r);return d!==Array.isArray(e)?n(r,l):d?l.arrayMerge(e,r,l):(c={},(u=l).isMergeableObject(e)&&s(e).forEach(function(t){c[t]=n(e[t],u)}),s(r).forEach(function(t){(!o(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(o(e,t)&&u.isMergeableObject(r[t])?c[t]=(function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a})(t,u)(e[t],r[t],u):c[t]=n(r[t],u))}),c)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return a(e,r,t)},{})},e.exports=a}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e=r(857),t=r.n(e);class n{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let r=n.toUpperCamelCase(e,t);return n.lcFirst(r)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>n.ucFirst(e.toLowerCase())).join(""):n.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class i{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!i.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(t)}static getAttribute(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!1===i.hasAttribute(e,t))throw Error('The required property "'.concat(t,'" does not exist!'));if("function"!=typeof e.getAttribute){if(r)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=t.replace(/^data(|-)/,""),o=n.toLowerCamelCase(s,"-");if(!i.isNode(e)){if(r)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(r)throw Error("This node doesn't support the dataset attribute!");return}let a=e.dataset[o];if(void 0===a){if(r)throw Error('The required data attribute "'.concat(t,'" does not exist on ').concat(e,"!"));return a}return n.parsePrimitive(a)}static querySelector(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!i.isNode(e))throw Error("The parent node is not a valid HTML Node!");let n=e.querySelector(t)||!1;if(r&&!1===n)throw Error('The required element "'.concat(t,'" does not exist in parent node!'));return n}static querySelectorAll(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!i.isNode(e))throw Error("The parent node is not a valid HTML Node!");let n=e.querySelectorAll(t);if(0===n.length&&(n=!1),r&&!1===n)throw Error('At least one item of "'.concat(t,'" must exist in parent node!'));return n}static getFocusableElements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return e.querySelectorAll('\n input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),\n select:not([tabindex^="-"]):not([disabled]),\n textarea:not([tabindex^="-"]):not([disabled]),\n button:not([tabindex^="-"]):not([disabled]),\n a[href]:not([tabindex^="-"]):not([disabled]),\n [tabindex]:not([tabindex^="-"]):not([disabled])\n ')}static getFirstFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(e)[0]}static getLastFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=this.getFocusableElements(e);return t[t.length-1]}}class s{publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new CustomEvent(e,{detail:t,cancelable:r});return this.el.dispatchEvent(n),n}subscribe(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this,i=e.split("."),s=r.scope?t.bind(r.scope):t;if(r.once&&!0===r.once){let t=s;s=function(r){n.unsubscribe(e),t(r)}}return this.el.addEventListener(i[0],s),this.listeners.push({splitEventName:i,opts:r,cb:s}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,r)=>([...r.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):e.push(r),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}}class o{init(){throw Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let r=n.toDashCase(this._pluginName),s=i.getDataAttribute(this.el,"data-".concat(r,"-config"),!1),o=i.getAttribute(this.el,"data-".concat(r,"-options"),!1),a=[this.constructor.options,this.options,e];s&&a.push(window.PluginConfigManager.get(this._pluginName,s));try{o&&a.push(JSON.parse(o))}catch(e){throw console.error(this.el),Error('The data attribute "data-'.concat(r,'-options" could not be parsed to json: ').concat(e.message))}return t().all(a.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}constructor(e,t={},r=!1){if(!i.isNode(e))throw Error("There is no valid element given.");this.el=e,this.$emitter=new s(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}}class a{get(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",n=this._createPreparedRequest("GET",e,r);return this._sendRequest(n,null,t)}post(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(t,n);let i=this._createPreparedRequest("POST",e,n);return this._sendRequest(i,t,r)}delete(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(t,n);let i=this._createPreparedRequest("DELETE",e,n);return this._sendRequest(i,t,r)}patch(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(t,n);let i=this._createPreparedRequest("PATCH",e,n);return this._sendRequest(i,t,r)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn("the request to ".concat(e.responseURL," was aborted"))}),e.addEventListener("error",()=>{console.warn("the request to ".concat(e.responseURL," failed with status ").concat(e.status))}),e.addEventListener("timeout",()=>{console.warn("the request to ".concat(e.responseURL," timed out"))})):e.addEventListener("loadend",()=>{t(e.responseText,e)}))}_sendRequest(e,t,r){return this._registerOnLoaded(e,r),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,r){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),r&&this._request.setRequestHeader("Content-type",r),this._request}constructor(){this._request=null,this._errorHandlingInternal=!1}}class l extends o{init(){this._client=new a(window.accessKey)}}l.options={payment_method_tabs:"ul.vrpayment-payment-panel li",payment_method_iframe_prefix:"iframe_payment_method_",payment_method_iframe_class:".vrpayment-payment-iframe",payment_method_handler_name:"vrpayment_payment_handler",payment_method_handler_prefix:"vrpayment_handler_",payment_method_handler_status:'input[name="vrpayment_payment_handler_validation_status"]',payment_form:"confirmOrderForm"};let u=l;window.PluginManager.register("VRPaymentCheckoutPlugin",u,"[data-vrpayment-checkout-plugin]")})()})(); \ No newline at end of file diff --git a/src/Resources/public/administration/js/v-r-payment-payment.js b/src/Resources/public/administration/js/v-r-payment-payment.js index f2eedb1..b937c5b 100644 --- a/src/Resources/public/administration/js/v-r-payment-payment.js +++ b/src/Resources/public/administration/js/v-r-payment-payment.js @@ -1 +1 @@ -(function(){var e={915:function(){},694:function(){},174:function(){Shopware.Service("privileges").addPrivilegeMappingEntry({category:"permissions",parent:"vrpayment",key:"vrpayment",roles:{viewer:{privileges:["sales_channel:read","sales_channel_payment_method:read","system_config:read"],dependencies:[]},editor:{privileges:["sales_channel:update","sales_channel_payment_method:create","sales_channel_payment_method:update","system_config:update","system_config:create","system_config:delete"],dependencies:["vrpayment.viewer"]}}}),Shopware.Service("privileges").addPrivilegeMappingEntry({category:"permissions",parent:null,key:"sales_channel",roles:{viewer:{privileges:["sales_channel_payment_method:read"]},editor:{privileges:["payment_method:update"]},creator:{privileges:["payment_method:create","shipping_method:create","delivery_time:create"]},deleter:{privileges:["payment_method:delete"]}}})},208:function(e,t,n){var a=n(915);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),n(346).Z("78cc8960",a,!0,{})},894:function(e,t,n){var a=n(694);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),n(346).Z("01449d44",a,!0,{})},346:function(e,t,n){"use strict";function a(e,t){for(var n=[],a={},i=0;in.parts.length&&(a.parts.length=n.parts.length)}else{for(var s=[],i=0;i\n {{ $tc(\'vrpayment-order.header\') }}\n\n{% endblock %}\n\n{% block sw_order_detail_actions_slot_smart_bar_actions %}\n\n{% endblock %}\n',data(){return{isVRPaymentPayment:!1}},computed:{isEditable(){return!this.isVRPaymentPayment||"vrpayment.order.detail"!==this.$route.name},showTabs(){return!0}},watch:{orderId:{deep:!0,handler(){if(!this.orderId){this.setIsVRPaymentPayment(null);return}let e=this.repositoryFactory.create("order"),n=new a(1,1);n.addAssociation("transactions"),e.get(this.orderId,t.api,n).then(e=>{if(e.amountTotal<=0||e.transactions.length<=0||!e.transactions[0].paymentMethodId){this.setIsVRPaymentPayment(null);return}let t=e.transactions[0].paymentMethodId;null!=t&&this.setIsVRPaymentPayment(t)})},immediate:!0}},methods:{setIsVRPaymentPayment(e){e&&this.repositoryFactory.create("payment_method").get(e,t.api).then(e=>{this.isVRPaymentPayment="handler_vrpaymentpayment_vrpaymentpaymenthandler"===e.formattedHandlerIdentifier})}}});let{Component:i,Mixin:r,Filter:s,Utils:o}=Shopware;i.register("vrpayment-order-action-completion",{template:'{% block vrpayment_order_action_completion %}\n\n\n {% block vrpayment_order_action_completion_amount %}\n \n \n {% endblock %}\n\n {% block vrpayment_order_action_completion_confirm_button %}\n \n {% endblock %}\n\n \n\n{% endblock %}\n',inject:["VRPaymentTransactionCompletionService"],mixins:[r.getByName("notification")],props:{transactionData:{type:Object,required:!0}},data(){return{isLoading:!0,isCompletion:!1}},computed:{dateFilter(){return s.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1},completion(){this.isCompletion&&(this.isLoading=!0,this.VRPaymentTransactionCompletionService.createTransactionCompletion(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.captureAction.successTitle"),message:this.$tc("vrpayment-order.captureAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${o.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${o.createId()}`)})}}))}}});let{Component:l,Mixin:c,Filter:d,Utils:m}=Shopware;l.register("vrpayment-order-action-refund",{template:'{% block vrpayment_order_action_refund %}\n\n\n {% block vrpayment_order_action_refund_amount %}\n\n \n \n\n
    \n {{ $tc(\'vrpayment-order.refundAction.maxAvailableItemsToRefund\') }}:\n {{ this.$parent.$parent.itemRefundableQuantity }}\n
    \n {% endblock %}\n\n {% block vrpayment_order_action_refund_confirm_button %}\n \n {% endblock %}\n\n \n
    \n{% endblock %}\n',inject:["VRPaymentRefundService"],mixins:[c.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data(){return{refundQuantity:0,isLoading:!0,currentLineItem:""}},computed:{dateFilter(){return d.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1,this.refundQuantity=1},refund(){this.isLoading=!0,this.VRPaymentRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundQuantity,this.$parent.$parent.currentLineItem).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.refundAction.successTitle"),message:this.$tc("vrpayment-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${m.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${m.createId()}`)})}})}}});let{Component:u,Mixin:p,Filter:h,Utils:g}=Shopware;u.register("vrpayment-order-action-refund-partial",{template:'{% block vrpayment_order_action_refund_partial %}\n\n\n {% block vrpayment_order_action_refund_amount_partial %}\n \n \n\n
    \n {{ $tc(\'vrpayment-order.refundAction.maxAvailableAmountToRefund\') }}:\n {{ this.$parent.$parent.itemRefundableAmount }}\n
    \n {% endblock %}\n\n {% block vrpayment_order_action_refund_confirm_button_partial %}\n \n {% endblock %}\n\n \n
    \n{% endblock %}\n',inject:["VRPaymentRefundService"],mixins:[p.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data(){return{isLoading:!0,currency:this.transactionData.transactions[0].currency,refundAmount:0}},computed:{dateFilter(){return h.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1,this.currency=this.transactionData.transactions[0].currency,this.refundAmount=this.$parent.$parent.itemRefundableAmount},createPartialRefund(e){this.isLoading=!0,this.VRPaymentRefundService.createPartialRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundAmount,e).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.refundAction.successTitle"),message:this.$tc("vrpayment-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${g.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${g.createId()}`)})}})}},watch:{refundAmount(e){null!==e&&(this.refundAmount=Math.round(100*e)/100)}}});let{Component:y,Mixin:f,Filter:v,Utils:b}=Shopware;y.register("vrpayment-order-action-refund-by-amount",{template:'{% block vrpayment_order_action_refund_by_amount %}\n\n\n {% block vrpayment_order_action_refund_amount_by_amount %}\n \n \n {% endblock %}\n\n {% block vrpayment_order_action_refund_confirm_button_by_amount %}\n \n {% endblock %}\n\n \n\n{% endblock %}\n',inject:["VRPaymentRefundService"],mixins:[f.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data(){return{isLoading:!0,currency:this.transactionData.transactions[0].currency,refundAmount:0,refundableAmount:0}},computed:{dateFilter(){return v.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1,this.currency=this.transactionData.transactions[0].currency,this.refundAmount=Number(this.transactionData.transactions[0].amountIncludingTax),this.refundableAmount=Number(this.transactionData.transactions[0].amountIncludingTax)},refundByAmount(){this.isLoading=!0,this.VRPaymentRefundService.createRefundByAmount(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.refundAction.successTitle"),message:this.$tc("vrpayment-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${b.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${b.createId()}`)})}})}}});let{Component:_,Mixin:I,Filter:C,Utils:w}=Shopware;_.register("vrpayment-order-action-void",{template:'{% block vrpayment_order_action_void %}\n\n\n {% block vrpayment_order_action_void_amount %}\n \n \n {% endblock %}\n\n {% block vrpayment_order_action_void_confirm_button %}\n \n {% endblock %}\n\n \n\n{% endblock %}\n',inject:["VRPaymentTransactionVoidService"],mixins:[I.getByName("notification")],props:{transactionData:{type:Object,required:!0}},data(){return{isLoading:!0,isVoid:!1}},computed:{dateFilter(){return C.getByName("date")},lineItemColumns(){return[{property:"uniqueId",label:this.$tc("vrpayment-order.refund.types.uniqueId"),rawData:!1,allowResize:!0,primary:!0,width:"auto"},{property:"name",label:this.$tc("vrpayment-order.refund.types.name"),rawData:!0,allowResize:!0,sortable:!0,width:"auto"},{property:"quantity",label:this.$tc("vrpayment-order.refund.types.quantity"),rawData:!0,allowResize:!0,width:"auto"},{property:"amountIncludingTax",label:this.$tc("vrpayment-order.refund.types.amountIncludingTax"),rawData:!0,allowResize:!0,inlineEdit:"string",width:"auto"},{property:"type",label:this.$tc("vrpayment-order.refund.types.type"),rawData:!0,allowResize:!0,sortable:!0,width:"auto"},{property:"taxAmount",label:this.$tc("vrpayment-order.refund.types.taxAmount"),rawData:!0,allowResize:!0,width:"auto"}]}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1,this.currency=this.transactionData.transactions[0].currency,this.refundableAmount=this.transactionData.transactions[0].amountIncludingTax,this.refundAmount=this.transactionData.transactions[0].amountIncludingTax},voidPayment(){this.isVoid&&(this.isLoading=!0,this.VRPaymentTransactionVoidService.createTransactionVoid(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.voidAction.successTitle"),message:this.$tc("vrpayment-order.voidAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${w.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${w.createId()}`)})}}))}}}),n(894);let{Component:E,Mixin:S,Filter:T,Context:P,Utils:A}=Shopware,N=Shopware.Data.Criteria;E.register("vrpayment-order-detail",{template:'{% block vrpayment_order_detail %}\n
    \n
    \n \n \n \n {% block vrpayment_order_transaction_history_card %}\n \n \n\n \n {% endblock %}\n {% block vrpayment_order_transaction_line_items_card %}\n \n \n \n {% endblock %}\n {% block vrpayment_order_transaction_refunds_card %}\n \n \n\n \n {% endblock %}\n {% block vrpayment_order_actions_modal_refund_partial %}\n \n \n {% endblock %}\n {% block vrpayment_order_actions_modal_refund %}\n \n \n {% endblock %}\n {% block vrpayment_order_actions_modal_refund_by_amount %}\n \n \n {% endblock %}\n {% block vrpayment_order_actions_modal_completion%}\n \n \n {% endblock %}\n {% block vrpayment_order_actions_modal_void %}\n \n \n {% endblock %}\n
    \n \n
    \n{% endblock %}\n',inject:["VRPaymentTransactionService","VRPaymentRefundService","repositoryFactory"],mixins:[S.getByName("notification")],data(){return{transactionData:{transactions:[],refunds:[]},transaction:{},lineItems:[],refundableQuantity:0,itemRefundableQuantity:0,isLoading:!0,orderId:"",currency:"",modalType:"",refundAmount:0,refundableAmount:0,itemRefundedAmount:0,itemRefundedQuantity:0,itemRefundableAmount:0,currentLineItem:"",refundLineItemQuantity:[],refundLineItemAmount:[],selectedItems:[]}},metaInfo(){return{title:this.$tc("vrpayment-order.header")}},computed:{dateFilter(){return T.getByName("date")},relatedResourceColumns(){return[{property:"paymentMethodName",label:this.$tc("vrpayment-order.transactionHistory.types.payment_method"),rawData:!0},{property:"state",label:this.$tc("vrpayment-order.transactionHistory.types.state"),rawData:!0},{property:"currency",label:this.$tc("vrpayment-order.transactionHistory.types.currency"),rawData:!0},{property:"authorized_amount",label:this.$tc("vrpayment-order.transactionHistory.types.authorized_amount"),rawData:!0},{property:"id",label:this.$tc("vrpayment-order.transactionHistory.types.transaction"),rawData:!0},{property:"customerId",label:this.$tc("vrpayment-order.transactionHistory.types.customer"),rawData:!0}]},lineItemColumns(){return[{property:"id",rawData:!0,visible:!1,primary:!0},{property:"uniqueId",label:this.$tc("vrpayment-order.lineItem.types.uniqueId"),rawData:!0,visible:!1,primary:!0},{property:"name",label:this.$tc("vrpayment-order.lineItem.types.name"),rawData:!0},{property:"quantity",label:this.$tc("vrpayment-order.lineItem.types.quantity"),rawData:!0},{property:"amountIncludingTax",label:this.$tc("vrpayment-order.lineItem.types.amountIncludingTax"),rawData:!0},{property:"type",label:this.$tc("vrpayment-order.lineItem.types.type"),rawData:!0},{property:"taxAmount",label:this.$tc("vrpayment-order.lineItem.types.taxAmount"),rawData:!0},{property:"refundableQuantity",rawData:!0,visible:!1}]},refundColumns(){return[{property:"id",label:this.$tc("vrpayment-order.refund.types.id"),rawData:!0,visible:!0,primary:!0},{property:"amount",label:this.$tc("vrpayment-order.refund.types.amount"),rawData:!0},{property:"state",label:this.$tc("vrpayment-order.refund.types.state"),rawData:!0},{property:"createdOn",label:this.$tc("vrpayment-order.refund.types.createdOn"),rawData:!0}]}},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},created(){this.createdComponent()},methods:{createdComponent(){this.orderId=this.$route.params.id;let e=this.repositoryFactory.create("order"),t=new N(1,1);t.addAssociation("transactions"),t.getAssociation("transactions").addSorting(N.sort("createdAt","DESC")),e.get(this.orderId,P.api,t).then(e=>{this.order=e,this.isLoading=!1;var t=0,n=0;let a=e.transactions[0].customFields.vrpayment_transaction_id;this.VRPaymentTransactionService.getTransactionData(e.salesChannelId,a).then(e=>{this.currency=e.transactions[0].currency,e.transactions[0].authorized_amount=A.format.currency(e.transactions[0].authorizationAmount,this.currency),e.refunds.forEach(e=>{n=parseFloat(parseFloat(n)+parseFloat(e.amount)),e.amount=A.format.currency(e.amount,this.currency),e.reductions.forEach(e=>{e.quantityReduction>0&&(void 0===this.refundLineItemQuantity[e.lineItemUniqueId]?this.refundLineItemQuantity[e.lineItemUniqueId]=e.quantityReduction:this.refundLineItemQuantity[e.lineItemUniqueId]+=e.quantityReduction),e.unitPriceReduction>0&&(void 0===this.refundLineItemAmount[e.lineItemUniqueId]?this.refundLineItemAmount[e.lineItemUniqueId]=e.unitPriceReduction:this.refundLineItemAmount[e.lineItemUniqueId]+=e.unitPriceReduction)})}),e.transactions[0].lineItems.forEach(e=>{e.id||(e.id=e.uniqueId),e.itemRefundedAmount=parseFloat(this.refundLineItemAmount[e.uniqueId]||0)*parseInt(e.quantity),e.amountIncludingTax=parseFloat(e.amountIncludingTax)||0,e.itemRefundedQuantity=parseInt(this.refundLineItemQuantity[e.uniqueId])||0,e.refundableAmount=parseFloat((e.amountIncludingTax-e.itemRefundedAmount).toFixed(2)),e.amountIncludingTax=A.format.currency(e.amountIncludingTax,this.currency),e.taxAmount=A.format.currency(e.taxAmount,this.currency),t=parseFloat(parseFloat(t)+parseFloat(e.unitPriceIncludingTax*e.quantity)),e.refundableQuantity=parseInt(parseInt(e.quantity)-parseInt(this.refundLineItemQuantity[e.uniqueId]||0))}),this.lineItems=e.transactions[0].lineItems,this.transactionData=e,this.transaction=this.transactionData.transactions[0],this.refundAmount=Number(this.transactionData.transactions[0].amountIncludingTax),this.refundableAmount=parseFloat(parseFloat(t)-parseFloat(n))}).catch(e=>{try{this.createNotificationError({title:this.$tc("vrpayment-order.paymentDetails.error.title"),message:e.message,autoClose:!1})}catch(t){this.createNotificationError({title:this.$tc("vrpayment-order.paymentDetails.error.title"),message:e.message,autoClose:!1})}finally{this.isLoading=!1}})})},downloadPackingSlip(){window.open(this.VRPaymentTransactionService.getPackingSlip(this.transaction.metaData.salesChannelId,this.transaction.id),"_blank")},downloadInvoice(){window.open(this.VRPaymentTransactionService.getInvoiceDocument(this.transaction.metaData.salesChannelId,this.transaction.id),"_blank")},resetDataAttributes(){this.transactionData={transactions:[],refunds:[]},this.lineItems=[],this.refundLineItemQuantity=[],this.refundLineItemAmount=[],this.isLoading=!0},spawnModal(e,t,n,a){this.modalType=e,this.currentLineItem=t,this.itemRefundableQuantity=n,this.itemRefundableAmount=isNaN(a)?0:Math.round(100*a)/100},closeModal(){this.modalType=""},lineItemRefund(e){this.isLoading=!0,this.VRPaymentRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,0,e).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.refundAction.successTitle"),message:this.$tc("vrpayment-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${A.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.response.data,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${A.createId()}`)})}})},isSelectable(e){return e.refundableQuantity>0&&e.refundableAmount>0&&0==e.itemRefundedAmount&&0==e.itemRefundedQuantity},onSelectionChanged(e){this.selectedItems=Object.values(e)},onPerformBulkAction(){this.selectedItems.length&&(this.isLoading=!0,this.$nextTick(()=>{Promise.all(this.selectedItems.map(e=>this.lineItemRefundBulk(e.uniqueId))).then(()=>{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${A.createId()}`)})}).catch(e=>{this.createNotificationError({title:"Error",message:"Something went wrong with the refunds",autoClose:!1}),this.isLoading=!1})}))},lineItemRefundBulk(e){return new Promise((t,n)=>{this.VRPaymentRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,0,e).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.refundAction.successTitle"),message:this.$tc("vrpayment-order.refundAction.successMessage")}),t()}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.response.data,autoClose:!1})}finally{n()}})})}}});var D=JSON.parse('{"vrpayment-order":{"buttons":{"label":{"completion":"Abschluss","download-invoice":"Rechnung herunterladen","download-packing-slip":"Packzettel herunterladen","refund":"Eine neue R\xfcckerstattung erstellen","void":"Genehmigung annullieren","refund-whole-line-item":"Gesamte Werbebuchung erstatten","refund-line-item-by-quantity":"R\xfcckerstattung nach Menge","refund-line-item-selected":"R\xfcckerstattung ausw\xe4hlen","refund-line-item-parial":"Teilweise R\xfcckerstattung"}},"captureAction":{"button":{"text":"Zahlung erfassen"},"currentAmount":"Betrag","isFinal":"Dies ist die endg\xfcltige Verbuchung","maxAmount":"Maximaler Betrag","successMessage":"Ihre Verbuchung war erfolgreich","successTitle":"Erfolg"},"general":{"title":"Bestellungen"},"header":"VRPayment Payment","lineItem":{"cardTitle":"Einzelposten","types":{"amountIncludingTax":"Betrag","name":"Name","quantity":"Anzahl","taxAmount":"Steuern","type":"Typ","uniqueId":"Eindeutige ID"}},"modal":{"title":{"capture":"Erfassen","refund":"Neue Gutschrift","void":"Autorisierung aufheben"}},"paymentDetails":{"cardTitle":"Zahlung","error":{"title":"Fehler beim Abrufen von Zahlungsdetails von VRPayment"}},"refund":{"cardTitle":"Gutschriften","refundAmount":{"label":"Gutschriftsbetrag"},"refundQuantity":{"label":"Refund Menge"},"types":{"amount":"Betrag","createdOn":"Erstellt am","id":"ID","state":"Staat"}},"refundAction":{"confirmButton":{"text":"Ausf\xfchren"},"refundAmount":{"label":"Betrag","placeholder":"Einen Betrag eingeben"},"successMessage":"Ihre R\xfcckerstattung war erfolgreich","successTitle":"Erfolg","maxAvailableItemsToRefund":"Maximal Verf\xfcgbare Artikel zum Erstatten","maxAvailableAmountToRefund":"Maximal verf\xfcgbarer Erstattungsbetrag"},"transactionHistory":{"cardTitle":"Einzelheiten","types":{"authorized_amount":"Autorisierter Betrag","currency":"W\xe4hrung","customer":"Kunde","payment_method":"Zahlungsweise","state":"Staat","transaction":"Transaktion"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Kreditkarteninhaber","paymentMethod":"Zahlungsart","paymentMethodBrand":"Marke der Zahlungsmethode","PseudoCreditCardNumber":"Pseudo-Kreditkartennummer","CardExpire":"Karte verf\xe4llt"},"voidAction":{"confirm":{"button":{"cancel":"Nein","confirm":"Autorisierung aufheben"},"message":"Wollen Sie diese Zahlung wirklich stornieren?"},"successMessage":"Die Zahlung wurde erfolgreich annulliert","successTitle":"Erfolg"}}}'),k=JSON.parse('{"vrpayment-order":{"buttons":{"label":{"completion":"Complete","download-invoice":"Download Invoice","download-packing-slip":"Download Packing Slip","refund":"Create a new refund","void":"Cancel authorization","refund-whole-line-item":"Refund whole line item","refund-line-item-by-quantity":"Refund by quantity","refund-line-item-selected":"Refund selected","refund-line-item-parial":"Partial refund"}},"captureAction":{"button":{"text":"Capture payment"},"currentAmount":"Amount","isFinal":"This is final capture","maxAmount":"Maximum amount","successMessage":"Your capture was successful.","successTitle":"Success"},"general":{"title":"Orders"},"header":"VRPayment Payment","lineItem":{"cardTitle":"Line Items","types":{"amountIncludingTax":"Amount","name":"Name","quantity":"Quantity","taxAmount":"Taxes","type":"Type","uniqueId":"Unique ID"}},"modal":{"title":{"capture":"Capture","refund":"New refund","void":"Cancel authorization"}},"paymentDetails":{"cardTitle":"Payment","error":{"title":"Error fetching payment details from VRPayment"}},"refund":{"cardTitle":"Refunds","refundAmount":{"label":"Refund Amount"},"refundQuantity":{"label":"Refund Quantity"},"types":{"amount":"Amount","createdOn":"Created On","id":"ID","state":"State"}},"refundAction":{"confirmButton":{"text":"Execute"},"refundAmount":{"label":"Amount","placeholder":"Enter a amount"},"successMessage":"Your refund was successful.","successTitle":"Success","maxAvailableItemsToRefund":"Maximum available items to refund","maxAvailableAmountToRefund":"Maximum available amount to refund"},"transactionHistory":{"cardTitle":"Details","types":{"authorized_amount":"Authorized Amount","currency":"Currency","customer":"Customer","payment_method":"Payment Method","state":"State","transaction":"Transaction"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Credit Card Holder","paymentMethod":"Payment Method","paymentMethodBrand":"Payment Method Brand","PseudoCreditCardNumber":"Pseudo Credit Card Number","CardExpire":"Card Expire"},"voidAction":{"confirm":{"button":{"cancel":"No","confirm":"Cancel authorization"},"message":"Do you really want to cancel this payment?"},"successMessage":"The payment was successfully voided.","successTitle":"Success"}}}'),R=JSON.parse('{"vrpayment-order":{"buttons":{"label":{"completion":"Termin\xe9e","download-invoice":"T\xe9l\xe9charger la facture","download-packing-slip":"T\xe9l\xe9charger le bordereau d\'exp\xe9dition","refund":"Cr\xe9er un nouveau remboursement","void":"Annulez l\'autorisation","refund-whole-line-item":"Remboursement de la ligne enti\xe8re","refund-line-item-by-quantity":"Remboursement par quantit\xe9","refund-line-item-selected":"Rembourser s\xe9lectionn\xe9s","refund-line-item-parial":"Remboursement partiel"}},"captureAction":{"button":{"text":"Capture du paiement"},"currentAmount":"Montant","isFinal":"C\'est la capture finale","maxAmount":"Montant maximal","successMessage":"Votre capture a \xe9t\xe9 r\xe9ussie.","successTitle":"Succ\xe8s"},"general":{"title":"Commandes"},"header":"VRPayment Paiement","lineItem":{"cardTitle":"Articles de ligne","types":{"amountIncludingTax":"Montant","name":"Nom","quantity":"Quantit\xe9","taxAmount":"Taxes","type":"Type","uniqueId":"ID unique"}},"modal":{"title":{"capture":"Capture","refund":"Nouveau remboursement","void":"Annulez l\'autorisation"}},"paymentDetails":{"cardTitle":"Paiement","error":{"title":"Erreur dans la r\xe9cup\xe9ration des d\xe9tails du paiement \xe0 partir de VRPayment"}},"refund":{"cardTitle":"Remboursements","refundAmount":{"label":"Montant du remboursement"},"refundQuantity":{"label":"Quantit\xe9 \xe0 rembourser"},"types":{"amount":"Montant","createdOn":"Cr\xe9\xe9 le","id":"ID","state":"\xc9tat"}},"refundAction":{"confirmButton":{"text":"Ex\xe9cutez"},"refundAmount":{"label":"Montant","placeholder":"Entrez un montant"},"successMessage":"Votre remboursement a \xe9t\xe9 effectu\xe9 avec succ\xe8s.","successTitle":"Succ\xe8s","maxAvailableItemsToRefund":"Nombre maximum d\'articles disponibles pour le remboursement","maxAvailableAmountToRefund":"Montant maximal disponible pour le remboursement"},"transactionHistory":{"cardTitle":"D\xe9tails","types":{"authorized_amount":"Montant autoris\xe9","currency":"Monnaie","customer":"Client","payment_method":"Mode de paiement","state":"\xc9tat","transaction":"Transaction"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Titulaire de la carte de cr\xe9dit","paymentMethod":"Mode de paiement","paymentMethodBrand":"Marque du mode de paiement","PseudoCreditCardNumber":"Pseudo num\xe9ro de carte de cr\xe9dit","CardExpire":"La carte expire"},"voidAction":{"confirm":{"button":{"cancel":"Non","confirm":"Annulez l\'autorisation"},"message":"Voulez-vous vraiment annuler ce paiement?"},"successMessage":"Le paiement a \xe9t\xe9 annul\xe9 avec succ\xe8s.","successTitle":"Succ\xe8s"}}}'),O=JSON.parse('{"vrpayment-order":{"buttons":{"label":{"completion":"Completato","download-invoice":"Scarica fattura","download-packing-slip":"Scarica distinta di imballaggio","refund":"Crea un nuovo rimborso","void":"Annulla autorizzazione","refund-whole-line-item":"Rimborso intera riga","refund-line-item-by-quantity":"Rimborso per quantit\xe0","refund-line-item-selected":"Rimborso selezionati","refund-line-item-parial":"Rimborso parziale"}},"captureAction":{"button":{"text":"Cattura pagamento"},"currentAmount":"Importo","isFinal":"Questa \xe8 la cattura finale","maxAmount":"Importo massimo","successMessage":"La tua cattura ha avuto successo.","successTitle":"Successo"},"general":{"title":"Ordini"},"header":"Pagamento VRPayment","lineItem":{"cardTitle":"Articoli di linea","types":{"amountIncludingTax":"Importo","name":"Nome","quantity":"Quantit\xe0","taxAmount":"Tasse","type":"Tipo","uniqueId":"ID unico"}},"modal":{"title":{"capture":"Cattura","refund":"Nuovo rimborso","void":"Annulla autorizzazione"}},"paymentDetails":{"cardTitle":"Pagamento","error":{"title":"Errore nel recupero dei dettagli del pagamento da VRPayment"}},"refund":{"cardTitle":"Rimborsi","refundAmount":{"label":"Importo del rimborso"},"refundQuantity":{"label":"Quantit\xe0 di rimborso"},"types":{"amount":"Importo","createdOn":"Creato il","id":"ID","state":"Stato"}},"refundAction":{"confirmButton":{"text":"Esegui"},"refundAmount":{"label":"Importo","placeholder":"Inserisci un importo"},"successMessage":"Il tuo rimborso \xe8 andato a buon fine.","successTitle":"Successo","maxAvailableItemsToRefund":"Numero massimo di articoli disponibili da rimborsare","maxAvailableAmountToRefund":"Importo massimo disponibile per il rimborso"},"transactionHistory":{"cardTitle":"Dettagli","types":{"authorized_amount":"Importo autorizzato","currency":"Valuta","customer":"Cliente","payment_method":"Metodo di pagamento","state":"Stato","transaction":"Transazione"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Proprietario della carta di credito","paymentMethod":"Metodo di pagamento","paymentMethodBrand":"Metodo di pagamento Marca","PseudoCreditCardNumber":"Numero di carta di credito pseudo","CardExpire":"La carta scade"},"voidAction":{"confirm":{"button":{"cancel":"No","confirm":"Annulla autorizzazione"},"message":"Vuoi davvero annullare questo pagamento?"},"successMessage":"Il pagamento \xe8 stato annullato con successo.","successTitle":"Successo"}}}');let{Module:x}=Shopware;x.register("vrpayment-order",{type:"plugin",name:"VRPayment",title:"vrpayment-order.general.title",description:"vrpayment-order.general.descriptionTextModule",version:"1.0.1",targetVersion:"1.0.1",color:"#2b52ff",snippets:{"de-DE":D,"en-GB":k,"fr-FR":R,"it-IT":O},routeMiddleware(e,t){"sw.order.detail"===t.name&&t.children.push({component:"vrpayment-order-detail",name:"vrpayment.order.detail",isChildren:!0,path:"/sw/order/vrpayment/detail/:id"}),e(t)}}),n(174);let F="VRPaymentPayment.config";var $={CONFIG_DOMAIN:F,CONFIG_APPLICATION_KEY:F+".applicationKey",CONFIG_EMAIL_ENABLED:F+".emailEnabled",CONFIG_INTEGRATION:F+".integration",CONFIG_LINE_ITEM_CONSISTENCY_ENABLED:F+".lineItemConsistencyEnabled",CONFIG_SPACE_ID:F+".spaceId",CONFIG_SPACE_VIEW_ID:F+".spaceViewId",CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED:F+".storefrontInvoiceDownloadEnabled",CONFIG_USER_ID:F+".userId",CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED:F+".storefrontWebhooksUpdateEnabled",CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED:F+".storefrontPaymentsUpdateEnabled"};let{Component:V,Mixin:L}=Shopware;V.register("vrpayment-settings",{template:'{% block vrpayment_settings %}\n\n\n {% block vrpayment_settings_header %}\n \n {% endblock %}\n\n {% block vrpayment_settings_actions %}\n \n {% endblock %}\n\n {% block vrpayment_settings_content %}\n \n {% endblock %}\n\n{% endblock %}',inject:["acl","VRPaymentConfigurationService"],mixins:[L.getByName("notification"),L.getByName("sw-inline-snippet")],data(){return{config:{},isLoading:!1,isTesting:!1,isSaveSuccessful:!1,applicationKeyFilled:!1,applicationKeyErrorState:!1,spaceIdFilled:!1,spaceIdErrorState:!1,userIdFilled:!1,userIdErrorState:!1,isSetDefaultPaymentSuccessful:!1,isSettingDefaultPaymentMethods:!1,configIntegrationDefaultValue:"payment_page",configEmailEnabledDefaultValue:!0,configLineItemConsistencyEnabledDefaultValue:!0,configStorefrontInvoiceDownloadEnabledEnabledDefaultValue:!0,configStorefrontWebhooksUpdateEnabledDefaultValue:!0,configStorefrontPaymentsUpdateEnabledDefaultValue:!0,...$}},props:{isLoading:{type:Boolean,required:!0}},metaInfo(){return{title:this.$createTitle()}},created(){this.$on("check-api-connection-event",this.onCheckApiConnection)},beforeDestroy(){this.$off("check-api-connection-event",this.onCheckApiConnection)},watch:{config:{handler(e){let t=this.$refs.configComponent.allConfigs.null;null===this.$refs.configComponent.selectedSalesChannelId?(this.applicationKeyFilled=!!this.config[this.CONFIG_APPLICATION_KEY],this.spaceIdFilled=!!this.config[this.CONFIG_SPACE_ID],this.userIdFilled=!!this.config[this.CONFIG_USER_ID],this.CONFIG_INTEGRATION in this.config||(this.config[this.CONFIG_INTEGRATION]=this.configIntegrationDefaultValue),this.CONFIG_EMAIL_ENABLED in this.config||(this.config[this.CONFIG_EMAIL_ENABLED]=this.configEmailEnabledDefaultValue),this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED in this.config||(this.config[this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED]=this.configLineItemConsistencyEnabledDefaultValue),this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED in this.config||(this.config[this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED]=this.configStorefrontInvoiceDownloadEnabledEnabledDefaultValue),this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED in this.config||(this.config[this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED]=this.configStorefrontWebhooksUpdateEnabledDefaultValue),this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in this.config||(this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED]=this.configStorefrontPaymentsUpdateEnabledDefaultValue)):(this.applicationKeyFilled=!!this.config[this.CONFIG_APPLICATION_KEY]||!!t[this.CONFIG_APPLICATION_KEY],this.spaceIdFilled=!!this.config[this.CONFIG_SPACE_ID]||!!t[this.CONFIG_SPACE_ID],this.userIdFilled=!!this.config[this.CONFIG_USER_ID]||!!t[this.CONFIG_USER_ID],this.CONFIG_INTEGRATION in this.config&&this.CONFIG_INTEGRATION in t||(this.config[this.CONFIG_INTEGRATION]=this.configIntegrationDefaultValue),this.CONFIG_EMAIL_ENABLED in this.config&&this.CONFIG_EMAIL_ENABLED in t||(this.config[this.CONFIG_EMAIL_ENABLED]=this.configEmailEnabledDefaultValue),this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED in this.config&&this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED in t||(this.config[this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED]=this.configLineItemConsistencyEnabledDefaultValue),this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED in this.config&&this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED in t||(this.config[this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED]=this.configStorefrontInvoiceDownloadEnabledEnabledDefaultValue),this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED in this.config&&this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED in t||(this.config[this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED]=this.configStorefrontWebhooksUpdateEnabledDefaultValue),this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in this.config&&this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in t||(this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED]=this.configStorefrontPaymentsUpdateEnabledDefaultValue)),this.$emit("salesChannelChanged"),this.$emit("update:value",e)},deep:!0}},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e},getInheritValue(e){return null==this.selectedSalesChannelId?this.actualConfigData[e]:this.allConfigs.null[e]},onSave(){if(!(this.spaceIdFilled&&this.userIdFilled&&this.applicationKeyFilled)){this.setErrorStates();return}this.save()},save(){this.isLoading=!0,this.$refs.configComponent.save().then(e=>{e&&(this.config=e),this.registerWebHooks(),this.synchronizePaymentMethodConfiguration(),this.installOrderDeliveryStates()}).catch(e=>{console.error("Error:",e),this.isLoading=!1})},registerWebHooks(){if(!1===this.config[this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED])return!1;this.VRPaymentConfigurationService.registerWebHooks(this.$refs.configComponent.selectedSalesChannelId).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-settings.settingForm.titleSuccess"),message:this.$tc("vrpayment-settings.settingForm.messageWebHookUpdated")})}).catch(e=>{this.createNotificationError({title:this.$tc("vrpayment-settings.settingForm.titleError"),message:this.$tc("vrpayment-settings.settingForm.messageWebHookError")}),this.isLoading=!1,console.error("Error:",e)})},synchronizePaymentMethodConfiguration(){if(!1===this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED])return!1;this.VRPaymentConfigurationService.synchronizePaymentMethodConfiguration(this.$refs.configComponent.selectedSalesChannelId).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-settings.settingForm.titleSuccess"),message:this.$tc("vrpayment-settings.settingForm.messagePaymentMethodConfigurationUpdated")}),this.isLoading=!1}).catch(e=>{this.createNotificationError({title:this.$tc("vrpayment-settings.settingForm.titleError"),message:this.$tc("vrpayment-settings.settingForm.messagePaymentMethodConfigurationError")}),this.isLoading=!1,console.error("Error:",e)})},installOrderDeliveryStates(){this.VRPaymentConfigurationService.installOrderDeliveryStates().then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-settings.settingForm.titleSuccess"),message:this.$tc("vrpayment-settings.settingForm.messageOrderDeliveryStateUpdated")}),this.isLoading=!1}).catch(()=>{this.createNotificationError({title:this.$tc("vrpayment-settings.settingForm.titleError"),message:this.$tc("vrpayment-settings.settingForm.messageOrderDeliveryStateError")}),this.isLoading=!1})},onSetPaymentMethodDefault(){this.isSettingDefaultPaymentMethods=!0,this.VRPaymentConfigurationService.setVRPaymentAsSalesChannelPaymentDefault(this.$refs.configComponent.selectedSalesChannelId).then(()=>{this.isSettingDefaultPaymentMethods=!1,this.isSetDefaultPaymentSuccessful=!0,this.createNotificationSuccess({title:this.$tc("vrpayment-settings.settingForm.titleSuccess"),message:this.$tc("vrpayment-settings.salesChannelCard.messageDefaultPaymentUpdated")})})},setErrorStates(){let e={code:1,detail:this.$tc("vrpayment-settings.messageNotBlank")};this.spaceIdFilled||(this.spaceIdErrorState=e),this.userIdFilled||(this.userIdErrorState=e),this.applicationKeyFilled||(this.applicationKeyErrorState=e)},onCheckApiConnection(e){let{spaceId:t,userId:n,applicationKey:a}=e;this.isTesting=!0,this.VRPaymentConfigurationService.checkApiConnection(t,n,a).then(e=>{200===e.result?this.createNotificationSuccess({title:this.$tc("vrpayment-settings.settingForm.credentials.alert.title"),message:this.$tc("vrpayment-settings.settingForm.credentials.alert.successMessage")}):this.createNotificationError({title:this.$tc("vrpayment-settings.settingForm.credentials.alert.title"),message:this.$tc("vrpayment-settings.settingForm.credentials.alert.errorMessage")}),this.isTesting=!1}).catch(()=>{this.createNotificationError({title:this.$tc("vrpayment-settings.settingForm.credentials.alert.title"),message:this.$tc("vrpayment-settings.settingForm.credentials.alert.errorMessage")}),this.isTesting=!1})}}});let{Component:M,Mixin:B}=Shopware;M.register("sw-vrpayment-credentials",{template:'{% block vrpayment_settings_content_card_channel_config_credentials %}\n \n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container %}\n \n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings %}\n
    \n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_space_id %}\n \n \n \n {% endblock %}\n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_user_id %}\n \n \n \n {% endblock %}\n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_application_key %}\n \n \n \n {% endblock %}\n
    \n {% endblock %}\n\n \n \n {{ $tc(\'vrpayment-settings.settingForm.credentials.button.label\') }}\n \n \n\n
    \n {% endblock %}\n \n\n{% endblock %}\n',name:"VRPaymentCredentials",inject:["acl"],mixins:[B.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},spaceIdFilled:{type:Boolean,required:!0},spaceIdErrorState:{required:!0},userIdFilled:{type:Boolean,required:!0},userIdErrorState:{required:!0},applicationKeyFilled:{type:Boolean,required:!0},applicationKeyErrorState:{required:!0},isLoading:{type:Boolean,required:!0},isTesting:{type:Boolean,required:!1}},data(){return{...$}},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e},emitCheckApiConnectionEvent(){let e={spaceId:this.actualConfigData[$.CONFIG_SPACE_ID],userId:this.actualConfigData[$.CONFIG_USER_ID],applicationKey:this.actualConfigData[$.CONFIG_APPLICATION_KEY]};this.$emit("check-api-connection-event",e)}}});let{Component:z,Mixin:G}=Shopware;z.register("sw-vrpayment-options",{template:'{% block vrpayment_settings_content_card_channel_config_options %}\n \n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container %}\n \n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings %}\n
    \n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_space_view_id %}\n \n \n \n {% endblock %}\n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_integration %}\n \n \n \n {% endblock %}\n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_line_item_consistency_enabled %}\n \n \n \n {% endblock %}\n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_email_enabled %}\n \n \n \n {% endblock %}\n
    \n {% endblock %}\n
    \n {% endblock %}\n
    \n\n{% endblock %}\n',name:"VRPaymentOptions",mixins:[G.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},isLoading:{type:Boolean,required:!0}},data(){return{...$}},computed:{integrationOptions(){return[{id:"payment_page",name:this.$tc("vrpayment-settings.settingForm.options.integration.options.payment_page")},{id:"iframe",name:this.$tc("vrpayment-settings.settingForm.options.integration.options.iframe")}]}},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e}}});let{Component:q}=Shopware;q.register("sw-vrpayment-settings-icon",{template:'{% block vrpayment_settings_icon %}\n \n \n\n\n \n\n\n\n\n \n{% endblock %}\n'});let{Component:U,Mixin:H}=Shopware;U.register("sw-vrpayment-storefront-options",{template:'\n \n
    \n \n \n \n
    \n
    \n
    \n\n',name:"VRPaymentStorefrontOptions",mixins:[H.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},isLoading:{type:Boolean,required:!0}},data(){return{...$}},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e}}});let{Component:W,Mixin:K}=Shopware;W.register("sw-vrpayment-advanced-options",{template:'\n \n
    \n \n \n \n\n \n \n \n
    \n
    \n
    \n\n',name:"VRPaymentAdvancedOptions",inject:["acl"],mixins:[K.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},isLoading:{type:Boolean,required:!0}},data(){return{...$}},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e}}});var Q=JSON.parse('{"sw-privileges":{"permissions":{"parents":{"vrpayment":"VRPayment plugin"},"vrpayment":{"label":"VRPayment berechtigungen"}}},"vrpayment-settings":{"general":{"descriptionTextModule":"VRPayment-Einstellungen","mainMenuItemGeneral":"VRPayment"},"header":"VRPayment","messageNotBlank":"Dieser Wert sollte nicht leer sein.","salesChannelCard":{"button":{"description":"Klicken Sie auf diese Schaltfl\xe4che, um VRPayment als Standard-Zahlungsabwickler im ausgew\xe4hlten Vertriebskanal festzulegen","label":"VRPayment als Standard-Zahlungsabwickler festlegen"},"messageDefaultPaymentError":"VRPayment als Standard-Zahlungsabwickler konnte nicht festgelegt werden..","messageDefaultPaymentUpdated":"VRPayment als Standard-Zahlungsabwickler wurde festgelegt."},"settingForm":{"credentials":{"applicationKey":{"label":"Application Key","tooltipText":"Der Anwendungsschl\xfcssel wird verwendet, um dieses Plugin mit der API VRPayment zu authentifizieren."},"cardTitle":"Anmeldedaten","spaceId":{"label":"Space ID","tooltipText":"Die Space ID wird verwendet, um dieses Plugin mit der API VRPayment zu authentifizieren."},"userId":{"label":"User ID","tooltipText":"Die Benutzer-ID wird verwendet, um dieses Plugin mit der VRPayment-API zu authentifizieren."},"button":{"description":"Klicken Sie auf diese Schaltfl\xe4che, um die VRPayment API zu testen","label":"API Verbindung testen"},"alert":{"title":"API-Test","successMessage":"Die Verbindung wurde erfolgreich getestet.","errorMessage":"Die Verbindung ist fehlgeschlagen. Versuchen Sie es erneut."}},"messageSaveSuccess":"VRPayment-Einstellungen wurden gespeichert.","messageOrderDeliveryStateError":"VRPayment OrderDeliveryState konnte nicht gespeichert werden.","messageOrderDeliveryStateUpdated":"VRPayment OrderDeliveryState wurde aktualisiert.","messagePaymentMethodConfigurationError":"VRPayment PaymentMethodConfiguration konnte nicht gespeichert werden. Bitte \xfcberpr\xfcfen Sie Ihre Anmeldedaten.","messagePaymentMethodConfigurationUpdated":"VRPayment PaymentMethodConfiguration wurde registriert.","messageWebHookError":"VRPayment WebHook konnte nicht gespeichert werden. Bitte \xfcberpr\xfcfen Sie Ihre Zugangsdaten.","messageWebHookUpdated":"VRPayment WebHook wurde aktualisiert.","options":{"cardTitle":"Optionen","emailEnabled":{"label":"Auftragsbest\xe4tigung per E-Mail senden","tooltipText":"Wenn diese Einstellung aktiviert ist, erhalten Ihre Kunden eine E-Mail von Ihrem Gesch\xe4ft, wenn die Zahlung ihrer Bestellung autorisiert ist."},"integration":{"label":"Integration","options":{"iframe":"Iframe","payment_page":"Payment Page"},"tooltipText":"Integration"},"lineItemConsistencyEnabled":{"label":"Konsistenz der Einzelposten","tooltipText":"Wenn diese Option aktiviert ist, stimmen die Summen der Einzelposten in VRPaymentPayment immer mit der Shopware-Bestellsumme \xfcberein."},"spaceViewId":{"label":"Space View ID","tooltipText":"Space View ID"}},"save":"Speichern","storefrontOptions":{"cardTitle":"Storefront-Optionen","invoiceDownloadEnabled":{"label":"Rechnung Download","tooltipText":"Wenn diese Einstellung aktiviert ist, k\xf6nnen Ihre Kunden Auftragsrechnungen von VRPayment herunterladen."}},"advancedOptions":{"cardTitle":"Erweiterte-Optionen","webhooksUpdateEnabled":{"label":"Webhooks-Update","tooltipText":"Wenn diese Einstellung aktiviert ist, wird das Webhook-Update ausgel\xf6st, wenn Sie die Einstellungen speichern"},"paymentsUpdateEnabled":{"label":"Payments-Update","tooltipText":"Wenn diese Einstellung aktiviert ist, wird die Aktualisierung der Zahlungsmethoden ausgel\xf6st, wenn Sie die Einstellungen speichern"}},"titleError":"Fehler","titleSuccess":"Erfolg"}}}'),j=JSON.parse('{"sw-privileges":{"permissions":{"parents":{"vrpayment":"VRPayment plugin"},"vrpayment":{"label":"VRPayment permissions"}}},"vrpayment-settings":{"general":{"descriptionTextModule":"VRPayment settings","mainMenuItemGeneral":"VRPayment"},"header":"VRPayment","messageNotBlank":"This value should not be blank.","salesChannelCard":{"button":{"description":"Click this button to set VRPayment as default payment handler in the selected SalesChannel","label":"Set VRPayment as default payment handler"},"messageDefaultPaymentError":"VRPayment as default payment could not be set.","messageDefaultPaymentUpdated":"VRPayment as default payment has been set."},"settingForm":{"credentials":{"applicationKey":{"label":"Application Key","tooltipText":"The Application Key is used to authenticate this plugin with the VRPayment API."},"cardTitle":"Credentials","spaceId":{"label":"Space ID","tooltipText":"The space ID is used to authenticate this plugin with the VRPayment API."},"userId":{"label":"User ID","tooltipText":"The user ID is used to authenticate this plugin with the VRPayment API."},"button":{"description":"Click this button to test the VRPayment API","label":"API connection test"},"alert":{"title":"API Test","successMessage":"The connection was successfully tested.","errorMessage":"The connection was failed. Try it again."}},"messageSaveSuccess":"VRPayment settings have been saved.","messageOrderDeliveryStateError":"VRPayment OrderDeliveryState could not be saved.","messageOrderDeliveryStateUpdated":"VRPayment OrderDeliveryState has been updated.","messagePaymentMethodConfigurationError":"VRPayment PaymentMethodConfiguration could not be saved. Please check your credentials.","messagePaymentMethodConfigurationUpdated":"VRPayment PaymentMethodConfiguration has been registered.","messageWebHookError":"VRPayment WebHook could not be saved. Please check your credentials.","messageWebHookUpdated":"VRPayment WebHook has been updated.","options":{"cardTitle":"Options","emailEnabled":{"label":"Send order confirmation email","tooltipText":"If this setting is enabled your customers will receive an email from your store when their order payment is authorised"},"integration":{"label":"Integration","options":{"iframe":"Iframe","payment_page":"Payment Page"},"tooltipText":"Integration"},"lineItemConsistencyEnabled":{"label":"Line item consistency","tooltipText":"If this option is enabled line item totals in VRPaymentPayment will always match Shopware order total"},"spaceViewId":{"label":"Space View ID","tooltipText":"Space View ID"}},"save":"Save","storefrontOptions":{"cardTitle":"Storefront Options","invoiceDownloadEnabled":{"label":"Invoice Download","tooltipText":"If this setting is enabled your customers will be able to download order invoices from VRPayment"}},"advancedOptions":{"cardTitle":"Advanced Options","webhooksUpdateEnabled":{"label":"Webhooks Update","tooltipText":"If this setting is enabled webhook update will be triggered when you save settings"},"paymentsUpdateEnabled":{"label":"Payments Update","tooltipText":"If this setting is enabled payment methods update will be triggered when you save settings"}},"titleError":"Error","titleSuccess":"Success"}}}'),Y=JSON.parse('{"sw-privileges":{"permissions":{"parents":{"vrpayment":"VRPayment brancher"},"vrpayment":{"label":"VRPayment autorisations"}}},"vrpayment-settings":{"general":{"descriptionTextModule":"Param\xe8tres de VRPayment","mainMenuItemGeneral":"VRPayment"},"header":"VRPayment","messageNotBlank":"Cette valeur ne doit pas \xeatre vide.","salesChannelCard":{"button":{"description":"Cliquez sur ce bouton pour d\xe9finir VRPayment comme gestionnaire de paiement par d\xe9faut dans le canal de vente s\xe9lectionn\xe9.","label":"D\xe9finir VRPayment comme gestionnaire de paiement par d\xe9faut"},"messageDefaultPaymentError":"VRPayment comme paiement par d\xe9faut n\'a pas pu \xeatre d\xe9fini.","messageDefaultPaymentUpdated":"VRPayment comme paiement par d\xe9faut a \xe9t\xe9 d\xe9fini."},"settingForm":{"credentials":{"applicationKey":{"label":"Application Key","tooltipText":"La cl\xe9 d\'application est utilis\xe9e pour authentifier ce plugin avec l\'API."},"cardTitle":"R\xe9f\xe9rences","spaceId":{"label":"Space ID","tooltipText":"L\'ID de l\'espace est utilis\xe9 pour authentifier ce plugin avec l\'API VRPayment.."},"userId":{"label":"User ID","tooltipText":"L\'ID utilisateur est utilis\xe9 pour authentifier ce plugin avec l\'API VRPayment."},"button":{"description":"Cliquez sur ce bouton pour tester l\'API VRPayment.","label":"Test de connexion \xe0 l\'API"},"alert":{"title":"Test API","successMessage":"La connexion a \xe9t\xe9 test\xe9e avec succ\xe8s.","errorMessage":"La connexion a \xe9chou\xe9. R\xe9essayez."}},"messageSaveSuccess":"Les param\xe8tres de VRPayment ont \xe9t\xe9 enregistr\xe9s.","messageOrderDeliveryStateError":"Les param\xe8tres de VRPayment OrderDeliveryState n\'ont pas pu \xeatre enregistr\xe9s.","messageOrderDeliveryStateUpdated":"VRPayment OrderDeliveryState a \xe9t\xe9 mis \xe0 jour.","messagePaymentMethodConfigurationError":"VRPayment PaymentMethodConfiguration n\'a pas pu \xeatre enregistr\xe9. Veuillez v\xe9rifier vos informations d\'identification.","messagePaymentMethodConfigurationUpdated":"VRPayment PaymentMethodConfiguration a \xe9t\xe9 enregistr\xe9.","messageWebHookError":"VRPayment WebHook n\'a pas pu \xeatre enregistr\xe9. Veuillez v\xe9rifier vos informations d\'identification.","messageWebHookUpdated":"VRPayment WebHook a \xe9t\xe9 mis \xe0 jour.","options":{"cardTitle":"Options","emailEnabled":{"label":"Envoyer un e-mail de confirmation de commande","tooltipText":"If this setting is enabled your customers will receive an email from your store when their order payment is authorised"},"integration":{"label":"Integration","options":{"iframe":"Iframe","payment_page":"Page de paiement"},"tooltipText":"Integration"},"lineItemConsistencyEnabled":{"label":"Coh\xe9rence des postes de ligne","tooltipText":"Si cette option est activ\xe9e, les totaux des articles dans VRPaymentPayment correspondront toujours au total de la commande Shopware."},"spaceViewId":{"label":"Space View ID","tooltipText":"Space View ID"}},"save":"Enregistrer","storefrontOptions":{"cardTitle":"Storefront Options","invoiceDownloadEnabled":{"label":"T\xe9l\xe9chargement de facture","tooltipText":"Si ce param\xe8tre est activ\xe9, vos clients pourront t\xe9l\xe9charger les factures de commande depuis VRPayment"}},"advancedOptions":{"cardTitle":"Options avanc\xe9es","webhooksUpdateEnabled":{"label":"Mise \xe0 jour des webhooks","tooltipText":"Si ce param\xe8tre est activ\xe9, la mise \xe0 jour des webhooks sera d\xe9clench\xe9e lorsque vous enregistrerez les param\xe8tres."},"paymentsUpdateEnabled":{"label":"Mise \xe0 jour des paiements","tooltipText":"Si ce param\xe8tre est activ\xe9, la mise \xe0 jour des m\xe9thodes de paiement sera d\xe9clench\xe9e lorsque vous enregistrez les param\xe8tres."}},"titleError":"Erreur","titleSuccess":"Succ\xe8s"}}}'),Z=JSON.parse('{"sw-privileges":{"permissions":{"parents":{"vrpayment":"VRPayment brancher"},"vrpayment":{"label":"VRPayment autorisations"}}},"vrpayment-settings":{"general":{"descriptionTextModule":"Impostazioni VRPayment","mainMenuItemGeneral":"VRPayment"},"header":"VRPayment","messageNotBlank":"Questo valore non dovrebbe essere vuoto.","salesChannelCard":{"button":{"description":"Fai clic su questo pulsante per impostare VRPayment come gestore di pagamento predefinito nel SalesChannel selezionato","label":"Imposta VRPayment come gestore di pagamento predefinito"},"messageDefaultPaymentError":"Non \xe8 stato possibile impostare VRPayment come pagamento predefinito.","messageDefaultPaymentUpdated":"VRPayment come pagamento predefinito \xe8 stato impostato."},"settingForm":{"credentials":{"applicationKey":{"label":"Chiave di applicazione","tooltipText":"La chiave dell\'applicazione \xe8 usata per autenticare questo plugin con l\'API VRPayment."},"cardTitle":"Credenziali","spaceId":{"label":"ID spazio","tooltipText":"L\'ID dello spazio \xe8 usato per autenticare questo plugin con l\'API VRPayment."},"userId":{"label":"ID utente","tooltipText":"L\'ID utente \xe8 usato per autenticare questo plugin con l\'API VRPayment."},"button":{"description":"Fare clic su questo pulsante per testare l\'API VRPayment.","label":"Test di connessione API"},"alert":{"title":"Test API","successMessage":"La connessione \xe8 stata testata con successo.","errorMessage":"La connessione \xe8 fallita. Riprovare."}},"messageSaveSuccess":"Le impostazioni di VRPayment sono state salvate.","messageOrderDeliveryStateError":"VRPayment OrderDeliveryState non pu\xf2 essere salvato.","messageOrderDeliveryStateUpdated":"VRPayment OrderDeliveryState \xe8 stato aggiornato.","messagePaymentMethodConfigurationError":"VRPayment PaymentMethodConfiguration non pu\xf2 essere salvato. Per favore controlla le tue credenziali.","messagePaymentMethodConfigurationUpdated":"VRPayment PaymentMethodConfiguration \xe8 stato registrato.","messageWebHookError":"VRPayment WebHook non pu\xf2 essere salvato. Per favore controlla le tue credenziali.","messageWebHookUpdated":"VRPayment WebHook \xe8 stato aggiornato.","options":{"cardTitle":"Opzioni","emailEnabled":{"label":"Invia email di conferma dell\'ordine","tooltipText":"Se questa impostazione \xe8 abilitata i tuoi clienti riceveranno un\'email dal tuo negozio quando il pagamento del loro ordine sar\xe0 autorizzato"},"integration":{"label":"Integrazione","options":{"iframe":"Iframe","payment_page":"Pagina di pagamento"},"tooltipText":"Integrazione"},"lineItemConsistencyEnabled":{"label":"Coerenza dell\'elemento linea","tooltipText":"Se questa opzione \xe8 abilitata i totali degli articoli in VRPaymentPayment corrisponderanno sempre al totale dell\'ordine Shopware"},"spaceViewId":{"label":"ID della vista spazio","tooltipText":"ID della vista spaziale"}},"save":"Salva","storefrontOptions":{"cardTitle":"Opzioni vetrina","invoiceDownloadEnabled":{"label":"Scaricamento fattura","tooltipText":"Se questa impostazione \xe8 abilitata i tuoi clienti potranno scaricare le fatture degli ordini da VRPayment"}},"advancedOptions":{"cardTitle":"Opzioni avanzate","webhooksUpdateEnabled":{"label":"Aggiornamento webhooks","tooltipText":"Se questa impostazione \xe8 abilitata l\'aggiornamento dei webhook sar\xe0 attivato quando si salvano le impostazioni"},"paymentsUpdateEnabled":{"label":"Aggiornamento pagamenti","tooltipText":"Se questa impostazione \xe8 abilitata l\'aggiornamento dei metodi di pagamento verr\xe0 attivato quando si salvano le impostazioni"}},"titleError":"Errore","titleSuccess":"Successo"}}}');let{Module:J}=Shopware;J.register("vrpayment-settings",{type:"plugin",name:"VRPayment",title:"vrpayment-settings.general.descriptionTextModule",description:"vrpayment-settings.general.descriptionTextModule",color:"#28d8ff",icon:"default-action-settings",version:"1.0.1",targetVersion:"1.0.1",snippets:{"de-DE":Q,"en-GB":j,"fr-FR":Y,"it-IT":Z},routes:{index:{component:"vrpayment-settings",path:"index",meta:{parentPath:"sw.settings.index",privilege:"vrpayment.viewer"},props:{default:e=>({hash:e.params.hash})}}},settingsItem:{group:"plugins",to:"vrpayment.settings.index",iconComponent:"sw-vrpayment-settings-icon",backgroundEnabled:!0,privilege:"vrpayment.viewer"}});let X=Shopware.Classes.ApiService;var ee=class extends X{constructor(e,t,n="vrpayment"){super(e,t,n)}registerWebHooks(e=null){let t=this.getBasicHeaders(),n=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/register-web-hooks`;return this.httpClient.post(n,{salesChannelId:e},{headers:t}).then(e=>X.handleResponse(e))}checkApiConnection(e=null,t=null,n=null){let a=this.getBasicHeaders(),i=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/check-api-connection`;return this.httpClient.post(i,{spaceId:e,userId:t,applicationId:n},{headers:a}).then(e=>X.handleResponse(e))}setVRPaymentAsSalesChannelPaymentDefault(e=null){let t=this.getBasicHeaders(),n=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/set-vrpayment-as-sales-channel-payment-default`;return this.httpClient.post(n,{salesChannelId:e},{headers:t}).then(e=>X.handleResponse(e))}synchronizePaymentMethodConfiguration(e=null){let t=this.getBasicHeaders(),n=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/synchronize-payment-method-configuration`;return this.httpClient.post(n,{salesChannelId:e},{headers:t}).then(e=>X.handleResponse(e))}installOrderDeliveryStates(){let e=this.getBasicHeaders(),t=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/install-order-delivery-states`;return this.httpClient.post(t,{},{headers:e}).then(e=>X.handleResponse(e))}};let et=Shopware.Classes.ApiService;var en=class extends et{constructor(e,t,n="vrpayment"){super(e,t,n)}createRefund(e,t,n,a){let i=this.getBasicHeaders(),r=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/refund/create-refund/`;return this.httpClient.post(r,{salesChannelId:e,transactionId:t,quantity:n,lineItemId:a},{headers:i}).then(e=>et.handleResponse(e))}createRefundByAmount(e,t,n){let a=this.getBasicHeaders(),i=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/refund/create-refund-by-amount/`;return this.httpClient.post(i,{salesChannelId:e,transactionId:t,refundableAmount:n},{headers:a}).then(e=>et.handleResponse(e))}createPartialRefund(e,t,n,a){let i=this.getBasicHeaders(),r=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/refund/create-partial-refund/`;return this.httpClient.post(r,{salesChannelId:e,transactionId:t,refundableAmount:n,lineItemId:a},{headers:i}).then(e=>et.handleResponse(e))}};let ea=Shopware.Classes.ApiService;var ei=class extends ea{constructor(e,t,n="vrpayment"){super(e,t,n)}getTransactionData(e,t){let n=this.getBasicHeaders(),a=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction/get-transaction-data/`;return this.httpClient.post(a,{salesChannelId:e,transactionId:t},{headers:n}).then(e=>ea.handleResponse(e))}getInvoiceDocument(e,t){return`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction/get-invoice-document/${e}/${t}`}getPackingSlip(e,t){return`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction/get-packing-slip/${e}/${t}`}};let er=Shopware.Classes.ApiService;var es=class extends er{constructor(e,t,n="vrpayment"){super(e,t,n)}createTransactionCompletion(e,t){let n=this.getBasicHeaders(),a=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction-completion/create-transaction-completion/`;return this.httpClient.post(a,{salesChannelId:e,transactionId:t},{headers:n}).then(e=>er.handleResponse(e))}};let eo=Shopware.Classes.ApiService;var el=class extends eo{constructor(e,t,n="vrpayment"){super(e,t,n)}createTransactionVoid(e,t){let n=this.getBasicHeaders(),a=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction-void/create-transaction-void/`;return this.httpClient.post(a,{salesChannelId:e,transactionId:t},{headers:n}).then(e=>eo.handleResponse(e))}};let{Application:ec}=Shopware;ec.addServiceProvider("VRPaymentConfigurationService",e=>new ee(ec.getContainer("init").httpClient,e.loginService)),ec.addServiceProvider("VRPaymentRefundService",e=>new en(ec.getContainer("init").httpClient,e.loginService)),ec.addServiceProvider("VRPaymentTransactionService",e=>new ei(ec.getContainer("init").httpClient,e.loginService)),ec.addServiceProvider("VRPaymentTransactionCompletionService",e=>new es(ec.getContainer("init").httpClient,e.loginService)),ec.addServiceProvider("VRPaymentTransactionVoidService",e=>new el(ec.getContainer("init").httpClient,e.loginService))}()})(); \ No newline at end of file +!function(){var e={245:function(){},892:function(){},588:function(){Shopware.Service("privileges").addPrivilegeMappingEntry({category:"permissions",parent:"vrpayment",key:"vrpayment",roles:{viewer:{privileges:["sales_channel:read","sales_channel_payment_method:read","system_config:read"],dependencies:[]},editor:{privileges:["sales_channel:update","sales_channel_payment_method:create","sales_channel_payment_method:update","system_config:update","system_config:create","system_config:delete"],dependencies:["vrpayment.viewer"]}}}),Shopware.Service("privileges").addPrivilegeMappingEntry({category:"permissions",parent:null,key:"sales_channel",roles:{viewer:{privileges:["sales_channel_payment_method:read"]},editor:{privileges:["payment_method:update"]},creator:{privileges:["payment_method:create","shipping_method:create","delivery_time:create"]},deleter:{privileges:["payment_method:delete"]}}})},616:function(e,t,n){var a=n(245);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),(0,n(534).A)("51145c18",a,!0,{})},69:function(e,t,n){var a=n(892);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),(0,n(534).A)("184c683a",a,!0,{})},534:function(e,t,n){"use strict";function a(e,t){for(var n=[],a={},i=0;in.parts.length&&(a.parts.length=n.parts.length)}else{for(var r=[],i=0;i\n {{ $tc(\'vrpayment-order.header\') }}\n\n{% endblock %}\n\n{% block sw_order_detail_actions_slot_smart_bar_actions %}\n\n{% endblock %}\n',data(){return{isVRPaymentPayment:!1}},computed:{isEditable(){return!this.isVRPaymentPayment||"vrpayment.order.detail"!==this.$route.name},showTabs(){return!0}},watch:{orderId:{deep:!0,handler(){if(!this.orderId){this.setIsVRPaymentPayment(null);return}let e=this.repositoryFactory.create("order"),n=new a(1,1);n.addAssociation("transactions"),e.get(this.orderId,t.api,n).then(e=>{if(e.amountTotal<=0||e.transactions.length<=0||!e.transactions[0].paymentMethodId){this.setIsVRPaymentPayment(null);return}let t=e.transactions[0].paymentMethodId;null!=t&&this.setIsVRPaymentPayment(t)})},immediate:!0}},methods:{setIsVRPaymentPayment(e){e&&this.repositoryFactory.create("payment_method").get(e,t.api).then(e=>{this.isVRPaymentPayment="handler_vrpaymentpayment_vrpaymentpaymenthandler"===e.formattedHandlerIdentifier})}}});let{Component:i,Mixin:r,Filter:s,Utils:o}=Shopware;i.register("vrpayment-order-action-completion",{template:'{% block vrpayment_order_action_completion %}\n\n\n {% block vrpayment_order_action_completion_amount %}\n \n \n {% endblock %}\n\n {% block vrpayment_order_action_completion_confirm_button %}\n \n {% endblock %}\n\n \n\n{% endblock %}\n',inject:["VRPaymentTransactionCompletionService"],mixins:[r.getByName("notification")],props:{transactionData:{type:Object,required:!0}},data(){return{isLoading:!0,isCompletion:!1}},computed:{dateFilter(){return s.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1},completion(){this.isCompletion&&(this.isLoading=!0,this.VRPaymentTransactionCompletionService.createTransactionCompletion(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.captureAction.successTitle"),message:this.$tc("vrpayment-order.captureAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${o.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${o.createId()}`)})}}))}}});let{Component:l,Mixin:c,Filter:d,Utils:m}=Shopware;l.register("vrpayment-order-action-refund",{template:'{% block vrpayment_order_action_refund %}\n\n\n {% block vrpayment_order_action_refund_amount %}\n\n \n \n\n
    \n {{ $tc(\'vrpayment-order.refundAction.maxAvailableItemsToRefund\') }}:\n {{ this.$parent.$parent.itemRefundableQuantity }}\n
    \n {% endblock %}\n\n {% block vrpayment_order_action_refund_confirm_button %}\n \n {% endblock %}\n\n \n
    \n{% endblock %}\n',inject:["VRPaymentRefundService"],mixins:[c.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data(){return{refundQuantity:0,isLoading:!0,currentLineItem:""}},computed:{dateFilter(){return d.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1,this.refundQuantity=1},refund(){this.isLoading=!0,this.VRPaymentRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundQuantity,this.$parent.$parent.currentLineItem).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.refundAction.successTitle"),message:this.$tc("vrpayment-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${m.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${m.createId()}`)})}})}}});let{Component:u,Mixin:p,Filter:h,Utils:g}=Shopware;u.register("vrpayment-order-action-refund-partial",{template:'{% block vrpayment_order_action_refund_partial %}\n\n\n {% block vrpayment_order_action_refund_amount_partial %}\n \n \n\n
    \n {{ $tc(\'vrpayment-order.refundAction.maxAvailableAmountToRefund\') }}:\n {{ this.$parent.$parent.itemRefundableAmount }}\n
    \n {% endblock %}\n\n {% block vrpayment_order_action_refund_confirm_button_partial %}\n \n {% endblock %}\n\n \n
    \n{% endblock %}\n',inject:["VRPaymentRefundService"],mixins:[p.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data(){return{isLoading:!0,currency:this.transactionData.transactions[0].currency,refundAmount:0}},computed:{dateFilter(){return h.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1,this.currency=this.transactionData.transactions[0].currency,this.refundAmount=this.$parent.$parent.itemRefundableAmount},createPartialRefund(e){this.isLoading=!0,this.VRPaymentRefundService.createPartialRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundAmount,e).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.refundAction.successTitle"),message:this.$tc("vrpayment-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${g.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${g.createId()}`)})}})}},watch:{refundAmount(e){null!==e&&(this.refundAmount=Math.round(100*e)/100)}}});let{Component:y,Mixin:f,Filter:v,Utils:b}=Shopware;y.register("vrpayment-order-action-refund-by-amount",{template:'{% block vrpayment_order_action_refund_by_amount %}\n\n\n {% block vrpayment_order_action_refund_amount_by_amount %}\n \n \n {% endblock %}\n\n {% block vrpayment_order_action_refund_confirm_button_by_amount %}\n \n {% endblock %}\n\n \n\n{% endblock %}\n',inject:["VRPaymentRefundService"],mixins:[f.getByName("notification")],props:{transactionData:{type:Object,required:!0},orderId:{type:String,required:!0}},data(){return{isLoading:!0,currency:this.transactionData.transactions[0].currency,refundAmount:0,refundableAmount:0}},computed:{dateFilter(){return v.getByName("date")}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1,this.currency=this.transactionData.transactions[0].currency,this.refundAmount=Number(this.transactionData.transactions[0].amountIncludingTax),this.refundableAmount=Number(this.transactionData.transactions[0].amountIncludingTax)},refundByAmount(){this.isLoading=!0,this.VRPaymentRefundService.createRefundByAmount(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,this.refundAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.refundAction.successTitle"),message:this.$tc("vrpayment-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${b.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${b.createId()}`)})}})}}});let{Component:_,Mixin:I,Filter:C,Utils:w}=Shopware;_.register("vrpayment-order-action-void",{template:'{% block vrpayment_order_action_void %}\n\n\n {% block vrpayment_order_action_void_amount %}\n \n \n {% endblock %}\n\n {% block vrpayment_order_action_void_confirm_button %}\n \n {% endblock %}\n\n \n\n{% endblock %}\n',inject:["VRPaymentTransactionVoidService"],mixins:[I.getByName("notification")],props:{transactionData:{type:Object,required:!0}},data(){return{isLoading:!0,isVoid:!1}},computed:{dateFilter(){return C.getByName("date")},lineItemColumns(){return[{property:"uniqueId",label:this.$tc("vrpayment-order.refund.types.uniqueId"),rawData:!1,allowResize:!0,primary:!0,width:"auto"},{property:"name",label:this.$tc("vrpayment-order.refund.types.name"),rawData:!0,allowResize:!0,sortable:!0,width:"auto"},{property:"quantity",label:this.$tc("vrpayment-order.refund.types.quantity"),rawData:!0,allowResize:!0,width:"auto"},{property:"amountIncludingTax",label:this.$tc("vrpayment-order.refund.types.amountIncludingTax"),rawData:!0,allowResize:!0,inlineEdit:"string",width:"auto"},{property:"type",label:this.$tc("vrpayment-order.refund.types.type"),rawData:!0,allowResize:!0,sortable:!0,width:"auto"},{property:"taxAmount",label:this.$tc("vrpayment-order.refund.types.taxAmount"),rawData:!0,allowResize:!0,width:"auto"}]}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1,this.currency=this.transactionData.transactions[0].currency,this.refundableAmount=this.transactionData.transactions[0].amountIncludingTax,this.refundAmount=this.transactionData.transactions[0].amountIncludingTax},voidPayment(){this.isVoid&&(this.isLoading=!0,this.VRPaymentTransactionVoidService.createTransactionVoid(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.voidAction.successTitle"),message:this.$tc("vrpayment-order.voidAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${w.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.message,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${w.createId()}`)})}}))}}}),n(69);let{Component:E,Mixin:S,Filter:T,Context:P,Utils:A}=Shopware,N=Shopware.Data.Criteria;E.register("vrpayment-order-detail",{template:'{% block vrpayment_order_detail %}\n
    \n
    \n \n \n \n {% block vrpayment_order_transaction_history_card %}\n \n \n\n \n {% endblock %}\n {% block vrpayment_order_transaction_line_items_card %}\n \n \n \n {% endblock %}\n {% block vrpayment_order_transaction_refunds_card %}\n \n \n\n \n {% endblock %}\n {% block vrpayment_order_actions_modal_refund_partial %}\n \n \n {% endblock %}\n {% block vrpayment_order_actions_modal_refund %}\n \n \n {% endblock %}\n {% block vrpayment_order_actions_modal_refund_by_amount %}\n \n \n {% endblock %}\n {% block vrpayment_order_actions_modal_completion%}\n \n \n {% endblock %}\n {% block vrpayment_order_actions_modal_void %}\n \n \n {% endblock %}\n
    \n \n
    \n{% endblock %}\n',inject:["VRPaymentTransactionService","VRPaymentRefundService","repositoryFactory"],mixins:[S.getByName("notification")],data(){return{transactionData:{transactions:[],refunds:[]},transaction:{},lineItems:[],refundableQuantity:0,itemRefundableQuantity:0,isLoading:!0,orderId:"",currency:"",modalType:"",refundAmount:0,refundableAmount:0,itemRefundedAmount:0,itemRefundedQuantity:0,itemRefundableAmount:0,currentLineItem:"",refundLineItemQuantity:[],refundLineItemAmount:[],selectedItems:[]}},metaInfo(){return{title:this.$tc("vrpayment-order.header")}},computed:{dateFilter(){return T.getByName("date")},relatedResourceColumns(){return[{property:"paymentMethodName",label:this.$tc("vrpayment-order.transactionHistory.types.payment_method"),rawData:!0},{property:"state",label:this.$tc("vrpayment-order.transactionHistory.types.state"),rawData:!0},{property:"currency",label:this.$tc("vrpayment-order.transactionHistory.types.currency"),rawData:!0},{property:"authorized_amount",label:this.$tc("vrpayment-order.transactionHistory.types.authorized_amount"),rawData:!0},{property:"id",label:this.$tc("vrpayment-order.transactionHistory.types.transaction"),rawData:!0},{property:"customerId",label:this.$tc("vrpayment-order.transactionHistory.types.customer"),rawData:!0}]},lineItemColumns(){return[{property:"id",rawData:!0,visible:!1,primary:!0},{property:"uniqueId",label:this.$tc("vrpayment-order.lineItem.types.uniqueId"),rawData:!0,visible:!1,primary:!0},{property:"name",label:this.$tc("vrpayment-order.lineItem.types.name"),rawData:!0},{property:"quantity",label:this.$tc("vrpayment-order.lineItem.types.quantity"),rawData:!0},{property:"amountIncludingTax",label:this.$tc("vrpayment-order.lineItem.types.amountIncludingTax"),rawData:!0},{property:"type",label:this.$tc("vrpayment-order.lineItem.types.type"),rawData:!0},{property:"taxAmount",label:this.$tc("vrpayment-order.lineItem.types.taxAmount"),rawData:!0},{property:"refundableQuantity",rawData:!0,visible:!1}]},refundColumns(){return[{property:"id",label:this.$tc("vrpayment-order.refund.types.id"),rawData:!0,visible:!0,primary:!0},{property:"amount",label:this.$tc("vrpayment-order.refund.types.amount"),rawData:!0},{property:"state",label:this.$tc("vrpayment-order.refund.types.state"),rawData:!0},{property:"createdOn",label:this.$tc("vrpayment-order.refund.types.createdOn"),rawData:!0}]}},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},created(){this.createdComponent()},methods:{createdComponent(){this.orderId=this.$route.params.id;let e=this.repositoryFactory.create("order"),t=new N(1,1);t.addAssociation("transactions"),t.getAssociation("transactions").addSorting(N.sort("createdAt","DESC")),e.get(this.orderId,P.api,t).then(e=>{this.order=e,this.isLoading=!1;var t=0,n=0;let a=e.transactions[0].customFields.vrpayment_transaction_id;this.VRPaymentTransactionService.getTransactionData(e.salesChannelId,a).then(e=>{this.currency=e.transactions[0].currency,e.transactions[0].authorized_amount=A.format.currency(e.transactions[0].authorizationAmount,this.currency),e.refunds.forEach(e=>{n=parseFloat(parseFloat(n)+parseFloat(e.amount)),e.amount=A.format.currency(e.amount,this.currency),e.reductions.forEach(e=>{e.quantityReduction>0&&(void 0===this.refundLineItemQuantity[e.lineItemUniqueId]?this.refundLineItemQuantity[e.lineItemUniqueId]=e.quantityReduction:this.refundLineItemQuantity[e.lineItemUniqueId]+=e.quantityReduction),e.unitPriceReduction>0&&(void 0===this.refundLineItemAmount[e.lineItemUniqueId]?this.refundLineItemAmount[e.lineItemUniqueId]=e.unitPriceReduction:this.refundLineItemAmount[e.lineItemUniqueId]+=e.unitPriceReduction)})}),e.transactions[0].lineItems.forEach(e=>{e.id||(e.id=e.uniqueId),e.itemRefundedAmount=parseFloat(this.refundLineItemAmount[e.uniqueId]||0)*parseInt(e.quantity),e.amountIncludingTax=parseFloat(e.amountIncludingTax)||0,e.itemRefundedQuantity=parseInt(this.refundLineItemQuantity[e.uniqueId])||0,e.refundableAmount=parseFloat((e.amountIncludingTax-e.itemRefundedAmount).toFixed(2)),e.amountIncludingTax=A.format.currency(e.amountIncludingTax,this.currency),e.taxAmount=A.format.currency(e.taxAmount,this.currency),t=parseFloat(parseFloat(t)+parseFloat(e.unitPriceIncludingTax*e.quantity)),e.refundableQuantity=parseInt(parseInt(e.quantity)-parseInt(this.refundLineItemQuantity[e.uniqueId]||0))}),this.lineItems=e.transactions[0].lineItems,this.transactionData=e,this.transaction=this.transactionData.transactions[0],this.refundAmount=Number(this.transactionData.transactions[0].amountIncludingTax),this.refundableAmount=parseFloat(parseFloat(t)-parseFloat(n))}).catch(e=>{try{this.createNotificationError({title:this.$tc("vrpayment-order.paymentDetails.error.title"),message:e.message,autoClose:!1})}catch(t){this.createNotificationError({title:this.$tc("vrpayment-order.paymentDetails.error.title"),message:e.message,autoClose:!1})}finally{this.isLoading=!1}})})},downloadPackingSlip(){window.open(this.VRPaymentTransactionService.getPackingSlip(this.transaction.metaData.salesChannelId,this.transaction.id),"_blank")},downloadInvoice(){window.open(this.VRPaymentTransactionService.getInvoiceDocument(this.transaction.metaData.salesChannelId,this.transaction.id),"_blank")},resetDataAttributes(){this.transactionData={transactions:[],refunds:[]},this.lineItems=[],this.refundLineItemQuantity=[],this.refundLineItemAmount=[],this.isLoading=!0},spawnModal(e,t,n,a){this.modalType=e,this.currentLineItem=t,this.itemRefundableQuantity=n,this.itemRefundableAmount=isNaN(a)?0:Math.round(100*a)/100},closeModal(){this.modalType=""},lineItemRefund(e){this.isLoading=!0,this.VRPaymentRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,0,e).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.refundAction.successTitle"),message:this.$tc("vrpayment-order.refundAction.successMessage")}),this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${A.createId()}`)})}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.response.data,autoClose:!1})}finally{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${A.createId()}`)})}})},isSelectable(e){return e.refundableQuantity>0&&e.refundableAmount>0&&0==e.itemRefundedAmount&&0==e.itemRefundedQuantity},onSelectionChanged(e){this.selectedItems=Object.values(e)},onPerformBulkAction(){this.selectedItems.length&&(this.isLoading=!0,this.$nextTick(()=>{Promise.all(this.selectedItems.map(e=>this.lineItemRefundBulk(e.uniqueId))).then(()=>{this.isLoading=!1,this.$emit("modal-close"),this.$nextTick(()=>{this.$router.replace(`${this.$route.path}?hash=${A.createId()}`)})}).catch(e=>{this.createNotificationError({title:"Error",message:"Something went wrong with the refunds",autoClose:!1}),this.isLoading=!1})}))},lineItemRefundBulk(e){return new Promise((t,n)=>{this.VRPaymentRefundService.createRefund(this.transactionData.transactions[0].metaData.salesChannelId,this.transactionData.transactions[0].id,0,e).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-order.refundAction.successTitle"),message:this.$tc("vrpayment-order.refundAction.successMessage")}),t()}).catch(e=>{try{this.createNotificationError({title:e.response.data.errors[0].title,message:e.response.data.errors[0].detail,autoClose:!1})}catch(t){this.createNotificationError({title:e.title,message:e.response.data,autoClose:!1})}finally{n()}})})}}});var D=JSON.parse('{"vrpayment-order":{"buttons":{"label":{"completion":"Abschluss","download-invoice":"Rechnung herunterladen","download-packing-slip":"Packzettel herunterladen","refund":"Eine neue R\xfcckerstattung erstellen","void":"Genehmigung annullieren","refund-whole-line-item":"Gesamte Werbebuchung erstatten","refund-line-item-by-quantity":"R\xfcckerstattung nach Menge","refund-line-item-selected":"R\xfcckerstattung ausw\xe4hlen","refund-line-item-parial":"Teilweise R\xfcckerstattung"}},"captureAction":{"button":{"text":"Zahlung erfassen"},"currentAmount":"Betrag","isFinal":"Dies ist die endg\xfcltige Verbuchung","maxAmount":"Maximaler Betrag","successMessage":"Ihre Verbuchung war erfolgreich","successTitle":"Erfolg"},"general":{"title":"Bestellungen"},"header":"VRPayment Payment","lineItem":{"cardTitle":"Einzelposten","types":{"amountIncludingTax":"Betrag","name":"Name","quantity":"Anzahl","taxAmount":"Steuern","type":"Typ","uniqueId":"Eindeutige ID"}},"modal":{"title":{"capture":"Erfassen","refund":"Neue Gutschrift","void":"Autorisierung aufheben"}},"paymentDetails":{"cardTitle":"Zahlung","error":{"title":"Fehler beim Abrufen von Zahlungsdetails von VRPayment"}},"refund":{"cardTitle":"Gutschriften","refundAmount":{"label":"Gutschriftsbetrag"},"refundQuantity":{"label":"Refund Menge"},"types":{"amount":"Betrag","createdOn":"Erstellt am","id":"ID","state":"Staat"}},"refundAction":{"confirmButton":{"text":"Ausf\xfchren"},"refundAmount":{"label":"Betrag","placeholder":"Einen Betrag eingeben"},"successMessage":"Ihre R\xfcckerstattung war erfolgreich","successTitle":"Erfolg","maxAvailableItemsToRefund":"Maximal Verf\xfcgbare Artikel zum Erstatten","maxAvailableAmountToRefund":"Maximal verf\xfcgbarer Erstattungsbetrag"},"transactionHistory":{"cardTitle":"Einzelheiten","types":{"authorized_amount":"Autorisierter Betrag","currency":"W\xe4hrung","customer":"Kunde","payment_method":"Zahlungsweise","state":"Staat","transaction":"Transaktion"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Kreditkarteninhaber","paymentMethod":"Zahlungsart","paymentMethodBrand":"Marke der Zahlungsmethode","PseudoCreditCardNumber":"Pseudo-Kreditkartennummer","CardExpire":"Karte verf\xe4llt"},"voidAction":{"confirm":{"button":{"cancel":"Nein","confirm":"Autorisierung aufheben"},"message":"Wollen Sie diese Zahlung wirklich stornieren?"},"successMessage":"Die Zahlung wurde erfolgreich annulliert","successTitle":"Erfolg"}}}'),k=JSON.parse('{"vrpayment-order":{"buttons":{"label":{"completion":"Complete","download-invoice":"Download Invoice","download-packing-slip":"Download Packing Slip","refund":"Create a new refund","void":"Cancel authorization","refund-whole-line-item":"Refund whole line item","refund-line-item-by-quantity":"Refund by quantity","refund-line-item-selected":"Refund selected","refund-line-item-parial":"Partial refund"}},"captureAction":{"button":{"text":"Capture payment"},"currentAmount":"Amount","isFinal":"This is final capture","maxAmount":"Maximum amount","successMessage":"Your capture was successful.","successTitle":"Success"},"general":{"title":"Orders"},"header":"VRPayment Payment","lineItem":{"cardTitle":"Line Items","types":{"amountIncludingTax":"Amount","name":"Name","quantity":"Quantity","taxAmount":"Taxes","type":"Type","uniqueId":"Unique ID"}},"modal":{"title":{"capture":"Capture","refund":"New refund","void":"Cancel authorization"}},"paymentDetails":{"cardTitle":"Payment","error":{"title":"Error fetching payment details from VRPayment"}},"refund":{"cardTitle":"Refunds","refundAmount":{"label":"Refund Amount"},"refundQuantity":{"label":"Refund Quantity"},"types":{"amount":"Amount","createdOn":"Created On","id":"ID","state":"State"}},"refundAction":{"confirmButton":{"text":"Execute"},"refundAmount":{"label":"Amount","placeholder":"Enter a amount"},"successMessage":"Your refund was successful.","successTitle":"Success","maxAvailableItemsToRefund":"Maximum available items to refund","maxAvailableAmountToRefund":"Maximum available amount to refund"},"transactionHistory":{"cardTitle":"Details","types":{"authorized_amount":"Authorized Amount","currency":"Currency","customer":"Customer","payment_method":"Payment Method","state":"State","transaction":"Transaction"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Credit Card Holder","paymentMethod":"Payment Method","paymentMethodBrand":"Payment Method Brand","PseudoCreditCardNumber":"Pseudo Credit Card Number","CardExpire":"Card Expire"},"voidAction":{"confirm":{"button":{"cancel":"No","confirm":"Cancel authorization"},"message":"Do you really want to cancel this payment?"},"successMessage":"The payment was successfully voided.","successTitle":"Success"}}}'),R=JSON.parse('{"vrpayment-order":{"buttons":{"label":{"completion":"Termin\xe9e","download-invoice":"T\xe9l\xe9charger la facture","download-packing-slip":"T\xe9l\xe9charger le bordereau d\'exp\xe9dition","refund":"Cr\xe9er un nouveau remboursement","void":"Annulez l\'autorisation","refund-whole-line-item":"Remboursement de la ligne enti\xe8re","refund-line-item-by-quantity":"Remboursement par quantit\xe9","refund-line-item-selected":"Rembourser s\xe9lectionn\xe9s","refund-line-item-parial":"Remboursement partiel"}},"captureAction":{"button":{"text":"Capture du paiement"},"currentAmount":"Montant","isFinal":"C\'est la capture finale","maxAmount":"Montant maximal","successMessage":"Votre capture a \xe9t\xe9 r\xe9ussie.","successTitle":"Succ\xe8s"},"general":{"title":"Commandes"},"header":"VRPayment Paiement","lineItem":{"cardTitle":"Articles de ligne","types":{"amountIncludingTax":"Montant","name":"Nom","quantity":"Quantit\xe9","taxAmount":"Taxes","type":"Type","uniqueId":"ID unique"}},"modal":{"title":{"capture":"Capture","refund":"Nouveau remboursement","void":"Annulez l\'autorisation"}},"paymentDetails":{"cardTitle":"Paiement","error":{"title":"Erreur dans la r\xe9cup\xe9ration des d\xe9tails du paiement \xe0 partir de VRPayment"}},"refund":{"cardTitle":"Remboursements","refundAmount":{"label":"Montant du remboursement"},"refundQuantity":{"label":"Quantit\xe9 \xe0 rembourser"},"types":{"amount":"Montant","createdOn":"Cr\xe9\xe9 le","id":"ID","state":"\xc9tat"}},"refundAction":{"confirmButton":{"text":"Ex\xe9cutez"},"refundAmount":{"label":"Montant","placeholder":"Entrez un montant"},"successMessage":"Votre remboursement a \xe9t\xe9 effectu\xe9 avec succ\xe8s.","successTitle":"Succ\xe8s","maxAvailableItemsToRefund":"Nombre maximum d\'articles disponibles pour le remboursement","maxAvailableAmountToRefund":"Montant maximal disponible pour le remboursement"},"transactionHistory":{"cardTitle":"D\xe9tails","types":{"authorized_amount":"Montant autoris\xe9","currency":"Monnaie","customer":"Client","payment_method":"Mode de paiement","state":"\xc9tat","transaction":"Transaction"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Titulaire de la carte de cr\xe9dit","paymentMethod":"Mode de paiement","paymentMethodBrand":"Marque du mode de paiement","PseudoCreditCardNumber":"Pseudo num\xe9ro de carte de cr\xe9dit","CardExpire":"La carte expire"},"voidAction":{"confirm":{"button":{"cancel":"Non","confirm":"Annulez l\'autorisation"},"message":"Voulez-vous vraiment annuler ce paiement?"},"successMessage":"Le paiement a \xe9t\xe9 annul\xe9 avec succ\xe8s.","successTitle":"Succ\xe8s"}}}'),O=JSON.parse('{"vrpayment-order":{"buttons":{"label":{"completion":"Completato","download-invoice":"Scarica fattura","download-packing-slip":"Scarica distinta di imballaggio","refund":"Crea un nuovo rimborso","void":"Annulla autorizzazione","refund-whole-line-item":"Rimborso intera riga","refund-line-item-by-quantity":"Rimborso per quantit\xe0","refund-line-item-selected":"Rimborso selezionati","refund-line-item-parial":"Rimborso parziale"}},"captureAction":{"button":{"text":"Cattura pagamento"},"currentAmount":"Importo","isFinal":"Questa \xe8 la cattura finale","maxAmount":"Importo massimo","successMessage":"La tua cattura ha avuto successo.","successTitle":"Successo"},"general":{"title":"Ordini"},"header":"Pagamento VRPayment","lineItem":{"cardTitle":"Articoli di linea","types":{"amountIncludingTax":"Importo","name":"Nome","quantity":"Quantit\xe0","taxAmount":"Tasse","type":"Tipo","uniqueId":"ID unico"}},"modal":{"title":{"capture":"Cattura","refund":"Nuovo rimborso","void":"Annulla autorizzazione"}},"paymentDetails":{"cardTitle":"Pagamento","error":{"title":"Errore nel recupero dei dettagli del pagamento da VRPayment"}},"refund":{"cardTitle":"Rimborsi","refundAmount":{"label":"Importo del rimborso"},"refundQuantity":{"label":"Quantit\xe0 di rimborso"},"types":{"amount":"Importo","createdOn":"Creato il","id":"ID","state":"Stato"}},"refundAction":{"confirmButton":{"text":"Esegui"},"refundAmount":{"label":"Importo","placeholder":"Inserisci un importo"},"successMessage":"Il tuo rimborso \xe8 andato a buon fine.","successTitle":"Successo","maxAvailableItemsToRefund":"Numero massimo di articoli disponibili da rimborsare","maxAvailableAmountToRefund":"Importo massimo disponibile per il rimborso"},"transactionHistory":{"cardTitle":"Dettagli","types":{"authorized_amount":"Importo autorizzato","currency":"Valuta","customer":"Cliente","payment_method":"Metodo di pagamento","state":"Stato","transaction":"Transazione"},"customerId":"Customer ID","customerName":"Customer Name","creditCardHolder":"Proprietario della carta di credito","paymentMethod":"Metodo di pagamento","paymentMethodBrand":"Metodo di pagamento Marca","PseudoCreditCardNumber":"Numero di carta di credito pseudo","CardExpire":"La carta scade"},"voidAction":{"confirm":{"button":{"cancel":"No","confirm":"Annulla autorizzazione"},"message":"Vuoi davvero annullare questo pagamento?"},"successMessage":"Il pagamento \xe8 stato annullato con successo.","successTitle":"Successo"}}}');let{Module:x}=Shopware;x.register("vrpayment-order",{type:"plugin",name:"VRPayment",title:"vrpayment-order.general.title",description:"vrpayment-order.general.descriptionTextModule",version:"1.0.1",targetVersion:"1.0.1",color:"#2b52ff",snippets:{"de-DE":D,"en-GB":k,"fr-FR":R,"it-IT":O},routeMiddleware(e,t){"sw.order.detail"===t.name&&t.children.push({component:"vrpayment-order-detail",name:"vrpayment.order.detail",isChildren:!0,path:"/sw/order/vrpayment/detail/:id"}),e(t)}}),n(588);let F="VRPaymentPayment.config";var $={CONFIG_DOMAIN:F,CONFIG_APPLICATION_KEY:F+".applicationKey",CONFIG_EMAIL_ENABLED:F+".emailEnabled",CONFIG_INTEGRATION:F+".integration",CONFIG_LINE_ITEM_CONSISTENCY_ENABLED:F+".lineItemConsistencyEnabled",CONFIG_SPACE_ID:F+".spaceId",CONFIG_SPACE_VIEW_ID:F+".spaceViewId",CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED:F+".storefrontInvoiceDownloadEnabled",CONFIG_USER_ID:F+".userId",CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED:F+".storefrontWebhooksUpdateEnabled",CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED:F+".storefrontPaymentsUpdateEnabled"};let{Component:V,Mixin:L}=Shopware;V.register("vrpayment-settings",{template:'{% block vrpayment_settings %}\n\n\n {% block vrpayment_settings_header %}\n \n {% endblock %}\n\n {% block vrpayment_settings_actions %}\n \n {% endblock %}\n\n {% block vrpayment_settings_content %}\n \n {% endblock %}\n\n{% endblock %}',inject:["acl","VRPaymentConfigurationService"],mixins:[L.getByName("notification"),L.getByName("sw-inline-snippet")],data(){return{config:{},isLoading:!1,isTesting:!1,isSaveSuccessful:!1,applicationKeyFilled:!1,applicationKeyErrorState:!1,spaceIdFilled:!1,spaceIdErrorState:!1,userIdFilled:!1,userIdErrorState:!1,isSetDefaultPaymentSuccessful:!1,isSettingDefaultPaymentMethods:!1,configIntegrationDefaultValue:"payment_page",configEmailEnabledDefaultValue:!0,configLineItemConsistencyEnabledDefaultValue:!0,configStorefrontInvoiceDownloadEnabledEnabledDefaultValue:!0,configStorefrontWebhooksUpdateEnabledDefaultValue:!0,configStorefrontPaymentsUpdateEnabledDefaultValue:!0,...$}},props:{isLoading:{type:Boolean,required:!0}},metaInfo(){return{title:this.$createTitle()}},created(){this.$on("check-api-connection-event",this.onCheckApiConnection)},beforeDestroy(){this.$off("check-api-connection-event",this.onCheckApiConnection)},watch:{config:{handler(e){let t=this.$refs.configComponent.allConfigs.null;null===this.$refs.configComponent.selectedSalesChannelId?(this.applicationKeyFilled=!!this.config[this.CONFIG_APPLICATION_KEY],this.spaceIdFilled=!!this.config[this.CONFIG_SPACE_ID],this.userIdFilled=!!this.config[this.CONFIG_USER_ID],this.CONFIG_INTEGRATION in this.config||(this.config[this.CONFIG_INTEGRATION]=this.configIntegrationDefaultValue),this.CONFIG_EMAIL_ENABLED in this.config||(this.config[this.CONFIG_EMAIL_ENABLED]=this.configEmailEnabledDefaultValue),this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED in this.config||(this.config[this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED]=this.configLineItemConsistencyEnabledDefaultValue),this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED in this.config||(this.config[this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED]=this.configStorefrontInvoiceDownloadEnabledEnabledDefaultValue),this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED in this.config||(this.config[this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED]=this.configStorefrontWebhooksUpdateEnabledDefaultValue),this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in this.config||(this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED]=this.configStorefrontPaymentsUpdateEnabledDefaultValue)):(this.applicationKeyFilled=!!this.config[this.CONFIG_APPLICATION_KEY]||!!t[this.CONFIG_APPLICATION_KEY],this.spaceIdFilled=!!this.config[this.CONFIG_SPACE_ID]||!!t[this.CONFIG_SPACE_ID],this.userIdFilled=!!this.config[this.CONFIG_USER_ID]||!!t[this.CONFIG_USER_ID],this.CONFIG_INTEGRATION in this.config&&this.CONFIG_INTEGRATION in t||(this.config[this.CONFIG_INTEGRATION]=this.configIntegrationDefaultValue),this.CONFIG_EMAIL_ENABLED in this.config&&this.CONFIG_EMAIL_ENABLED in t||(this.config[this.CONFIG_EMAIL_ENABLED]=this.configEmailEnabledDefaultValue),this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED in this.config&&this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED in t||(this.config[this.CONFIG_LINE_ITEM_CONSISTENCY_ENABLED]=this.configLineItemConsistencyEnabledDefaultValue),this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED in this.config&&this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED in t||(this.config[this.CONFIG_STOREFRONT_INVOICE_DOWNLOAD_ENABLED]=this.configStorefrontInvoiceDownloadEnabledEnabledDefaultValue),this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED in this.config&&this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED in t||(this.config[this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED]=this.configStorefrontWebhooksUpdateEnabledDefaultValue),this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in this.config&&this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED in t||(this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED]=this.configStorefrontPaymentsUpdateEnabledDefaultValue)),this.$emit("salesChannelChanged"),this.$emit("update:value",e)},deep:!0}},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e},getInheritValue(e){return null==this.selectedSalesChannelId?this.actualConfigData[e]:this.allConfigs.null[e]},onSave(){if(!(this.spaceIdFilled&&this.userIdFilled&&this.applicationKeyFilled)){this.setErrorStates();return}this.save()},save(){this.isLoading=!0,this.$refs.configComponent.save().then(e=>{e&&(this.config=e),this.registerWebHooks(),this.synchronizePaymentMethodConfiguration(),this.installOrderDeliveryStates()}).catch(e=>{console.error("Error:",e),this.isLoading=!1})},registerWebHooks(){if(!1===this.config[this.CONFIG_STOREFRONT_WEBHOOKS_UPDATE_ENABLED])return!1;this.VRPaymentConfigurationService.registerWebHooks(this.$refs.configComponent.selectedSalesChannelId).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-settings.settingForm.titleSuccess"),message:this.$tc("vrpayment-settings.settingForm.messageWebHookUpdated")})}).catch(e=>{this.createNotificationError({title:this.$tc("vrpayment-settings.settingForm.titleError"),message:this.$tc("vrpayment-settings.settingForm.messageWebHookError")}),this.isLoading=!1,console.error("Error:",e)})},synchronizePaymentMethodConfiguration(){if(!1===this.config[this.CONFIG_STOREFRONT_PAYMENTS_UPDATE_ENABLED])return!1;this.VRPaymentConfigurationService.synchronizePaymentMethodConfiguration(this.$refs.configComponent.selectedSalesChannelId).then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-settings.settingForm.titleSuccess"),message:this.$tc("vrpayment-settings.settingForm.messagePaymentMethodConfigurationUpdated")}),this.isLoading=!1}).catch(e=>{this.createNotificationError({title:this.$tc("vrpayment-settings.settingForm.titleError"),message:this.$tc("vrpayment-settings.settingForm.messagePaymentMethodConfigurationError")}),this.isLoading=!1,console.error("Error:",e)})},installOrderDeliveryStates(){this.VRPaymentConfigurationService.installOrderDeliveryStates().then(()=>{this.createNotificationSuccess({title:this.$tc("vrpayment-settings.settingForm.titleSuccess"),message:this.$tc("vrpayment-settings.settingForm.messageOrderDeliveryStateUpdated")}),this.isLoading=!1}).catch(()=>{this.createNotificationError({title:this.$tc("vrpayment-settings.settingForm.titleError"),message:this.$tc("vrpayment-settings.settingForm.messageOrderDeliveryStateError")}),this.isLoading=!1})},onSetPaymentMethodDefault(){this.isSettingDefaultPaymentMethods=!0,this.VRPaymentConfigurationService.setVRPaymentAsSalesChannelPaymentDefault(this.$refs.configComponent.selectedSalesChannelId).then(()=>{this.isSettingDefaultPaymentMethods=!1,this.isSetDefaultPaymentSuccessful=!0,this.createNotificationSuccess({title:this.$tc("vrpayment-settings.settingForm.titleSuccess"),message:this.$tc("vrpayment-settings.salesChannelCard.messageDefaultPaymentUpdated")})})},setErrorStates(){let e={code:1,detail:this.$tc("vrpayment-settings.messageNotBlank")};this.spaceIdFilled||(this.spaceIdErrorState=e),this.userIdFilled||(this.userIdErrorState=e),this.applicationKeyFilled||(this.applicationKeyErrorState=e)},onCheckApiConnection(e){let{spaceId:t,userId:n,applicationKey:a}=e;this.isTesting=!0,this.VRPaymentConfigurationService.checkApiConnection(t,n,a).then(e=>{200===e.result?this.createNotificationSuccess({title:this.$tc("vrpayment-settings.settingForm.credentials.alert.title"),message:this.$tc("vrpayment-settings.settingForm.credentials.alert.successMessage")}):this.createNotificationError({title:this.$tc("vrpayment-settings.settingForm.credentials.alert.title"),message:this.$tc("vrpayment-settings.settingForm.credentials.alert.errorMessage")}),this.isTesting=!1}).catch(()=>{this.createNotificationError({title:this.$tc("vrpayment-settings.settingForm.credentials.alert.title"),message:this.$tc("vrpayment-settings.settingForm.credentials.alert.errorMessage")}),this.isTesting=!1})}}});let{Component:M,Mixin:B}=Shopware;M.register("sw-vrpayment-credentials",{template:'{% block vrpayment_settings_content_card_channel_config_credentials %}\n \n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container %}\n \n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings %}\n
    \n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_space_id %}\n \n \n \n {% endblock %}\n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_user_id %}\n \n \n \n {% endblock %}\n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_application_key %}\n \n \n \n {% endblock %}\n
    \n {% endblock %}\n\n \n \n {{ $tc(\'vrpayment-settings.settingForm.credentials.button.label\') }}\n \n \n\n
    \n {% endblock %}\n \n\n{% endblock %}\n',name:"VRPaymentCredentials",inject:["acl"],mixins:[B.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},spaceIdFilled:{type:Boolean,required:!0},spaceIdErrorState:{required:!0},userIdFilled:{type:Boolean,required:!0},userIdErrorState:{required:!0},applicationKeyFilled:{type:Boolean,required:!0},applicationKeyErrorState:{required:!0},isLoading:{type:Boolean,required:!0},isTesting:{type:Boolean,required:!1}},data(){return{...$}},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e},emitCheckApiConnectionEvent(){let e={spaceId:this.actualConfigData[$.CONFIG_SPACE_ID],userId:this.actualConfigData[$.CONFIG_USER_ID],applicationKey:this.actualConfigData[$.CONFIG_APPLICATION_KEY]};this.$emit("check-api-connection-event",e)}}});let{Component:z,Mixin:G}=Shopware;z.register("sw-vrpayment-options",{template:'{% block vrpayment_settings_content_card_channel_config_options %}\n \n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container %}\n \n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings %}\n
    \n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_space_view_id %}\n \n \n \n {% endblock %}\n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_integration %}\n \n \n \n {% endblock %}\n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_line_item_consistency_enabled %}\n \n \n \n {% endblock %}\n\n {% block vrpayment_settings_content_card_channel_config_credentials_card_container_settings_email_enabled %}\n \n \n \n {% endblock %}\n
    \n {% endblock %}\n
    \n {% endblock %}\n
    \n\n{% endblock %}\n',name:"VRPaymentOptions",mixins:[G.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},isLoading:{type:Boolean,required:!0}},data(){return{...$}},computed:{integrationOptions(){return[{id:"payment_page",name:this.$tc("vrpayment-settings.settingForm.options.integration.options.payment_page")},{id:"iframe",name:this.$tc("vrpayment-settings.settingForm.options.integration.options.iframe")}]}},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e}}});let{Component:q}=Shopware;q.register("sw-vrpayment-settings-icon",{template:'{% block vrpayment_settings_icon %}\n \n \n\n\n \n\n\n\n\n \n{% endblock %}\n'});let{Component:U,Mixin:H}=Shopware;U.register("sw-vrpayment-storefront-options",{template:'\n \n
    \n \n \n \n
    \n
    \n
    \n\n',name:"VRPaymentStorefrontOptions",mixins:[H.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},isLoading:{type:Boolean,required:!0}},data(){return{...$}},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e}}});let{Component:W,Mixin:K}=Shopware;W.register("sw-vrpayment-advanced-options",{template:'\n \n
    \n \n \n \n\n \n \n \n
    \n
    \n
    \n\n',name:"VRPaymentAdvancedOptions",inject:["acl"],mixins:[K.getByName("notification")],props:{actualConfigData:{type:Object,required:!0},allConfigs:{type:Object,required:!0},selectedSalesChannelId:{required:!0},isLoading:{type:Boolean,required:!0}},data(){return{...$}},methods:{checkTextFieldInheritance(e){return"string"!=typeof e||e.length<=0},checkNumberFieldInheritance(e){return"number"!=typeof e||e.length<=0},checkBoolFieldInheritance(e){return"boolean"!=typeof e}}});var Q=JSON.parse('{"sw-privileges":{"permissions":{"parents":{"vrpayment":"VRPayment plugin"},"vrpayment":{"label":"VRPayment berechtigungen"}}},"vrpayment-settings":{"general":{"descriptionTextModule":"VRPayment-Einstellungen","mainMenuItemGeneral":"VRPayment"},"header":"VRPayment","messageNotBlank":"Dieser Wert sollte nicht leer sein.","salesChannelCard":{"button":{"description":"Klicken Sie auf diese Schaltfl\xe4che, um VRPayment als Standard-Zahlungsabwickler im ausgew\xe4hlten Vertriebskanal festzulegen","label":"VRPayment als Standard-Zahlungsabwickler festlegen"},"messageDefaultPaymentError":"VRPayment als Standard-Zahlungsabwickler konnte nicht festgelegt werden..","messageDefaultPaymentUpdated":"VRPayment als Standard-Zahlungsabwickler wurde festgelegt."},"settingForm":{"credentials":{"applicationKey":{"label":"Application Key","tooltipText":"Der Anwendungsschl\xfcssel wird verwendet, um dieses Plugin mit der API VRPayment zu authentifizieren."},"cardTitle":"Anmeldedaten","spaceId":{"label":"Space ID","tooltipText":"Die Space ID wird verwendet, um dieses Plugin mit der API VRPayment zu authentifizieren."},"userId":{"label":"User ID","tooltipText":"Die Benutzer-ID wird verwendet, um dieses Plugin mit der VRPayment-API zu authentifizieren."},"button":{"description":"Klicken Sie auf diese Schaltfl\xe4che, um die VRPayment API zu testen","label":"API Verbindung testen"},"alert":{"title":"API-Test","successMessage":"Die Verbindung wurde erfolgreich getestet.","errorMessage":"Die Verbindung ist fehlgeschlagen. Versuchen Sie es erneut."}},"messageSaveSuccess":"VRPayment-Einstellungen wurden gespeichert.","messageOrderDeliveryStateError":"VRPayment OrderDeliveryState konnte nicht gespeichert werden.","messageOrderDeliveryStateUpdated":"VRPayment OrderDeliveryState wurde aktualisiert.","messagePaymentMethodConfigurationError":"VRPayment PaymentMethodConfiguration konnte nicht gespeichert werden. Bitte \xfcberpr\xfcfen Sie Ihre Anmeldedaten.","messagePaymentMethodConfigurationUpdated":"VRPayment PaymentMethodConfiguration wurde registriert.","messageWebHookError":"VRPayment WebHook konnte nicht gespeichert werden. Bitte \xfcberpr\xfcfen Sie Ihre Zugangsdaten.","messageWebHookUpdated":"VRPayment WebHook wurde aktualisiert.","options":{"cardTitle":"Optionen","emailEnabled":{"label":"Auftragsbest\xe4tigung per E-Mail senden","tooltipText":"Wenn diese Einstellung aktiviert ist, erhalten Ihre Kunden eine E-Mail von Ihrem Gesch\xe4ft, wenn die Zahlung ihrer Bestellung autorisiert ist."},"integration":{"label":"Integration","options":{"iframe":"Iframe","payment_page":"Payment Page"},"tooltipText":"Integration"},"lineItemConsistencyEnabled":{"label":"Konsistenz der Einzelposten","tooltipText":"Wenn diese Option aktiviert ist, stimmen die Summen der Einzelposten in VRPaymentPayment immer mit der Shopware-Bestellsumme \xfcberein."},"spaceViewId":{"label":"Space View ID","tooltipText":"Space View ID"}},"save":"Speichern","storefrontOptions":{"cardTitle":"Storefront-Optionen","invoiceDownloadEnabled":{"label":"Rechnung Download","tooltipText":"Wenn diese Einstellung aktiviert ist, k\xf6nnen Ihre Kunden Auftragsrechnungen von VRPayment herunterladen."}},"advancedOptions":{"cardTitle":"Erweiterte-Optionen","webhooksUpdateEnabled":{"label":"Webhooks-Update","tooltipText":"Wenn diese Einstellung aktiviert ist, wird das Webhook-Update ausgel\xf6st, wenn Sie die Einstellungen speichern"},"paymentsUpdateEnabled":{"label":"Payments-Update","tooltipText":"Wenn diese Einstellung aktiviert ist, wird die Aktualisierung der Zahlungsmethoden ausgel\xf6st, wenn Sie die Einstellungen speichern"}},"titleError":"Fehler","titleSuccess":"Erfolg"}}}'),j=JSON.parse('{"sw-privileges":{"permissions":{"parents":{"vrpayment":"VRPayment plugin"},"vrpayment":{"label":"VRPayment permissions"}}},"vrpayment-settings":{"general":{"descriptionTextModule":"VRPayment settings","mainMenuItemGeneral":"VRPayment"},"header":"VRPayment","messageNotBlank":"This value should not be blank.","salesChannelCard":{"button":{"description":"Click this button to set VRPayment as default payment handler in the selected SalesChannel","label":"Set VRPayment as default payment handler"},"messageDefaultPaymentError":"VRPayment as default payment could not be set.","messageDefaultPaymentUpdated":"VRPayment as default payment has been set."},"settingForm":{"credentials":{"applicationKey":{"label":"Application Key","tooltipText":"The Application Key is used to authenticate this plugin with the VRPayment API."},"cardTitle":"Credentials","spaceId":{"label":"Space ID","tooltipText":"The space ID is used to authenticate this plugin with the VRPayment API."},"userId":{"label":"User ID","tooltipText":"The user ID is used to authenticate this plugin with the VRPayment API."},"button":{"description":"Click this button to test the VRPayment API","label":"API connection test"},"alert":{"title":"API Test","successMessage":"The connection was successfully tested.","errorMessage":"The connection was failed. Try it again."}},"messageSaveSuccess":"VRPayment settings have been saved.","messageOrderDeliveryStateError":"VRPayment OrderDeliveryState could not be saved.","messageOrderDeliveryStateUpdated":"VRPayment OrderDeliveryState has been updated.","messagePaymentMethodConfigurationError":"VRPayment PaymentMethodConfiguration could not be saved. Please check your credentials.","messagePaymentMethodConfigurationUpdated":"VRPayment PaymentMethodConfiguration has been registered.","messageWebHookError":"VRPayment WebHook could not be saved. Please check your credentials.","messageWebHookUpdated":"VRPayment WebHook has been updated.","options":{"cardTitle":"Options","emailEnabled":{"label":"Send order confirmation email","tooltipText":"If this setting is enabled your customers will receive an email from your store when their order payment is authorised"},"integration":{"label":"Integration","options":{"iframe":"Iframe","payment_page":"Payment Page"},"tooltipText":"Integration"},"lineItemConsistencyEnabled":{"label":"Line item consistency","tooltipText":"If this option is enabled line item totals in VRPaymentPayment will always match Shopware order total"},"spaceViewId":{"label":"Space View ID","tooltipText":"Space View ID"}},"save":"Save","storefrontOptions":{"cardTitle":"Storefront Options","invoiceDownloadEnabled":{"label":"Invoice Download","tooltipText":"If this setting is enabled your customers will be able to download order invoices from VRPayment"}},"advancedOptions":{"cardTitle":"Advanced Options","webhooksUpdateEnabled":{"label":"Webhooks Update","tooltipText":"If this setting is enabled webhook update will be triggered when you save settings"},"paymentsUpdateEnabled":{"label":"Payments Update","tooltipText":"If this setting is enabled payment methods update will be triggered when you save settings"}},"titleError":"Error","titleSuccess":"Success"}}}'),Y=JSON.parse('{"sw-privileges":{"permissions":{"parents":{"vrpayment":"VRPayment brancher"},"vrpayment":{"label":"VRPayment autorisations"}}},"vrpayment-settings":{"general":{"descriptionTextModule":"Param\xe8tres de VRPayment","mainMenuItemGeneral":"VRPayment"},"header":"VRPayment","messageNotBlank":"Cette valeur ne doit pas \xeatre vide.","salesChannelCard":{"button":{"description":"Cliquez sur ce bouton pour d\xe9finir VRPayment comme gestionnaire de paiement par d\xe9faut dans le canal de vente s\xe9lectionn\xe9.","label":"D\xe9finir VRPayment comme gestionnaire de paiement par d\xe9faut"},"messageDefaultPaymentError":"VRPayment comme paiement par d\xe9faut n\'a pas pu \xeatre d\xe9fini.","messageDefaultPaymentUpdated":"VRPayment comme paiement par d\xe9faut a \xe9t\xe9 d\xe9fini."},"settingForm":{"credentials":{"applicationKey":{"label":"Application Key","tooltipText":"La cl\xe9 d\'application est utilis\xe9e pour authentifier ce plugin avec l\'API."},"cardTitle":"R\xe9f\xe9rences","spaceId":{"label":"Space ID","tooltipText":"L\'ID de l\'espace est utilis\xe9 pour authentifier ce plugin avec l\'API VRPayment.."},"userId":{"label":"User ID","tooltipText":"L\'ID utilisateur est utilis\xe9 pour authentifier ce plugin avec l\'API VRPayment."},"button":{"description":"Cliquez sur ce bouton pour tester l\'API VRPayment.","label":"Test de connexion \xe0 l\'API"},"alert":{"title":"Test API","successMessage":"La connexion a \xe9t\xe9 test\xe9e avec succ\xe8s.","errorMessage":"La connexion a \xe9chou\xe9. R\xe9essayez."}},"messageSaveSuccess":"Les param\xe8tres de VRPayment ont \xe9t\xe9 enregistr\xe9s.","messageOrderDeliveryStateError":"Les param\xe8tres de VRPayment OrderDeliveryState n\'ont pas pu \xeatre enregistr\xe9s.","messageOrderDeliveryStateUpdated":"VRPayment OrderDeliveryState a \xe9t\xe9 mis \xe0 jour.","messagePaymentMethodConfigurationError":"VRPayment PaymentMethodConfiguration n\'a pas pu \xeatre enregistr\xe9. Veuillez v\xe9rifier vos informations d\'identification.","messagePaymentMethodConfigurationUpdated":"VRPayment PaymentMethodConfiguration a \xe9t\xe9 enregistr\xe9.","messageWebHookError":"VRPayment WebHook n\'a pas pu \xeatre enregistr\xe9. Veuillez v\xe9rifier vos informations d\'identification.","messageWebHookUpdated":"VRPayment WebHook a \xe9t\xe9 mis \xe0 jour.","options":{"cardTitle":"Options","emailEnabled":{"label":"Envoyer un e-mail de confirmation de commande","tooltipText":"If this setting is enabled your customers will receive an email from your store when their order payment is authorised"},"integration":{"label":"Integration","options":{"iframe":"Iframe","payment_page":"Page de paiement"},"tooltipText":"Integration"},"lineItemConsistencyEnabled":{"label":"Coh\xe9rence des postes de ligne","tooltipText":"Si cette option est activ\xe9e, les totaux des articles dans VRPaymentPayment correspondront toujours au total de la commande Shopware."},"spaceViewId":{"label":"Space View ID","tooltipText":"Space View ID"}},"save":"Enregistrer","storefrontOptions":{"cardTitle":"Storefront Options","invoiceDownloadEnabled":{"label":"T\xe9l\xe9chargement de facture","tooltipText":"Si ce param\xe8tre est activ\xe9, vos clients pourront t\xe9l\xe9charger les factures de commande depuis VRPayment"}},"advancedOptions":{"cardTitle":"Options avanc\xe9es","webhooksUpdateEnabled":{"label":"Mise \xe0 jour des webhooks","tooltipText":"Si ce param\xe8tre est activ\xe9, la mise \xe0 jour des webhooks sera d\xe9clench\xe9e lorsque vous enregistrerez les param\xe8tres."},"paymentsUpdateEnabled":{"label":"Mise \xe0 jour des paiements","tooltipText":"Si ce param\xe8tre est activ\xe9, la mise \xe0 jour des m\xe9thodes de paiement sera d\xe9clench\xe9e lorsque vous enregistrez les param\xe8tres."}},"titleError":"Erreur","titleSuccess":"Succ\xe8s"}}}'),Z=JSON.parse('{"sw-privileges":{"permissions":{"parents":{"vrpayment":"VRPayment brancher"},"vrpayment":{"label":"VRPayment autorisations"}}},"vrpayment-settings":{"general":{"descriptionTextModule":"Impostazioni VRPayment","mainMenuItemGeneral":"VRPayment"},"header":"VRPayment","messageNotBlank":"Questo valore non dovrebbe essere vuoto.","salesChannelCard":{"button":{"description":"Fai clic su questo pulsante per impostare VRPayment come gestore di pagamento predefinito nel SalesChannel selezionato","label":"Imposta VRPayment come gestore di pagamento predefinito"},"messageDefaultPaymentError":"Non \xe8 stato possibile impostare VRPayment come pagamento predefinito.","messageDefaultPaymentUpdated":"VRPayment come pagamento predefinito \xe8 stato impostato."},"settingForm":{"credentials":{"applicationKey":{"label":"Chiave di applicazione","tooltipText":"La chiave dell\'applicazione \xe8 usata per autenticare questo plugin con l\'API VRPayment."},"cardTitle":"Credenziali","spaceId":{"label":"ID spazio","tooltipText":"L\'ID dello spazio \xe8 usato per autenticare questo plugin con l\'API VRPayment."},"userId":{"label":"ID utente","tooltipText":"L\'ID utente \xe8 usato per autenticare questo plugin con l\'API VRPayment."},"button":{"description":"Fare clic su questo pulsante per testare l\'API VRPayment.","label":"Test di connessione API"},"alert":{"title":"Test API","successMessage":"La connessione \xe8 stata testata con successo.","errorMessage":"La connessione \xe8 fallita. Riprovare."}},"messageSaveSuccess":"Le impostazioni di VRPayment sono state salvate.","messageOrderDeliveryStateError":"VRPayment OrderDeliveryState non pu\xf2 essere salvato.","messageOrderDeliveryStateUpdated":"VRPayment OrderDeliveryState \xe8 stato aggiornato.","messagePaymentMethodConfigurationError":"VRPayment PaymentMethodConfiguration non pu\xf2 essere salvato. Per favore controlla le tue credenziali.","messagePaymentMethodConfigurationUpdated":"VRPayment PaymentMethodConfiguration \xe8 stato registrato.","messageWebHookError":"VRPayment WebHook non pu\xf2 essere salvato. Per favore controlla le tue credenziali.","messageWebHookUpdated":"VRPayment WebHook \xe8 stato aggiornato.","options":{"cardTitle":"Opzioni","emailEnabled":{"label":"Invia email di conferma dell\'ordine","tooltipText":"Se questa impostazione \xe8 abilitata i tuoi clienti riceveranno un\'email dal tuo negozio quando il pagamento del loro ordine sar\xe0 autorizzato"},"integration":{"label":"Integrazione","options":{"iframe":"Iframe","payment_page":"Pagina di pagamento"},"tooltipText":"Integrazione"},"lineItemConsistencyEnabled":{"label":"Coerenza dell\'elemento linea","tooltipText":"Se questa opzione \xe8 abilitata i totali degli articoli in VRPaymentPayment corrisponderanno sempre al totale dell\'ordine Shopware"},"spaceViewId":{"label":"ID della vista spazio","tooltipText":"ID della vista spaziale"}},"save":"Salva","storefrontOptions":{"cardTitle":"Opzioni vetrina","invoiceDownloadEnabled":{"label":"Scaricamento fattura","tooltipText":"Se questa impostazione \xe8 abilitata i tuoi clienti potranno scaricare le fatture degli ordini da VRPayment"}},"advancedOptions":{"cardTitle":"Opzioni avanzate","webhooksUpdateEnabled":{"label":"Aggiornamento webhooks","tooltipText":"Se questa impostazione \xe8 abilitata l\'aggiornamento dei webhook sar\xe0 attivato quando si salvano le impostazioni"},"paymentsUpdateEnabled":{"label":"Aggiornamento pagamenti","tooltipText":"Se questa impostazione \xe8 abilitata l\'aggiornamento dei metodi di pagamento verr\xe0 attivato quando si salvano le impostazioni"}},"titleError":"Errore","titleSuccess":"Successo"}}}');let{Module:J}=Shopware;J.register("vrpayment-settings",{type:"plugin",name:"VRPayment",title:"vrpayment-settings.general.descriptionTextModule",description:"vrpayment-settings.general.descriptionTextModule",color:"#28d8ff",icon:"default-action-settings",version:"1.0.1",targetVersion:"1.0.1",snippets:{"de-DE":Q,"en-GB":j,"fr-FR":Y,"it-IT":Z},routes:{index:{component:"vrpayment-settings",path:"index",meta:{parentPath:"sw.settings.index",privilege:"vrpayment.viewer"},props:{default:e=>({hash:e.params.hash})}}},settingsItem:{group:"plugins",to:"vrpayment.settings.index",iconComponent:"sw-vrpayment-settings-icon",backgroundEnabled:!0,privilege:"vrpayment.viewer"}});let X=Shopware.Classes.ApiService;var ee=class extends X{constructor(e,t,n="vrpayment"){super(e,t,n)}registerWebHooks(e=null){let t=this.getBasicHeaders(),n=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/register-web-hooks`;return this.httpClient.post(n,{salesChannelId:e},{headers:t}).then(e=>X.handleResponse(e))}checkApiConnection(e=null,t=null,n=null){let a=this.getBasicHeaders(),i=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/check-api-connection`;return this.httpClient.post(i,{spaceId:e,userId:t,applicationId:n},{headers:a}).then(e=>X.handleResponse(e))}setVRPaymentAsSalesChannelPaymentDefault(e=null){let t=this.getBasicHeaders(),n=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/set-vrpayment-as-sales-channel-payment-default`;return this.httpClient.post(n,{salesChannelId:e},{headers:t}).then(e=>X.handleResponse(e))}synchronizePaymentMethodConfiguration(e=null){let t=this.getBasicHeaders(),n=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/synchronize-payment-method-configuration`;return this.httpClient.post(n,{salesChannelId:e},{headers:t}).then(e=>X.handleResponse(e))}installOrderDeliveryStates(){let e=this.getBasicHeaders(),t=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/configuration/install-order-delivery-states`;return this.httpClient.post(t,{},{headers:e}).then(e=>X.handleResponse(e))}};let et=Shopware.Classes.ApiService;var en=class extends et{constructor(e,t,n="vrpayment"){super(e,t,n)}createRefund(e,t,n,a){let i=this.getBasicHeaders(),r=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/refund/create-refund/`;return this.httpClient.post(r,{salesChannelId:e,transactionId:t,quantity:n,lineItemId:a},{headers:i}).then(e=>et.handleResponse(e))}createRefundByAmount(e,t,n){let a=this.getBasicHeaders(),i=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/refund/create-refund-by-amount/`;return this.httpClient.post(i,{salesChannelId:e,transactionId:t,refundableAmount:n},{headers:a}).then(e=>et.handleResponse(e))}createPartialRefund(e,t,n,a){let i=this.getBasicHeaders(),r=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/refund/create-partial-refund/`;return this.httpClient.post(r,{salesChannelId:e,transactionId:t,refundableAmount:n,lineItemId:a},{headers:i}).then(e=>et.handleResponse(e))}};let ea=Shopware.Classes.ApiService;var ei=class extends ea{constructor(e,t,n="vrpayment"){super(e,t,n)}getTransactionData(e,t){let n=this.getBasicHeaders(),a=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction/get-transaction-data/`;return this.httpClient.post(a,{salesChannelId:e,transactionId:t},{headers:n}).then(e=>ea.handleResponse(e))}getInvoiceDocument(e,t){return`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction/get-invoice-document/${e}/${t}`}getPackingSlip(e,t){return`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction/get-packing-slip/${e}/${t}`}};let er=Shopware.Classes.ApiService;var es=class extends er{constructor(e,t,n="vrpayment"){super(e,t,n)}createTransactionCompletion(e,t){let n=this.getBasicHeaders(),a=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction-completion/create-transaction-completion/`;return this.httpClient.post(a,{salesChannelId:e,transactionId:t},{headers:n}).then(e=>er.handleResponse(e))}};let eo=Shopware.Classes.ApiService;var el=class extends eo{constructor(e,t,n="vrpayment"){super(e,t,n)}createTransactionVoid(e,t){let n=this.getBasicHeaders(),a=`${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/transaction-void/create-transaction-void/`;return this.httpClient.post(a,{salesChannelId:e,transactionId:t},{headers:n}).then(e=>eo.handleResponse(e))}};let{Application:ec}=Shopware;ec.addServiceProvider("VRPaymentConfigurationService",e=>new ee(ec.getContainer("init").httpClient,e.loginService)),ec.addServiceProvider("VRPaymentRefundService",e=>new en(ec.getContainer("init").httpClient,e.loginService)),ec.addServiceProvider("VRPaymentTransactionService",e=>new ei(ec.getContainer("init").httpClient,e.loginService)),ec.addServiceProvider("VRPaymentTransactionCompletionService",e=>new es(ec.getContainer("init").httpClient,e.loginService)),ec.addServiceProvider("VRPaymentTransactionVoidService",e=>new el(ec.getContainer("init").httpClient,e.loginService))}()}(); \ No newline at end of file