diff --git a/CHANGELOG_de-DE.md b/CHANGELOG_de-DE.md index aa0f8054..aed5ecd4 100644 --- a/CHANGELOG_de-DE.md +++ b/CHANGELOG_de-DE.md @@ -1,3 +1,6 @@ +# 7.1.9 +* Anpassungen für Unzer Shopware 6.7 plugin zur Unterstützung des Unzer Refund Manager + # 7.1.8 * Zuverlässigerer Checkout: Der „Bezahlen“-Button wartet jetzt, bis alle erforderlichen Komponenten vollständig geladen sind, wodurch fehlgeschlagene Bestellungen verhindert werden. * Leistungsverbesserung: Ein redundanter Abruf der Händlerkonfiguration wurde entfernt, wenn die Konfiguration bereits vorhanden ist. diff --git a/CHANGELOG_en-GB.md b/CHANGELOG_en-GB.md index e8fe02ec..5a03cde1 100644 --- a/CHANGELOG_en-GB.md +++ b/CHANGELOG_en-GB.md @@ -1,3 +1,6 @@ +# 7.1.9 +* Changes for Unzer Shopware 6.7 plugin to support Unzer Refund Manager + # 7.1.8 * More reliable checkout: The "Pay" button now waits until all required components are fully loaded, preventing failed orders. * Performance improvement: Eliminated a redundant merchant config fetch when the config is already provided. diff --git a/composer.json b/composer.json index dcc55063..1b4bfb55 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "unzerdev/shopware6", "description": "Unzer payment integration for Shopware 6", - "version": "7.1.8", + "version": "7.1.9", "type": "shopware-platform-plugin", "license": "Apache-2.0", "minimum-stability": "dev", diff --git a/src/Components/CancelService/CancelService.php b/src/Components/CancelService/CancelService.php index f37e1723..db296e8f 100644 --- a/src/Components/CancelService/CancelService.php +++ b/src/Components/CancelService/CancelService.php @@ -23,7 +23,7 @@ class CancelService implements CancelServiceInterface { - private const PAYLATER_PAYMENT_METHODS = [ + public const PAYLATER_PAYMENT_METHODS = [ PaymentInstaller::PAYMENT_ID_PAYLATER_INVOICE, PaymentInstaller::PAYMENT_ID_PAYLATER_INSTALLMENT, PaymentInstaller::PAYMENT_ID_PAYLATER_DIRECT_DEBIT_SECURED, @@ -41,7 +41,7 @@ public function __construct( /** * {@inheritdoc} */ - public function cancelChargeById(string $orderTransactionId, string $chargeId, float $amountGross, ?string $reasonCode, Context $context): void + public function cancelChargeById(string $orderTransactionId, string $chargeId, float $amountGross, ?string $reasonCode, Context $context, string $referenceText = ''): Cancellation { $decimalPrecision = UnzerPayment6::MAX_DECIMAL_PRECISION; @@ -76,24 +76,27 @@ public function cancelChargeById(string $orderTransactionId, string $chargeId, f $payment = UnzerTransactionUtil::fetchPaymentFromOrderTransaction($transaction, $client); if ($this->isPaylaterPaymentMethod($transaction->getPaymentMethodId())) { $cancellation = new Cancellation($amountGross); + $cancellation->setPaymentReference($referenceText); - $client->cancelChargedPayment( + $responseCancellation = $client->cancelChargedPayment( $payment, $cancellation ); } else { - $client->cancelChargeById( + $responseCancellation = $client->cancelChargeById( $payment, $chargeId, $amountGross, $this->getCancelReasonCode($reasonCode), - '', + $referenceText, $amountNet, $amountVat ); } $this->updateOrderStatus($client, $transaction, $context); + + return $responseCancellation; } /** @@ -121,6 +124,11 @@ public function cancelAuthorizationById(string $orderTransactionId, string $paym $this->updateOrderStatus($client, $transaction, $context); } + public function isPaylaterPaymentMethod(string $paymentMethodId): bool + { + return \in_array($paymentMethodId, self::PAYLATER_PAYMENT_METHODS, true); + } + protected function getOrderTransaction(string $orderTransactionId, Context $context): ?OrderTransactionEntity { $criteria = new Criteria([$orderTransactionId]); @@ -139,11 +147,6 @@ protected function getCancelReasonCode(?string $reasonCode): string return $reasonCode ?? CancelReasonCodes::REASON_CODE_CANCEL; } - protected function isPaylaterPaymentMethod(string $paymentMethodId): bool - { - return \in_array($paymentMethodId, self::PAYLATER_PAYMENT_METHODS, true); - } - private function updateOrderStatus(Unzer $client, OrderTransactionEntity $orderTransaction, Context $context): void { try { diff --git a/src/Components/CancelService/CancelServiceInterface.php b/src/Components/CancelService/CancelServiceInterface.php index 98fe84af..ef20070c 100644 --- a/src/Components/CancelService/CancelServiceInterface.php +++ b/src/Components/CancelService/CancelServiceInterface.php @@ -6,6 +6,7 @@ use Shopware\Core\Framework\Context; use UnzerSDK\Exceptions\UnzerApiException; +use UnzerSDK\Resources\TransactionTypes\Cancellation; interface CancelServiceInterface { @@ -18,8 +19,9 @@ public function cancelChargeById( string $chargeId, float $amountGross, ?string $reasonCode, - Context $context - ): void; + Context $context, + string $referenceText = '' + ): Cancellation; /** * @throws UnzerApiException @@ -31,4 +33,6 @@ public function cancelAuthorizationById( float $amountGross, Context $context ): void; + + public function isPaylaterPaymentMethod(string $paymentMethodId): bool; } diff --git a/src/Components/ConfigReader/ConfigReader.php b/src/Components/ConfigReader/ConfigReader.php index c976a84e..a33a8f90 100644 --- a/src/Components/ConfigReader/ConfigReader.php +++ b/src/Components/ConfigReader/ConfigReader.php @@ -44,6 +44,7 @@ class ConfigReader implements ConfigReaderInterface public const CONFIG_KEY_PAYPAL_SHOW_SAVE_ACCOUNT = 'paypalShowSaveAccount'; public const CONFIG_KEY_DELIVERY_STATUS_FOR_CAPTURE = 'deliveryStatusForAutomaticCapture'; public const CONFIG_KEY_DELIVERY_STATUS_FOR_REFUND = 'deliveryStatusForAutomaticRefund'; + public const CONFIG_KEY_DELIVERY_STATUS_FOR_RETURNS_REFUND = 'deliveryStatusForAutomaticReturnsRefund'; public const CONFIG_KEY_USE_EXPRESS_PAYPAL = 'usePaypalExpress'; public const CONFIG_KEY_USE_EXPRESS_GOOGLE = 'useGooglePayExpress'; diff --git a/src/Components/PaymentActions/PaymentActionService.php b/src/Components/PaymentActions/PaymentActionService.php new file mode 100644 index 00000000..99da8f4b --- /dev/null +++ b/src/Components/PaymentActions/PaymentActionService.php @@ -0,0 +1,299 @@ +unzerTransactionUtil->getOrderTransactionFromOrder($order, $context); + + if ($orderTransaction === null) { + return false; + } + + $this->logger->info('Capturing order', ['order' => $order->getId()]); + $client = $this->clientFactory->createClient(KeyPairContext::createFromOrderTransaction($orderTransaction)); + try { + $charge = $client->performChargeOnPayment($orderTransaction->getId(), new Charge($orderTransaction->getAmount()->getTotalPrice())); + $this->transactionStateHandler->transformTransactionState( + $orderTransaction->getId(), + $charge->getPayment(), + $context + ); + } catch (UnzerApiException $e) { + throw new \Exception($e->getMerchantMessage() ?: $e->getClientMessage()); + } + + return true; + } + + /** + * @throws \Exception + */ + public function refundOrder(OrderEntity $order, Context $context): void + { + $orderTransaction = $this->unzerTransactionUtil->getOrderTransactionFromOrder($order, $context); + + if ($orderTransaction === null) { + return; + } + + $this->logger->info('Refunding order', ['order' => $order->getId()]); + $client = $this->clientFactory->createClient(KeyPairContext::createFromOrderTransaction($orderTransaction)); + try { + $payment = $client->fetchPayment($orderTransaction->getId()); + foreach ($payment->getCharges() as $charge) { + try { + if ($charge->isError()) { + continue; + } + $this->logger->info('Refunding charge', ['chargeId' => $charge->getId()]); + $this->cancelService->cancelChargeById( + $orderTransaction->getId(), + $charge->getId(), + $charge->getAmount() - $charge->getCancelledAmount(), + null, + $context + ); + } catch (\Throwable $e) { + $this->logger->error('Error while refunding charge', ['charge' => $charge->getId(), 'error' => $e->getMessage()]); + } + } + $authorization = $payment->getAuthorization(); + if ($authorization !== null && !$authorization->isError()) { + try { + $this->logger->info('Refunding authorization', ['paymentId' => $payment->getId(), 'authorizationId' => $authorization->getId()]); + + $this->cancelService->cancelAuthorizationById( + $orderTransaction->getId(), + $payment->getId(), + $authorization->getAmount() - $authorization->getCancelledAmount(), + $context + ); + } catch (\Throwable $e) { + $this->logger->error('Error while refunding authorization', ['authorization' => $authorization->getId(), 'error' => $e->getMessage()]); + } + } + $this->transactionStateHandler->transformTransactionState( + $orderTransaction->getId(), + $payment, + $context + ); + } catch (UnzerApiException $e) { + throw new \Exception($e->getMerchantMessage() ?: $e->getClientMessage()); + } + } + + public function executeReturnRefunds(OrderEntity $order, Context $context): void + { + if ($this->orderReturnRepository === null) { + $this->logger->warning('Returns repository does not exist'); + + return; + } + + $orderTransaction = $this->unzerTransactionUtil->getOrderTransactionFromOrder($order, $context); + + if ($orderTransaction === null) { + return; + } + + $this->logger->info('Refunding order based on returns', ['order' => $order->getId()]); + $returnsToProcess = $this->getUnprocessedReturns($orderTransaction, $context); + + foreach ($returnsToProcess as $returnEntity) { + $items = new RefundItemCollection(); + foreach ($returnEntity->getLineItems() as $lineItem) { + $refundItem = new RefundItem( + id: $lineItem->getOrderLineItemId(), + quantity: $lineItem->getQuantity(), + amount: $lineItem->getRefundAmount(), + resetStockQuantity: 0, + label: $lineItem->getLineItem()->getLabel(), + ); + $items->add($refundItem); + } + $cancellationId = $this->doUnifiedRefund( + orderTransaction: $orderTransaction, + amount: $returnEntity->getAmountTotal(), + context: $context, + items: $items, + comment: 'SW Auto Refund from order #' . $order->getOrderNumber() . ' return #' . $returnEntity->getReturnNumber(), + referenceText: $order->getOrderNumber() . '/' . $returnEntity->getReturnNumber() + ); + + $transactionCustomFields = $orderTransaction->getCustomFields() ?? []; + if (!isset($transactionCustomFields['unzerRefundDetails']['processedReturns'])) { + $transactionCustomFields['unzerRefundDetails']['processedReturns'] = []; + } + $transactionCustomFields['unzerRefundDetails']['processedReturns'][$returnEntity->getId()] = $cancellationId; + + $this->unzerTransactionUtil->updateOrderTransaction([ + 'id' => $orderTransaction->getId(), + 'customFields' => $transactionCustomFields, + ], $context); + + $orderTransaction->setCustomFields($transactionCustomFields); + + $existingComment = $returnEntity->getInternalComment() ?? ''; + $refundNote = 'Unzer refund processed: ' . $cancellationId . ' (' . (new \DateTimeImmutable())->format('Y-m-d H:i:s') . ')'; + $newComment = $existingComment ? $existingComment . "\n\n" . $refundNote : $refundNote; + + $this->orderReturnRepository->update([ + [ + 'id' => $returnEntity->getId(), + 'internalComment' => $newComment, + ], + ], $context); + } + } + + public function doUnifiedRefund(OrderTransactionEntity $orderTransaction, float $amount, Context $context, ?RefundItemCollection $items = null, string $comment = '', string $referenceText = ''): string + { + $client = $this->clientFactory->createClient(KeyPairContext::createFromOrderTransaction($orderTransaction)); + $payment = UnzerTransactionUtil::fetchPaymentFromOrderTransaction($orderTransaction, $client); + $charges = $payment->getCharges(); + $charge = reset($charges); // TODO + + $cancellation = $this->cancelService->cancelChargeById($orderTransaction->getId(), $charge->getId(), $amount, null, $context, $referenceText); + + $transactionCustomFields = $orderTransaction->getCustomFields() ?? []; + if (!isset($transactionCustomFields['unzerRefundDetails'])) { + $transactionCustomFields['unzerRefundDetails'] = []; + } + + $transactionCustomFields['unzerRefundDetails'][$cancellation->getId()] = [ + 'items' => $items ? $items->jsonSerialize() : [], + 'comment' => $comment, + 'cancellation' => $cancellation->expose(), + ]; + + $this->unzerTransactionUtil->updateOrderTransaction([ + 'id' => $orderTransaction->getId(), + 'customFields' => $transactionCustomFields, + ], $context); + + $orderTransaction->setCustomFields($transactionCustomFields); + + if ($items !== null && $items->count() > 0) { + $this->processRefundItems($items, $context); + } + + return $cancellation->getId(); + } + + /** + * @return OrderReturnEntity[] + */ + protected function getUnprocessedReturns(OrderTransactionEntity $orderTransaction, Context $context): array + { + if ($this->orderReturnRepository === null) { + return []; + } + + $criteria = new Criteria(); + $criteria->addFilter(new EqualsFilter('orderId', $orderTransaction->getOrderId())); + $criteria->addAssociation('lineItems.lineItem.orderLineItem'); + + $returns = $this->orderReturnRepository->search($criteria, $context); + + $transactionCustomFields = $orderTransaction->getCustomFields() ?? []; + $processedReturns = $transactionCustomFields['unzerRefundDetails']['processedReturns'] ?? []; + + $unprocessedReturns = []; + + foreach ($returns as $return) { + if (isset($processedReturns[$return->getId()])) { + continue; + } + + $unprocessedReturns[] = $return; + } + + return $unprocessedReturns; + } + + protected function processRefundItems(RefundItemCollection $items, Context $context): void + { + foreach ($items->getElements() as $item) { + $lineItemId = $item->getId(); + $quantity = $item->getQuantity(); + $amount = $item->getAmount(); + $restockQuantity = $item->getResetStockQuantity(); + + if ($quantity <= 0 && $restockQuantity <= 0) { + continue; + } + + /** @var OrderLineItemEntity $lineItem */ + $lineItem = $this->orderLineItemRepository->search(new Criteria([$lineItemId]), $context)->first(); + + if ($lineItem === null) { + continue; + } + + if ($restockQuantity > 0 && $lineItem->getProductId()) { + /** @var ProductEntity $product */ + $product = $this->productRepository->search(new Criteria([$lineItem->getProductId()]), $context)->first(); + if ($product !== null) { + $updatePayload = [ + 'id' => $product->getId(), + 'quantity' => $product->getStock() + $restockQuantity, + ]; + $this->productRepository->update([$updatePayload], $context); + } + } + if ($quantity > 0) { + $customFields = $lineItem->getCustomFields(); + if (!\is_array($customFields)) { + $customFields = []; + } + + $customFields['unzerRefundedQuantity'] = ($customFields['unzerRefundedQuantity'] ?? 0) + $quantity; + $customFields['unzerRefundedAmount'] = ($customFields['unzerRefundedAmount'] ?? 0) + $amount; + $updatePayload = [ + 'id' => $lineItem->getId(), + 'customFields' => $customFields, + ]; + $this->orderLineItemRepository->update([$updatePayload], $context); + } + } + } +} diff --git a/src/Components/PaymentActions/Struct/RefundItem.php b/src/Components/PaymentActions/Struct/RefundItem.php new file mode 100644 index 00000000..cc6e49e7 --- /dev/null +++ b/src/Components/PaymentActions/Struct/RefundItem.php @@ -0,0 +1,55 @@ +id; + } + + public function getQuantity(): int + { + return $this->quantity; + } + + public function getAmount(): float + { + return $this->amount; + } + + public function getResetStockQuantity(): int + { + return $this->resetStockQuantity; + } + + public function getLabel(): ?string + { + return $this->label; + } +} diff --git a/src/Components/PaymentActions/Struct/RefundItemCollection.php b/src/Components/PaymentActions/Struct/RefundItemCollection.php new file mode 100644 index 00000000..ea9e41d4 --- /dev/null +++ b/src/Components/PaymentActions/Struct/RefundItemCollection.php @@ -0,0 +1,47 @@ + + * + * @method void add(RefundItem $entity) + * @method void set(string $key, RefundItem $entity) + * @method RefundItem[] getIterator() + * @method RefundItem[] getElements() + * @method RefundItem|null get(string $key) + * @method RefundItem|null first() + * @method RefundItem|null last() + */ +class RefundItemCollection extends Collection +{ + public static function fromArray(array $items): self + { + $collection = new self(); + + foreach ($items as $item) { + $collection->add(RefundItem::fromArray($item)); + } + + return $collection; + } + + public function jsonSerialize(): array + { + $return = []; + foreach ($this->getElements() as $item) { + $return[] = $item->jsonSerialize(); + } + + return $return; + } + + protected function getExpectedClass(): ?string + { + return RefundItem::class; + } +} diff --git a/src/Components/PaymentHandler/UnzerKlarnaPaymentHandler.php b/src/Components/PaymentHandler/UnzerKlarnaPaymentHandler.php index 2e0ef782..aaf645cf 100644 --- a/src/Components/PaymentHandler/UnzerKlarnaPaymentHandler.php +++ b/src/Components/PaymentHandler/UnzerKlarnaPaymentHandler.php @@ -21,8 +21,6 @@ class UnzerKlarnaPaymentHandler extends AbstractUnzerPaymentHandler use CanAuthorize; use CanCharge; - protected BasePaymentType $paymentType; - /** * {@inheritdoc} */ diff --git a/src/Components/ResourceHydrator/PaymentResourceHydrator/PaymentResourceHydrator.php b/src/Components/ResourceHydrator/PaymentResourceHydrator/PaymentResourceHydrator.php index 78277e25..adf9b22c 100644 --- a/src/Components/ResourceHydrator/PaymentResourceHydrator/PaymentResourceHydrator.php +++ b/src/Components/ResourceHydrator/PaymentResourceHydrator/PaymentResourceHydrator.php @@ -372,6 +372,7 @@ protected function hydrateTransactionItem(AbstractTransactionType $item, string return [ 'id' => $item->getId(), 'shortId' => $item->getShortId(), + 'reference' => method_exists($item, 'getPaymentReference') ? $item->getPaymentReference() : '', 'state' => $state, 'date' => $item->getDate(), 'type' => $type, diff --git a/src/Components/UnzerUtil/UnzerTransactionUtil.php b/src/Components/UnzerUtil/UnzerTransactionUtil.php index e37ba3c0..9b103dfe 100644 --- a/src/Components/UnzerUtil/UnzerTransactionUtil.php +++ b/src/Components/UnzerUtil/UnzerTransactionUtil.php @@ -10,44 +10,40 @@ use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsAnyFilter; use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter; -use UnzerPayment6\Components\CancelService\CancelServiceInterface; -use UnzerPayment6\Components\ClientFactory\ClientFactoryInterface; -use UnzerPayment6\Components\Struct\KeyPairContext; use UnzerPayment6\Components\TransactionStateHandler\TransactionStateHandlerInterface; use UnzerPayment6\Installer\CustomFieldInstaller; use UnzerPayment6\Installer\PaymentInstaller; use UnzerSDK\Exceptions\UnzerApiException; use UnzerSDK\Resources\Payment; -use UnzerSDK\Resources\TransactionTypes\Charge; use UnzerSDK\Unzer; readonly class UnzerTransactionUtil { + public const ORDER_TRANSACTION_ASSOCIATIONS = [ + 'order', + 'order.billingAddress.country', + 'order.currency', + 'order.documents.documentType', + 'paymentMethod', + 'order.orderCustomer.customer', + 'order.deliveries.shippingMethod.translated', + 'order.deliveries.shippingOrderAddress.country', + 'order.lineItems.product.manufacturer', + 'order.lineItems.cover.url', + 'order.lineItems.calculatedPrices.taxes', + ]; + public function __construct( protected EntityRepository $orderTransactionRepository, - protected ClientFactoryInterface $clientFactory, protected TransactionStateHandlerInterface $transactionStateHandler, - protected CancelServiceInterface $cancelService, - protected LoggerInterface $logger + protected LoggerInterface $logger, ) { } public function getOrderTransaction(string $orderTransactionId, Context $context): ?OrderTransactionEntity { $criteria = new Criteria([$orderTransactionId]); - $criteria->addAssociations([ - 'order', - 'order.billingAddress.country', - 'order.currency', - 'order.documents.documentType', - 'paymentMethod', - 'order.orderCustomer.customer', - 'order.deliveries.shippingMethod.translated', - 'order.deliveries.shippingOrderAddress.country', - 'order.lineItems.product.manufacturer', - 'order.lineItems.cover.url', - 'order.lineItems.calculatedPrices.taxes', - ]); + $criteria->addAssociations(self::ORDER_TRANSACTION_ASSOCIATIONS); return $this->orderTransactionRepository->search($criteria, $context)->first(); } @@ -60,100 +56,19 @@ public function getOrderTransactionFromOrder(OrderEntity $orderEntity, Context $ $criteria = new Criteria(); $criteria->addFilter(new EqualsFilter('orderId', $orderEntity->getId())); $criteria->addFilter(new EqualsAnyFilter('paymentMethodId', PaymentInstaller::PAYMENT_METHOD_IDS)); - $criteria->addAssociations([ - 'order', - 'order.billingAddress', - 'order.currency', - 'order.documents', - 'order.documents.documentType', - 'paymentMethod', - ]); + $criteria->addAssociations(self::ORDER_TRANSACTION_ASSOCIATIONS); - return $this->orderTransactionRepository->search($criteria, $context)->first(); + return $this->orderTransactionRepository->search($criteria, $context)->last(); } - /** - * @throws \Exception - */ - public function captureOrder(OrderEntity $order, Context $context): bool - { - $this->logger->info('Capturing order', ['order' => $order->getId()]); - $orderTransaction = $this->getOrderTransactionFromOrder($order, $context); - - if ($orderTransaction === null) { - return false; - } - - $client = $this->clientFactory->createClient(KeyPairContext::createFromOrderTransaction($orderTransaction)); - try { - $charge = $client->performChargeOnPayment($orderTransaction->getId(), new Charge($orderTransaction->getAmount()->getTotalPrice())); - $this->transactionStateHandler->transformTransactionState( - $orderTransaction->getId(), - $charge->getPayment(), - $context - ); - } catch (UnzerApiException $e) { - throw new \Exception($e->getMerchantMessage() ?: $e->getClientMessage()); - } - - return true; - } - - /** - * @throws \Exception - */ - public function refundOrder(OrderEntity $order, Context $context): void + public function getOrderTransactionFromOrderNumber(string $orderNumber, Context $context): ?OrderTransactionEntity { - $this->logger->info('Refunding order', ['order' => $order->getId()]); - $orderTransaction = $this->getOrderTransactionFromOrder($order, $context); - - if ($orderTransaction === null) { - return; - } - - $client = $this->clientFactory->createClient(KeyPairContext::createFromOrderTransaction($orderTransaction)); - try { - $payment = $client->fetchPayment($orderTransaction->getId()); - foreach ($payment->getCharges() as $charge) { - try { - if ($charge->isError()) { - continue; - } - $this->logger->info('Refunding charge', ['chargeId' => $charge->getId()]); - $this->cancelService->cancelChargeById( - $orderTransaction->getId(), - $charge->getId(), - $charge->getAmount() - $charge->getCancelledAmount(), - null, - $context - ); - } catch (\Throwable $e) { - $this->logger->error('Error while refunding charge', ['charge' => $charge->getId(), 'error' => $e->getMessage()]); - } - } - $authorization = $payment->getAuthorization(); - if ($authorization !== null && !$authorization->isError()) { - try { - $this->logger->info('Refunding authorization', ['paymentId' => $payment->getId(), 'authorizationId' => $authorization->getId()]); + $criteria = new Criteria(); + $criteria->addFilter(new EqualsFilter('order.orderNumber', $orderNumber)); + $criteria->addFilter(new EqualsAnyFilter('paymentMethodId', PaymentInstaller::PAYMENT_METHOD_IDS)); + $criteria->addAssociations(self::ORDER_TRANSACTION_ASSOCIATIONS); - $this->cancelService->cancelAuthorizationById( - $orderTransaction->getId(), - $payment->getId(), - $authorization->getAmount() - $authorization->getCancelledAmount(), - $context - ); - } catch (\Throwable $e) { - $this->logger->error('Error while refunding authorization', ['authorization' => $authorization->getId(), 'error' => $e->getMessage()]); - } - } - $this->transactionStateHandler->transformTransactionState( - $orderTransaction->getId(), - $payment, - $context - ); - } catch (UnzerApiException $e) { - throw new \Exception($e->getMerchantMessage() ?: $e->getClientMessage()); - } + return $this->orderTransactionRepository->search($criteria, $context)->last(); } public static function fetchPaymentFromOrderTransaction(OrderTransactionEntity $orderTransaction, Unzer $client): Payment @@ -187,4 +102,9 @@ public function updateOrderTransactionStatus(Unzer $client, OrderTransactionEnti $this->logger->error('error updating transaction state from util: ' . $e->getMessage(), ['trace' => $e->getTraceAsString()]); } } + + public function updateOrderTransaction(array $data, Context $context): void + { + $this->orderTransactionRepository->update([$data], $context); + } } diff --git a/src/Controllers/Administration/UnzerPaymentTransactionController.php b/src/Controllers/Administration/UnzerPaymentTransactionController.php index 1e11235a..a9e5a3bf 100644 --- a/src/Controllers/Administration/UnzerPaymentTransactionController.php +++ b/src/Controllers/Administration/UnzerPaymentTransactionController.php @@ -11,11 +11,14 @@ use Shopware\Core\Framework\Context; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; use UnzerPayment6\Components\BasketConverter\BasketConverterInterface; use UnzerPayment6\Components\CancelService\CancelServiceInterface; use UnzerPayment6\Components\ClientFactory\ClientFactoryInterface; +use UnzerPayment6\Components\PaymentActions\PaymentActionService; +use UnzerPayment6\Components\PaymentActions\Struct\RefundItemCollection; use UnzerPayment6\Components\ResourceHydrator\PaymentResourceHydrator\PaymentResourceHydratorInterface; use UnzerPayment6\Components\ShipService\ShipServiceInterface; use UnzerPayment6\Components\Struct\KeyPairContext; @@ -30,6 +33,7 @@ class UnzerPaymentTransactionController extends AbstractController public function __construct( private readonly ClientFactoryInterface $clientFactory, private readonly UnzerTransactionUtil $unzerTransactionUtil, + private readonly PaymentActionService $paymentActionService, private readonly PaymentResourceHydratorInterface $hydrator, private readonly CancelServiceInterface $cancelService, private readonly ShipServiceInterface $shipService, @@ -65,6 +69,59 @@ public function fetchTransactionDetails(string $orderTransactionId, Context $con return new JsonResponse($data); } + #[Route(path: '/api/_action/unzer-payment/transaction/{orderTransactionId}/refund-information', name: 'api.action.unzer.transaction.refund-information', methods: ['GET'])] + public function fetchTransactionRefundInformation(string $orderTransactionId, Context $context): JsonResponse + { + $transaction = $this->getOrderTransaction($orderTransactionId, $context); + + if ($transaction === null || $transaction->getOrder() === null) { + throw PaymentException::invalidTransaction($orderTransactionId); + } + + $client = $this->clientFactory->createClient(KeyPairContext::createFromOrderTransaction($transaction)); + + try { + $payment = UnzerTransactionUtil::fetchPaymentFromOrderTransaction($transaction, $client); + + // TODO: kill the overhead + $data = $this->hydrator->hydrateArray($payment, $transaction, $client); + $transactions = $data['transactions']; + $refunds = array_filter($transactions, function (array $transaction) { + return $transaction['type'] === 'cancellation'; + }); + + foreach ($refunds as &$refund) { + if (isset($transaction->getCustomFields()['unzerRefundDetails'][$refund['id']])) { + $refund['details'] = $transaction->getCustomFields()['unzerRefundDetails'][$refund['id']]; + } + } + + $amounts = []; + $charges = $payment->getCharges(); + // TODO: currently the unified refunds run on the first charge only + /** @var Charge $charge */ + $charge = reset($charges); // TODO + if ($charge) { + $amounts['charged'] = $charge->isSuccess() ? $charge->getAmount() : 0; + if ($this->cancelService->isPaylaterPaymentMethod($transaction->getPaymentMethodId())) { + $amounts['cancelled'] = $payment->getAmount()->getCanceled(); + } else { + $amounts['cancelled'] = $charge->getCancelledAmount(); + } + $amounts['remaining'] = max(0, $amounts['charged'] - $amounts['cancelled']); + } + } catch (UnzerApiException|\Throwable $exception) { + $exceptionReturnValues = $this->handleException($exception, \sprintf('Error while executing fetching transaction details for order transaction [%s]: %s', $orderTransactionId, $exception->getMessage())); + + return new JsonResponse($exceptionReturnValues[0], $exceptionReturnValues[1]); + } + + return new JsonResponse([ + 'refunds' => $refunds, + 'amounts' => $amounts, + ]); + } + // TODO: evaluate if GET is the correct method here #[Route(path: '/api/_action/unzer-payment/transaction/{orderTransactionId}/charge/{amount}', name: 'api.action.unzer.transaction.charge', methods: ['GET'])] public function chargeTransaction(string $orderTransactionId, float $amount, Context $context): JsonResponse @@ -115,6 +172,48 @@ public function refundTransaction(string $orderTransactionId, string $chargeId, return new JsonResponse(['status' => true]); } + #[Route(path: '/api/_action/unzer-payment/transaction/refund', name: 'api.action.unzer.transaction.unified-refund', methods: ['POST'])] + public function unifiedRefund(Request $request, Context $context): JsonResponse + { + try { + if ($request->get('orderTransactionId')) { + $orderTransaction = $this->unzerTransactionUtil->getOrderTransaction($request->get('orderTransactionId'), $context); + } elseif ($request->get('orderNumber')) { + $orderTransaction = $this->unzerTransactionUtil->getOrderTransactionFromOrderNumber($request->get('orderNumber'), $context); + } + + if (empty($orderTransaction)) { + throw new \Exception('no order transaction found for request'); + } + } catch (\Throwable $exception) { + $exceptionReturnValues = $this->handleException($exception, 'no order transaction found for unifiedRefund', $exception->getMessage()); + + return new JsonResponse($exceptionReturnValues[0], $exceptionReturnValues[1]); + } + + $amount = (float) $request->get('amount', 0); + $referenceText = (string) $request->get('referenceText', ''); + $items = RefundItemCollection::fromArray((array) $request->get('items', [])); + $comment = (string) $request->get('comment', ''); + + try { + $this->paymentActionService->doUnifiedRefund( + orderTransaction: $orderTransaction, + amount: $amount, + context: $context, + items: $items, + comment: $comment, + referenceText: $referenceText + ); + } catch (UnzerApiException|\Throwable $exception) { + $exceptionReturnValues = $this->handleException($exception, \sprintf('Error while executing refund transaction for order transaction [%s]: %s', $orderTransaction->getId(), $exception->getMessage())); + + return new JsonResponse($exceptionReturnValues[0], $exceptionReturnValues[1]); + } + + return new JsonResponse(['success' => true]); + } + // TODO: evaluate if GET is the correct method here #[Route(path: '/api/_action/unzer-payment/transaction/{orderTransactionId}/cancel/{authorizationId}/{amount}', name: 'api.action.unzer.transaction.cancel', methods: ['GET'])] public function cancelTransaction(string $orderTransactionId, string $authorizationId, float $amount, Context $context): JsonResponse @@ -154,7 +253,8 @@ protected function handleException(\Throwable|UnzerApiException $exception, stri return [ [ 'status' => false, - 'errors' => [$exception instanceof UnzerApiException ? $exception->getMerchantMessage() : 'generic-error'], + 'success' => false, + 'errors' => [$exception instanceof UnzerApiException ? $exception->getMerchantMessage() : $exception->getMessage()], ], Response::HTTP_BAD_REQUEST, ]; diff --git a/src/Controllers/Storefront/UnzerPaymentDeviceController.php b/src/Controllers/Storefront/UnzerPaymentDeviceController.php index 770ef2c4..4b55b013 100644 --- a/src/Controllers/Storefront/UnzerPaymentDeviceController.php +++ b/src/Controllers/Storefront/UnzerPaymentDeviceController.php @@ -21,9 +21,6 @@ public function __construct( // TODO: evaluate if GET is the correct method for this route #[Route(path: '/unzer/deleteDevice', name: 'frontend.unzer.device.delete', methods: ['GET'])] - /** - * @Route("/unzer/deleteDevice", name="frontend.unzer.device.delete", methods={"GET"}) - */ public function deleteDevice(Request $request, SalesChannelContext $salesChannelContext): RedirectResponse { if (!$salesChannelContext->getCustomer()) { diff --git a/src/EventListeners/StateMachine/TransitionEventListener.php b/src/EventListeners/StateMachine/TransitionEventListener.php index ddc2277f..e8fd4f2f 100644 --- a/src/EventListeners/StateMachine/TransitionEventListener.php +++ b/src/EventListeners/StateMachine/TransitionEventListener.php @@ -20,8 +20,8 @@ use UnzerPayment6\Components\ConfigReader\ConfigReader; use UnzerPayment6\Components\ConfigReader\ConfigReaderInterface; use UnzerPayment6\Components\Event\AutomaticShippingNotificationEvent; +use UnzerPayment6\Components\PaymentActions\PaymentActionService; use UnzerPayment6\Components\ShipService\ShipServiceInterface; -use UnzerPayment6\Components\UnzerUtil\UnzerTransactionUtil; use UnzerPayment6\Components\Validator\AutomaticShippingValidatorInterface; use UnzerPayment6\Installer\CustomFieldInstaller; @@ -36,7 +36,7 @@ public function __construct( private EventDispatcherInterface $eventDispatcher, private ShipServiceInterface $shipService, private ConfigReaderInterface $configReader, - private UnzerTransactionUtil $unzerTransactionUtil + private PaymentActionService $paymentActionService ) { } @@ -119,7 +119,7 @@ protected function doAutomaticTransactions(StateMachineTransitionEvent $event, ? if (\is_array($autoCaptureStatus) && \in_array($event->getToPlace()->getId(), $autoCaptureStatus, true)) { $this->logger->info(\sprintf('Automatic capture for order [%s] was triggered', $order->getOrderNumber())); try { - $this->unzerTransactionUtil->captureOrder($order, $event->getContext()); + $this->paymentActionService->captureOrder($order, $event->getContext()); } catch (\Throwable $exception) { $this->logger->error(\sprintf('Error while executing automatic capture for order [%s]: %s', $order->getOrderNumber(), $exception->getMessage()), [ 'trace' => $exception->getTraceAsString(), @@ -134,13 +134,28 @@ protected function doAutomaticTransactions(StateMachineTransitionEvent $event, ? if (\is_array($autoRefundStatus) && \in_array($event->getToPlace()->getId(), $autoRefundStatus, true)) { $this->logger->info(\sprintf('Automatic refund for order [%s] was triggered', $order->getOrderNumber())); try { - $this->unzerTransactionUtil->refundOrder($order, $event->getContext()); + $this->paymentActionService->refundOrder($order, $event->getContext()); } catch (\Throwable $exception) { $this->logger->error(\sprintf('Error while executing automatic refund for order [%s]: %s', $order->getOrderNumber(), $exception->getMessage()), [ 'trace' => $exception->getTraceAsString(), ]); } } + + $autoReturnRefundStatus = $config->get(ConfigReader::CONFIG_KEY_DELIVERY_STATUS_FOR_RETURNS_REFUND); + if (\is_scalar($autoReturnRefundStatus)) { + $autoReturnRefundStatus = [$autoReturnRefundStatus]; + } + if (\is_array($autoReturnRefundStatus) && \in_array($event->getToPlace()->getId(), $autoReturnRefundStatus, true)) { + $this->logger->info(\sprintf('Automatic return refund for order [%s] was triggered', $order->getOrderNumber())); + try { + $this->paymentActionService->executeReturnRefunds($order, $event->getContext()); + } catch (\Throwable $exception) { + $this->logger->error(\sprintf('Error while executing automatic return refund for order [%s]: %s', $order->getOrderNumber(), $exception->getMessage()), [ + 'trace' => $exception->getTraceAsString(), + ]); + } + } } protected function setCustomFields( diff --git a/src/Resources/app/administration/src/module/unzer-payment/page/unzer-payment-tab/index.js b/src/Resources/app/administration/src/module/unzer-payment/page/unzer-payment-tab/index.js index 1b8afee3..89c24848 100644 --- a/src/Resources/app/administration/src/module/unzer-payment/page/unzer-payment-tab/index.js +++ b/src/Resources/app/administration/src/module/unzer-payment/page/unzer-payment-tab/index.js @@ -56,6 +56,8 @@ Component.register('unzer-payment-tab', { const orderId = this.$route.params.id; const criteria = new Criteria(); criteria + .addAssociation('currency') + .addAssociation('lineItems.promotion') .getAssociation('transactions') .addSorting(Criteria.sort('createdAt', 'DESC')); diff --git a/src/Resources/app/administration/src/module/unzer-payment/page/unzer-payment-tab/unzer-payment-tab.html.twig b/src/Resources/app/administration/src/module/unzer-payment/page/unzer-payment-tab/unzer-payment-tab.html.twig index b8f97cff..62fc6bea 100644 --- a/src/Resources/app/administration/src/module/unzer-payment/page/unzer-payment-tab/unzer-payment-tab.html.twig +++ b/src/Resources/app/administration/src/module/unzer-payment/page/unzer-payment-tab/unzer-payment-tab.html.twig @@ -11,6 +11,13 @@ @reloadOrderDetails="reloadOrderDetails" > + {% endblock %} {% block unzer_payment_payment_details_content_payment_history %} diff --git a/src/Resources/config/dependencies/controllers.xml b/src/Resources/config/dependencies/controllers.xml index d18138df..76349dc2 100755 --- a/src/Resources/config/dependencies/controllers.xml +++ b/src/Resources/config/dependencies/controllers.xml @@ -29,6 +29,7 @@ + diff --git a/src/Resources/config/dependencies/event_listeners.xml b/src/Resources/config/dependencies/event_listeners.xml index 85ec4232..a7419f3b 100644 --- a/src/Resources/config/dependencies/event_listeners.xml +++ b/src/Resources/config/dependencies/event_listeners.xml @@ -53,7 +53,7 @@ - + diff --git a/src/Resources/config/dependencies/services.xml b/src/Resources/config/dependencies/services.xml index cf3f8d7b..0b6a354a 100644 --- a/src/Resources/config/dependencies/services.xml +++ b/src/Resources/config/dependencies/services.xml @@ -82,9 +82,7 @@ - - @@ -107,7 +105,17 @@ - + + + + + + + + + + + diff --git a/src/Resources/config/settings.xml b/src/Resources/config/settings.xml index 73790cf9..0bc347c3 100755 --- a/src/Resources/config/settings.xml +++ b/src/Resources/config/settings.xml @@ -348,6 +348,15 @@ Leave blank, if you don't want to use automatic refund Leer lassen, um keine automatische Rückzahlung auszulösen + + + deliveryStatusForAutomaticReturnsRefund + state_machine_state + + + only with Shopware Commercial Plugin; Leave blank, if you don't want to use automatic refund + nur mit Shopware Commercial Plugin; Leer lassen, um keine automatische Rückzahlung auszulösen + diff --git a/src/Resources/public/administration/.vite/entrypoints.json b/src/Resources/public/administration/.vite/entrypoints.json index bfb74418..27afd052 100644 --- a/src/Resources/public/administration/.vite/entrypoints.json +++ b/src/Resources/public/administration/.vite/entrypoints.json @@ -7,7 +7,7 @@ ], "dynamic": [], "js": [ - "/bundles/unzerpayment6/administration/assets/unzer-payment6-A0MDUaR-.js" + "/bundles/unzerpayment6/administration/assets/unzer-payment6-BVnPNgB2.js" ], "legacy": false, "preload": [] diff --git a/src/Resources/public/administration/.vite/manifest.json b/src/Resources/public/administration/.vite/manifest.json index f20c0f52..c748b70b 100644 --- a/src/Resources/public/administration/.vite/manifest.json +++ b/src/Resources/public/administration/.vite/manifest.json @@ -1,6 +1,6 @@ { "main.js": { - "file": "assets/unzer-payment6-A0MDUaR-.js", + "file": "assets/unzer-payment6-BVnPNgB2.js", "name": "unzer-payment6", "src": "main.js", "isEntry": true, diff --git a/src/Resources/public/administration/assets/unzer-payment6-A0MDUaR-.js b/src/Resources/public/administration/assets/unzer-payment6-A0MDUaR-.js deleted file mode 100644 index 029f18a5..00000000 --- a/src/Resources/public/administration/assets/unzer-payment6-A0MDUaR-.js +++ /dev/null @@ -1,2 +0,0 @@ -const w=`{% block unzer_payment_actions %} {% block unzer_payment_actions_amount_field %}
{% endblock %}
{% block unzer_payment_actions_charge_button %} {{ $tc('unzer-payment.paymentDetails.actions.chargeButton') }} {% endblock %} {% block unzer_payment_actions_cancel_button %} {{ $tc('unzer-payment.paymentDetails.actions.cancelButton') }} {% endblock %} {% block unzer_payment_actions_reason_field %} {% endblock %} {% block unzer_payment_actions_refund_button %} {{ $tc('unzer-payment.paymentDetails.actions.refundButton') }} {% endblock %} {% block unzer_payment_actions_button_container_inner %}{% endblock %}
{{ $tc('unzer-payment.paymentDetails.actions.noActions') }}
{% endblock %}`,{Component:z,Mixin:C}=Shopware,d={CANCEL:"CANCEL",RETURN:"RETURN",CREDIT:"CREDIT"};z.register("unzer-payment-actions",{template:w,inject:["UnzerPaymentService"],mixins:[C.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,transactionAmount:0,reasonCode:null}},props:{transactionResource:{type:Object,required:!0},paymentResource:{type:Object,required:!0},decimalPrecision:{type:Number,required:!0,default:4}},computed:{isChargePossible:function(){return this.transactionResource.type==="authorization"&&this.transactionResource.state!=="error"},isRefundPossible:function(){return this.transactionResource.type==="charge"&&this.transactionResource.state!=="error"&&!(this.transactionResource.isFirst&&this.paymentResource.paymentMethodId==="085b64d0028a8bd447294e03c4eb411a"&&this.paymentResource.state.name!=="pending"&&this.paymentResource.state.name!=="partly")},maxTransactionAmount(){let e=0,t=this.isRefundPossible&&this.paymentResource.paymentMethodId==="085b64d0028a8bd447294e03c4eb411a";return this.isRefundPossible&&(e=this.transactionResource.amount),this.isChargePossible&&(e=this.paymentResource.amount.remaining),"remainingAmount"in this.transactionResource&&(e=this.transactionResource.remainingAmount),this.transactionResource.isFirst&&t&&(e=this.paymentResource.amount.remaining),e/10**this.paymentResource.amount.decimalPrecision},reasonCodeSelection(){return[{label:this.$tc("unzer-payment.paymentDetails.actions.reason.cancel"),value:d.CANCEL},{label:this.$tc("unzer-payment.paymentDetails.actions.reason.credit"),value:d.CREDIT},{label:this.$tc("unzer-payment.paymentDetails.actions.reason.return"),value:d.RETURN}]}},created(){this.transactionAmount=this.maxTransactionAmount},methods:{charge(){this.isLoading=!0,this.UnzerPaymentService.chargeTransaction(this.paymentResource.orderTransactionId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.chargeSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.chargeSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage")),t==="paylater-invoice-document-required"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.paylaterInvoiceDocumentRequiredErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.chargeErrorTitle"),message:t}),this.isLoading=!1})},refund(){this.isLoading=!0,this.UnzerPaymentService.refundTransaction(this.paymentResource.orderTransactionId,this.transactionResource.id,this.transactionAmount,this.reasonCode).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.refundSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.refundSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.refundErrorTitle"),message:t}),this.isLoading=!1})},startCancel(){this.$emit("cancel",this.transactionAmount)}}});const S=`{% block unzer_payment_detail %}
{% block unzer_payment_detail_container %} {% block unzer_payment_detail_container_left %}
{{ $tc('unzer-payment.paymentDetails.detail.amountRemaining') }}
{{ formatCurrency(remainingAmount) }}
{{ $tc('unzer-payment.paymentDetails.detail.amountCancelled') }}
{{ formatCurrency(cancelledAmount) }}
{{ $tc('unzer-payment.paymentDetails.detail.amountCharged') }}
{{ formatCurrency(chargedAmount) }}
{% block unzer_payment_detail_container_left_inner %}{% endblock %}
{% endblock %} {% block unzer_payment_detail_container_right %}
{{ $tc('unzer-payment.paymentDetails.detail.shortId') }}
{{ paymentResource.shortId }}
{{ $tc('unzer-payment.paymentDetails.detail.id') }}
{{ paymentResource.id }}
{{ $tc('unzer-payment.paymentDetails.detail.state') }}
{{ paymentResource.state.name }}
{{ $tc('unzer-payment.paymentDetails.detail.descriptor') }}
{{ paymentResource.descriptor }}
{% block unzer_payment_detail_container_right_inner %}{% endblock %}
{% endblock %}
{% endblock %}
{% block unzer_payment_detail_footer %} {% endblock %}
{% endblock %}`,{Component:v,Mixin:_,Module:$}=Shopware;v.register("unzer-payment-detail",{template:S,inject:["UnzerPaymentService"],mixins:[_.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,paylaterPaymentMethods:["09588ffee8064f168e909ff31889dd7f","12fbfbce271a43a89b3783453b88e9a6","6d6adcd4b7bf40499873c294a85f32ed"]}},props:{paymentResource:{type:Object,required:!0}},computed:{unzerMaxDigits(){const e=$.getModuleRegistry().get("unzer-payment");return!e||!e.manifest?4:e.manifest.maxDigits},remainingAmount(){return!this.paymentResource||!this.paymentResource.amount?0:this.formatAmount(this.paymentResource.amount.remaining,this.paymentResource.amount.decimalPrecision)},cancelledAmount(){return!this.paymentResource||!this.paymentResource.amount?0:this.formatAmount(this.paymentResource.amount.cancelled,this.paymentResource.amount.decimalPrecision)},chargedAmount(){return!this.paymentResource||!this.paymentResource.amount?0:this.formatAmount(this.paymentResource.amount.charged,this.paymentResource.amount.decimalPrecision)}},methods:{reloadOrderDetail(){this.$emit("reloadOrderDetails")},ship(){this.isLoading=!0,this.UnzerPaymentService.ship(this.paymentResource.orderTransactionId).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.shipSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.shipSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"?t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage"):t==="invoice-missing-error"?t=this.$tc("unzer-payment.paymentDetails.notifications.invoiceNotFoundMessage"):t==="documentdate-missing-error"?t=this.$tc("unzer-payment.paymentDetails.notifications.documentDateMissingError"):t==="payment-missing-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.paymentMissingError")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.shipErrorTitle"),message:t}),this.isLoading=!1})},formatAmount(e,t){return e/10**Math.min(this.unzerMaxDigits,t)},formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)},isPaylaterPaymentMethod(e){return this.paylaterPaymentMethods.indexOf(e)>=0}}});const D=`{% block unzer_payment_history %} {% block unzer_payment_history_container %} {% endblock %} {% endblock %}`,{Component:P,Module:R,Mixin:M}=Shopware;P.register("unzer-payment-history",{template:D,inject:["repositoryFactory","UnzerPaymentService"],mixins:[M.getByName("notification")],data(){return{showCancelModal:!1,isCancelLoading:!1,cancelAmount:0}},props:{paymentResource:{type:Object,required:!0}},computed:{unzerMaxDigits(){const e=R.getModuleRegistry().get("unzer-payment");return!e||!e.manifest?4:e.manifest.maxDigits},orderTransactionRepository:function(){return this.repositoryFactory.create("order_transaction")},decimalPrecision(){return!this.paymentResource||!this.paymentResource.amount||!this.paymentResource.amount.decimalPrecision?this.unzerMaxDigits:Math.min(this.unzerMaxDigits,this.paymentResource.amount.decimalPrecision)},data:function(){const e=[];return Object.values(this.paymentResource.transactions).forEach(t=>{const n=this.formatCurrency(this.formatAmount(parseFloat(t.amount),this.decimalPrecision)),a=Shopware.Filter.getByName("date")(t.date,{hour:"numeric",minute:"numeric",second:"numeric"});e.push({type:this.transactionTypeRenderer(t.type),amount:n,date:a,state:t.state||"",resource:t})}),e},columns:function(){return[{property:"type",label:this.$tc("unzer-payment.paymentDetails.history.column.type"),rawData:!0},{property:"amount",label:this.$tc("unzer-payment.paymentDetails.history.column.amount"),rawData:!0},{property:"date",label:this.$tc("unzer-payment.paymentDetails.history.column.date"),rawData:!0},{property:"state",label:this.$tc("unzer-payment.paymentDetails.history.column.state"),rawData:!0}]}},methods:{transactionTypeRenderer:function(e){switch(e){case"authorization":return this.$tc("unzer-payment.paymentDetails.history.type.authorization");case"charge":return this.$tc("unzer-payment.paymentDetails.history.type.charge");case"shipment":return this.$tc("unzer-payment.paymentDetails.history.type.shipment");case"refund":return this.$tc("unzer-payment.paymentDetails.history.type.refund");case"cancellation":return this.$tc("unzer-payment.paymentDetails.history.type.cancellation");default:return this.$tc("unzer-payment.paymentDetails.history.type.default")}},reload:function(){this.$emit("reload"),this.$emit("reloadOrderDetails")},formatAmount(e,t){return e/10**t},openCancelModal(e,t){this.showCancelModal=e.resource.id,this.cancelAmount=t},closeCancelModal(){this.showCancelModal=!1,this.cancelAmount=0},cancel(){this.isCancelLoading=!0,this.UnzerPaymentService.cancelTransaction(this.paymentResource.orderTransactionId,this.paymentResource.id,this.cancelAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.cancelSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.cancelSuccessMessage")}),this.reload()}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.cancelErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.cancelErrorTitle"),message:t}),this.isCancelLoading=!1,this.reload()})},formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)}}});const E=`{% block unzer_payment_metadata %} {% endblock %}`,{Component:A}=Shopware;A.register("unzer-payment-metadata",{template:E,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){const e=[];return this.paymentResource.metadata.forEach(t=>{e.push({key:t.key,value:t.value})}),e},columns:function(){return[{property:"key",label:this.$tc("unzer-payment.paymentDetails.metadata.column.key"),rawData:!0},{property:"value",label:this.$tc("unzer-payment.paymentDetails.metadata.column.value"),rawData:!0}]}}});const I=`{% block unzer_payment_basket %} {% endblock %}`,{Component:T}=Shopware;T.register("unzer-payment-basket",{template:I,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){const e=[];return this.paymentResource.basket.basketItems.forEach(t=>{let n=this.formatCurrency(parseFloat(t.amountGross.toFixed(2))),a=this.formatCurrency(parseFloat(t.amountNet.toFixed(2)));t.amountDiscount>0&&(n=this.formatCurrency(parseFloat(t.amountDiscount.toFixed(2))*-1),a=this.formatCurrency(parseFloat((t.amountDiscount-t.amountVat).toFixed(2))*-1)),e.push({quantity:t.quantity,title:t.title,amountGross:n,amountNet:a})}),e},columns:function(){return[{property:"quantity",label:this.$tc("unzer-payment.paymentDetails.basket.column.quantity"),rawData:!0},{property:"title",label:this.$tc("unzer-payment.paymentDetails.basket.column.title"),rawData:!0},{property:"amountGross",label:this.$tc("unzer-payment.paymentDetails.basket.column.amountGross"),rawData:!0},{property:"amountNet",label:this.$tc("unzer-payment.paymentDetails.basket.column.amountNet"),rawData:!0}]}},methods:{formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)}}});const B=`{% block sw_order_create_details_footer_payment_method %} {% endblock %}`,{Criteria:c}=Shopware.Data,x=["bc4c2cbfb5fda0bf549e4807440d0a54","4673044aff79424a938d42e9847693c3","713c7a332b432dcd4092701eda522a7e","5123af5ce94a4a286641973e8de7eb60","17830aa7e6a00b99eab27f0e45ac5e0d","4ebb99451f36ba01f13d5871a30bce2c","d4b90a17af62c1bb2f6c3b1fed339425","4b9f8d08b46a83839fd0eb14fe00efe6","08fb8d9a72ab4ca62b811e74f2eca79f","6cc3b56ce9b0f80bd44039c047282a41","614ad722a03ee96baa2446793143215b","409fe641d6d62a4416edd6307d758791","085b64d0028a8bd447294e03c4eb411a","cd6f59d572e6c90dff77a48ce16b44db","fd96d03535a46d197f5adac17c9f8bac","09588ffee8064f168e909ff31889dd7f"];Shopware.Component.override("sw-order-create-details-footer",{template:B,computed:{paymentMethodCriteria(){const e=new c;return this.salesChannelId&&e.addFilter(c.equals("salesChannels.id",this.salesChannelId)),e.addFilter(c.not("AND",[c.equalsAny("id",x)])),e}}});const K=`{% block sw_order_detail_content_tabs_general %} {% parent() %} {% block unzer_payment_payment_tab %} {{ $tc('unzer-payment.tabTitle') }} {% endblock %} {% endblock %}`,{Component:L,Context:F}=Shopware,{Criteria:W}=Shopware.Data;L.override("sw-order-detail",{template:K,data(){return{isUnzerPayment:!1}},computed:{showTabs(){return!0}},watch:{orderId:{deep:!0,handler(){if(!this.orderId){this.isUnzerPayment=!1;return}const e=this.repositoryFactory.create("order"),t=new W(1,1);t.addAssociation("transactions"),e.get(this.orderId,F.api,t).then(n=>{n.transactions.forEach(a=>{a.customFields&&(!a.customFields.unzer_payment_is_transaction&&!a.customFields.heidelpay_is_transaction||(this.isUnzerPayment=!0))})})},immediate:!0}}});const U='{% block sw_order_list_grid_columns %} {% parent() %} {% block unzer_payment_column_transaction %} {% endblock %} {% endblock %}';Shopware.Component.override("sw-order-list",{template:U,methods:{getOrderColumns(){const e=this.$super("getOrderColumns");return e.splice(1,0,{property:"unzerPaymentTransactionId",label:"unzer-payment.order-list.transactionId",allowResize:!0}),e}}});const N='{% block unzer_payment_payment_details %}
{% block unzer_payment_payment_details_content %} {% endblock %}
{% endblock %}',{Component:G,Context:O,Mixin:q}=Shopware,{Criteria:u}=Shopware.Data;G.register("unzer-payment-tab",{template:N,inject:["UnzerPaymentService","repositoryFactory"],mixins:[q.getByName("notification")],data(){return{paymentResources:[],loadedResources:0,isLoading:!0,order:null}},created(){this.createdComponent()},computed:{orderRepository(){return this.repositoryFactory.create("order")}},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},methods:{createdComponent(){this.loadData()},resetDataAttributes(){this.paymentResources=[],this.loadedResources=0,this.isLoading=!0},reloadPaymentDetails(){this.resetDataAttributes(),this.loadData()},loadData(){const e=this.$route.params.id,t=new u;t.getAssociation("transactions").addSorting(u.sort("createdAt","DESC")),this.orderRepository.get(e,O.api,t).then(n=>{this.order=n,n.transactions&&n.transactions.forEach((a,s)=>{if(!a.customFields){this.loadedResources++;return}if(!a.customFields.unzer_payment_is_transaction&&!a.customFields.heidelpay_is_transaction){this.loadedResources++;return}this.UnzerPaymentService.fetchPaymentDetails(a.id).then(i=>{this.paymentResources[s]=i,this.paymentResources[s].orderTransactionId=a.id,this.loadedResources++,this.isLoading=this.order.transactions.length!==this.loadedResources}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage"),message:this.$tc("unzer-payment.paymentDetails.notifications.couldNotRetrieveMessage")}),this.isLoading=!1})})})},reloadOrderDetails(){setTimeout(()=>{this.findOrderDetailComponentAndReInit()},5e3)},async findOrderDetailComponentAndReInit(e=this){const t="sw-order-detail",n=e.$parent;if(n===void 0)return null;if(n.$options.name!==t)return this.findOrderDetailComponentAndReInit(n);if(n.isOrderEditing)return null;n.createdComponent()}}});const{Module:H}=Shopware;H.register("unzer-payment",{type:"plugin",name:"UnzerPayment",title:"unzer-payment.general.title",description:"unzer-payment.general.descriptionTextModule",version:"0.0.1",targetVersion:"0.0.1",maxDigits:4,routeMiddleware(e,t){t.name==="sw.order.detail"&&t.children.push({component:"unzer-payment-tab",name:"unzer-payment.payment.detail",path:"/sw/order/detail/:id/unzer-payment",isChildren:!0,meta:{parentPath:"sw.order.index"}}),e(t)}});const j=`{% block unzer_payment_payment_register_webhook %}
{% block unzer_payment_payment_register_webhook_button %} {{ $tc('unzer-payment-settings.form.webhookButton') }} {% endblock %} {% block unzer_payment_payment_register_webhook_modal %} {% endblock %}
{% endblock %}`,l=Shopware.Data.Criteria;Shopware.Component.register("unzer-payment-register-webhook",{template:j,mixins:[Shopware.Mixin.getByName("notification")],inject:["repositoryFactory","UnzerPaymentConfigurationService"],props:{webhooks:{type:Array,required:!0},isLoading:{type:Boolean,required:!1},selectedSalesChannelId:{type:String,required:!1},privateKey:{type:String,required:!0},isDisabled:{type:Boolean,required:!1}},computed:{salesChannelRepository(){return this.repositoryFactory.create("sales_channel")}},data(){return{isModalActive:!1,isRegistering:!1,isRegistrationSuccessful:!1,isDataLoading:!1,selection:{},selectedDomain:null,entitySelection:{},salesChannels:{}}},created(){this.createdComponent()},methods:{createdComponent(){this.loadData()},loadData(e,t){let n=this;this.isDataLoading=!0;let a=new l(e,t);a.addAssociation("domains"),this.salesChannelRepository.search(a,Shopware.Context.api).then(s=>{n.salesChannels=s,n.isDataLoading=!1})},onPageChange(e){this.loadData(e.page,e.limit)},openModal(){this.$emit("modal-open"),this.isModalActive=!0},closeModal(){this.isModalActive=!1},registerWebhooks(){const e=this;this.isRegistrationSuccessful=!1,this.isRegistering=!0,this.UnzerPaymentConfigurationService.registerWebhooks({selection:this.entitySelection}).then(t=>{e.isRegistrationSuccessful=!0,t!==void 0&&e.messageGeneration(t),this.$emit("webhook-registered",t)}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.webhook.globalError.title"),message:this.$tc("unzer-payment-settings.webhook.globalError.message")})}).finally(()=>{e.isRegistering=!1})},onRegistrationFinished(){this.isRegistrationSuccessful=!1,this.selection={}},onSelectItem(e,t){t&&(t.privateKey=this.privateKey,this.entitySelection[t.salesChannelId]=t)},messageGeneration(e){const t=e.length;Object.keys(e).forEach(n=>{e[n].success?this.createNotificationSuccess({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n})})},isWebhookRegisteredForSalesChannel(e){let t=!1;const n=this.getSalesChannelById(e);return this.webhooks.length?(n.domains.forEach(a=>{this.webhooks.forEach(s=>{if(s.url.indexOf(a.url)>-1)return t=!0,!0})}),t):!1},getSalesChannelById(e){let t=null;return this.salesChannels.forEach(n=>{if(n.id===e)return t=n,!0}),t},getSalesChannelDomainCriteria(e){let t=new l;return t.addFilter(l.prefix("url","https://")),t.addFilter(l.equals("salesChannelId",e)),t}}});const V=` {{ $tc('unzer-payment-settings.webhook.empty') }}
{{ $tc('unzer-payment-settings.modal.webhook.submit.clear', webhookSelectionLength, {count: webhookSelectionLength}) }}
`,{Component:Z,Mixin:J,Context:ye}=Shopware;Z.register("unzer-webhooks-modal",{template:V,mixins:[J.getByName("notification")],inject:["UnzerPaymentConfigurationService"],props:{keyPair:{type:Array,required:!0},webhooks:{type:Array,required:!0},isLoadingWebhooks:{type:Boolean}},data(){return{isClearing:!1,isClearingSuccessful:!1,webhookSelection:null,webhookSelectionLength:0}},computed:{webhookColumns(){return[{property:"event",dataIndex:"event",label:"Event"},{property:"url",dataIndex:"url",label:"URL"}]}},methods:{clearWebhooks(e){const t=this;this.isClearingSuccessful=!1,this.isClearing=!0,this.isLoading=!0,this.UnzerPaymentConfigurationService.clearWebhooks({privateKey:e,selection:this.webhookSelection}).then(n=>{t.isClearingSuccessful=!0,t.webhookSelection=[],t.webhookSelectionLength=0,t.$refs.webhookDataGrid.resetSelection(),t.$emit("load-webhooks",e),n!==void 0&&t.messageGeneration(n)}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.webhook.globalError.title"),message:this.$tc("unzer-payment-settings.webhook.globalError.message")})}).finally(()=>{t.isLoading=!1,t.isClearing=!1})},onClearingFinished(){this.isClearingSuccessful=!1,this.isClearing=!1},onSelectWebhook(e){this.webhookSelectionLength=Object.keys(e).length,this.webhookSelection=e},messageGeneration(e){const t=e.length;Object.keys(e).forEach(n=>{e[n].success?this.createNotificationSuccess({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n})})}}});const{Component:Q}=Shopware,{Criteria:m}=Shopware.Data;Q.extend("unzer-entity-single-select-delivery-status","sw-entity-single-select",{props:{criteria:{type:Object,required:!1,default(){const e=new m(1,100);return e.addFilter(m.equals("stateMachine.technicalName","order_delivery.state")),e}}}});const{Component:Y,Service:X}=Shopware,{Criteria:h,EntityCollection:ge}=Shopware.Data;Y.extend("unzer-entity-multi-select-delivery-status","sw-entity-multi-id-select",{props:{repository:{type:Object,required:!0,default(){return X("repositoryFactory").create("state_machine_state")}},criteria:{type:Object,required:!1,default(){const e=new h(1,100);return e.addFilter(h.equals("stateMachine.technicalName","order_delivery.state")),e}}}});const ee=` `,{Component:te}=Shopware;te.register("unzer-google-pay-gateway-merchant-id",{template:ee,inject:["UnzerPaymentConfigurationService"],data(){return{readOnlyUnzerGooglePayGatewayMerchantId:""}},props:{currentSalesChannelId:{type:String,required:!0}},watch:{currentSalesChannelId(){this.getUnzerGooglePayGatewayMerchantId()}},created(){this.getUnzerGooglePayGatewayMerchantId(),document.addEventListener("unzer-settings-saved",this.getUnzerGooglePayGatewayMerchantId)},methods:{getUnzerGooglePayGatewayMerchantId(){console.log("get",this.currentSalesChannelId),this.UnzerPaymentConfigurationService.getGooglePayGatewayMerchantId(this.currentSalesChannelId).then(e=>{this.readOnlyUnzerGooglePayGatewayMerchantId=e.gatewayMerchantId}).catch(()=>{})}}});const ne=`{% block unzer_plugin_icon %} {% endblock %}`,{Component:ae}=Shopware;ae.register("unzer-payment-plugin-icon",{template:ne,computed:{assetFilter(){return Shopware.Filter.getByName("asset")}}});const se='{% block unzer_settings_subheading %}
{{ label }}
{% endblock %}',{Component:ie}=Shopware;ie.register("unzer-settings-subheading",{template:se,computed:{label(){const e=this.$attrs.name.split("."),t=e[e.length-1];return this.$tc("unzer-payment-settings.subheadings."+t)}}});const{Component:re}=Shopware;re.override("sw-system-config",{watch:{currentSalesChannelId(){this.$emit("sales-channel-changed",this.actualConfigData[this.currentSalesChannelId],this.currentSalesChannelId)}}});const oe=`{% block unzer_payment_settings %} {% block unzer_payment_settings_header %} {% endblock %} {% block unzer_payment_settings_actions %} {% endblock %} {% block unzer_payment_settings_content %} {% endblock %} {% endblock %}`,{Component:ce,Mixin:p,Context:le}=Shopware;ce.register("unzer-payment-settings",{template:oe,mixins:[p.getByName("notification"),p.getByName("sw-inline-snippet")],inject:["repositoryFactory","UnzerPaymentConfigurationService"],data(){return{isLoading:!0,isLoadingWebhooks:!0,isAdditionalKeysExpanded:!1,selectedKeyPairForTesting:!1,isTestSuccessful:!1,isSaveSuccessful:!1,config:{},webhooks:[],loadedWebhooksPrivateKey:!1,selectedSalesChannelId:null,keyPairSettings:[{key:"b2b-eur",group:"paylaterInvoice"},{key:"b2b-chf",group:"paylaterInvoice"},{key:"b2c-eur",group:"paylaterInvoice"},{key:"b2c-chf",group:"paylaterInvoice"},{key:"b2c-eur",group:"paylaterInstallment"},{key:"b2c-chf",group:"paylaterInstallment"},{key:"b2c-eur",group:"paylaterDirectDebitSecured"}],openModalKeyPair:null}},metaInfo(){return{title:"UnzerPayment"}},computed:{paymentMethodRepository(){return this.repositoryFactory.create("payment_method")},arrowIconName(){return le.app.config.version.match(/((\d+)\.?(\d+?)\.?(\d+)?\.?(\d*))-?([A-z]+?\d+)?/i)[3]>=5?"regular-chevron-right-xs":"small-arrow-medium-right"},defaultKeyPair(){return{privateKey:this.getConfigValue("privateKey"),publicKey:this.getConfigValue("publicKey")}}},watch:{openModalKeyPair(e){e&&e.privateKey!==this.loadedWebhooksPrivateKey&&this.loadWebhooks(e.privateKey)}},methods:{getConfigValue(e){if(!this.config||!this.$refs.systemConfig||!this.$refs.systemConfig.actualConfigData||!this.$refs.systemConfig.actualConfigData.null)return"";const t=this.$refs.systemConfig.actualConfigData.null;return this.config[`UnzerPayment6.settings.${e}`]||t[`UnzerPayment6.settings.${e}`]},onValidateCredentials(e){this.isTestSuccessful=!1,this.selectedKeyPairForTesting=e;const t=this.getArrayKeyOfKeyPairSetting(e);let n=e;t!==-1&&(n=this.keyPairSettings[t]);const a={publicKey:n.publicKey,privateKey:n.privateKey,salesChannel:this.$refs.systemConfig.currentSalesChannelId};this.UnzerPaymentConfigurationService.validateCredentials(a).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment-settings.form.message.success.title"),message:this.$tc("unzer-payment-settings.form.message.success.message")}),this.isTestSuccessful=!0,this.selectedKeyPairForTesting=!1}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.form.message.error.title"),message:this.$tc("unzer-payment-settings.form.message.error.message")}),this.onTestFinished()})},onTestFinished(){this.selectedKeyPairForTesting=!1,this.isTestSuccessful=!1},getArrayKeyOfKeyPairSetting(e){return this.keyPairSettings.findIndex(t=>t.key===e.key&&t.group===e.group)},onSave(){this.isLoading=!0,["paylaterInvoice","paylaterInstallment","paylaterDirectDebitSecured"].forEach(e=>{this.config[`UnzerPayment6.settings.${e}`]=[]}),this.keyPairSettings.reduce((e,t)=>(!t||!t.privateKey||!t.publicKey||e[`UnzerPayment6.settings.${t.group}`].push(t),e),this.config),this.$refs.systemConfig.saveAll().then(()=>{this.isSaveSuccessful=!0;let e=this.$tc("sw-plugin-config.messageSaveSuccess");e==="sw-plugin-config.messageSaveSuccess"&&(e=this.$tc("sw-extension-store.component.sw-extension-config.messageSaveSuccess")),this.createNotificationSuccess({title:this.$tc("global.default.success"),message:e}),document.dispatchEvent(new CustomEvent("unzer-settings-saved",{}))}).catch(e=>{this.isSaveSuccessful=!1,this.createNotificationError({title:this.$tc("global.default.error"),message:e}),this.isLoading=!1})},onConfigChange(e){this.config=e,this.isLoading=!1,this.syncKeyPairConfig()},onLoadingChanged(e){this.isLoading=e},onSalesChannelChanged(e,t){e&&this.onConfigChange(e),this.selectedSalesChannelId=t},onWebhookRegistered(e){this.loadWebhooks(e)},loadWebhooks(e){this.isLoadingWebhooks=!0,this.UnzerPaymentConfigurationService.getWebhooks(e).then(t=>{this.webhooks=t,this.webhookSelection=null,this.webhookSelectionLength=0,this.loadedWebhooksPrivateKey=e}).catch(()=>{this.webhooks=[],this.loadedWebhooksPrivateKey=!1}).finally(()=>{this.isLoadingWebhooks=!1,this.isClearingSuccessful=!1})},getBind(e,t){let n;return t!==this.config&&(this.config=t),this.$refs.systemConfig.config.forEach(a=>{a.elements.forEach(s=>{if(s.name===e.name){n=s;return}})}),n||e},keyPairSettingTitle(e){return this.$tc(`unzer-payment.methods.${e.group}.${e.key}`)},keyPairSettingGroupTitle(e){return this.$tc(`unzer-payment.methods.${e.group}.main`)},isShowWebhooksButtonEnabled(e){return e&&e.privateKey&&e.publicKey},isRegisterWebhooksButtonEnabled(e){return!this.isLoading&&e&&e.privateKey},syncKeyPairConfig(){const e=this;["paylaterInvoice","paylaterInstallment","paylaterDirectDebitSecured"].forEach(t=>{this.config[`UnzerPayment6.settings.${t}`]&&this.config[`UnzerPayment6.settings.${t}`].forEach(n=>{e.keyPairSettings.forEach((a,s,i)=>{a.group===n.group&&a.key===n.key&&(i[s]=n)})})})},toggleAdditionalKeys(){this.isAdditionalKeysExpanded=!this.isAdditionalKeysExpanded}}});const f={"unzer-payment":{tabTitle:"Unzer Payment",paymentDetails:{history:{cardTitle:"Zahlungsverlauf",column:{type:"Typ",amount:"Betrag",date:"Datum",state:"Status"},type:{authorization:"Reservierung",charge:"Einzug",shipment:"Versandmitteilung",refund:"Rückerstattung",cancellation:"Stornierung",default:""}},actions:{reason:{placeholder:"Grund",cancel:"Abgebrochen",credit:"Gutschrift",return:"Rückgabe"},chargeButton:"Einziehen",shipButton:"Versandmitteilung",refundButton:"Rückerstatten",defaultButton:"Erledigt",cancelButton:"Stornieren",noActions:"Keine Aktionen möglich",confirmCancelModal:{text:"Möchten Sie wirklich die Reservierung über den angegebenen Betrag stornieren?",amountLabel:"Betrag:",yesButton:"Ja",noButton:"Nein"}},detail:{cardTitle:"Zahlungsdetails",shortId:"Short-ID",id:"Zahlungs-ID",state:"Status",amountRemaining:"Betrag (Rest)",amountCancelled:"Betrag (Rückerstattet)",amountCharged:"Betrag (Eingezogen)",descriptor:"Verwendungszweck"},metadata:{cardTitle:"Metadaten",column:{key:"Schlüssel",value:"Wert"}},basket:{cardTitle:"Warenkorb",column:{quantity:"Anzahl",title:"Titel",amountGross:"Betrag (brutto)",amountNet:"Betrag (netto)"}},notifications:{genericErrorMessage:"Es ist ein Fehler aufgetreten!",refundSuccessTitle:"Rückerstatten",refundSuccessMessage:"Die Rückerstattung wurde erfolgreich durchgeführt.",refundErrorTitle:"Rückerstatten",chargeSuccessTitle:"Einziehen",chargeSuccessMessage:"Das Einziehen der Zahlung wurde erfolgreich durchgeführt.",chargeErrorTitle:"Einziehen",shipSuccessTitle:"Versandmitteilung",shipSuccessMessage:"Die Versandmitteilung wurde erfolgreich gesendet.",shipErrorTitle:"Versandmitteilung",invoiceNotFoundMessage:"Zu dieser Bestellung wurde keine Rechnung gefunden",couldNotRetrieveMessage:"Die Zahlungsdetails konnten nicht abgerufen werden, bitte prüfen Sie die Logdateien für weitere Informationen.",documentDateMissingError:"Das Datum der Rechnung ist leer.",paymentMissingError:"Die Zahlung konnte nicht gefunden werden",paylaterInvoiceDocumentRequiredErrorMessage:"Bitte erstellen oder hinterlegen Sie zunächst eine Rechnung für die Bestellung.",cancelSuccessTitle:"Stornierung",cancelErrorTitle:"Stornierung",cancelSuccessMessage:"Die Stornierung wurde erfolgreich durchgeführt.",cancelErrorMessage:"Die Stornierung konnte nicht durchgeführt werden."}},"order-list":{transactionId:"Unzer Transaktions ID"},methods:{paylaterInvoice:{main:"Rechnungskauf","b2b-eur":"Rechnungskauf B2B EUR","b2b-chf":"Rechnungskauf B2B CHF","b2c-eur":"Rechnungskauf B2C EUR","b2c-chf":"Rechnungskauf B2C CHF"},paylaterInstallment:{main:"Ratenkauf","b2c-eur":"Ratenkauf B2C EUR","b2c-chf":"Ratenkauf B2C CHF"},paylaterDirectDebitSecured:{main:"Lastschrift","b2c-eur":"Lastschrift B2C EUR"}}},"unzer-payment-settings":{subheadings:{paymentSettingsBookingModes:"Buchungsmodus",paymentSettingsSaveDevices:"Zahlungsmittel speichern",paymentSettingsExpressCheckout:"Express Checkout"},module:{title:"Unzer Payment",description:"Unzer Payment"},"google-pay":{gatewayMerchantId:"Gateway Händler ID"},form:{message:{success:{title:"Test erfolgreich",message:"Die angegebenen API-Zugangsdaten sind korrekt!"},error:{title:"Test fehlgeschlagen",message:"Die angegebenen API-Zugangsdaten sind nicht korrekt! Bitte korrigieren Sie die Eingabe und versuchen Sie es erneut."}},testButton:"API Zugangsdaten testen",webhookButton:"Webhooks registrieren",privateKey:"Private Key",publicKey:"Public Key",additionalKeys:"API Keys für weitere Zahlungsarten",additionalKeysHelpText:"Wenn die Felder für zusätzliche Schlüsselpaare leer sind, werden standardmäßig die Hauptschlüsselpaare übernommen."},modal:{close:"Schließen",webhook:{title:"Webhooks",httpsInfo:"Es kann nur eine HTTPS-Domain pro Verkaufskanal registriert werden.",registered:"Webhook ist bereits registriert",placeholder:"Bitte wählen Sie eine Domain aus",submit:{register:"Webhooks registrieren",clear:"Webhooks auswählen | Ausgewählten Webhook entfernen | Entferne {count} Webhooks"}}},webhook:{messagePrefix:"Domain: ",register:{done:"Webhook registriert | Webhooks registriert",error:"Der Webhook konnte nicht registriert werden | Die Webhooks konnten nicht registriert werden"},clear:{done:"Webhook entfernt | Webhooks entfernt",error:"Der Webhook konnte nicht entfernt werden | Die Webhooks konnten nicht entfernt werden"},missing:{fields:"Nicht alle benötigten Felder sind vorhanden",context:"Der Kontext konnte nicht aktualisiert werden",selection:"Es wurden keine Domains selektiert"},notFound:{salesChannelDomain:"Die spezifizierte Domain wurde nicht gefunden"},globalError:{title:"Ein Fehler ist aufgetreten",message:"Bitte kontaktieren sie uns für mehr Informationen"},empty:"Für diesen Private Key sind keine Webhooks registriert. Bitte prüfen Sie ob dieser valide ist und ob Konfigurationen für dedizierte Verkaufskanäle vorgenommen wurden.",show:"Webhooks anzeigen"}},"sw-payment-card":{deprecated:"Veraltet"}},b={"unzer-payment":{tabTitle:"Unzer Payment",paymentDetails:{history:{cardTitle:"Payment History",column:{type:"Type",amount:"Amount",date:"Date",state:"State"},type:{authorization:"Authorization",charge:"Charging",shipment:"Shipping notification",refund:"Refund",cancellation:"Cancel",default:""}},actions:{reason:{placeholder:"Reason",cancel:"Cancel",credit:"Credit",return:"Return"},chargeButton:"Charge",shipButton:"Shipping notice",refundButton:"Refund",defaultButton:"Done",cancelButton:"Cancel",noActions:"No actions possible",confirmCancelModal:{text:"Do you really want to cancel the authorization of the selected amount?",amountLabel:"Amount:",yesButton:"Yes",noButton:"No"}},detail:{cardTitle:"Payment Details",shortId:"Short-ID",id:"Payment-ID",state:"State",amountRemaining:"Amount (Remaining)",amountCancelled:"Amount (Cancelled)",amountCharged:"Amount (Charged)",descriptor:"Descriptor"},metadata:{cardTitle:"Metadata",column:{key:"Key",value:"Value"}},basket:{cardTitle:"Basket",column:{quantity:"Quantity",title:"Title",amountGross:"Amount (gross)",amountNet:"Amount (net)"}},notifications:{genericErrorMessage:"An error has occurred!",refundSuccessTitle:"Refund",refundSuccessMessage:"The reimbursement was successfully completed.",refundErrorTitle:"Refund",chargeSuccessTitle:"Charge",chargeSuccessMessage:"The collection of the payment was carried out successfully.",chargeErrorTitle:"Charge",shipSuccessTitle:"Shipping notice",shipSuccessMessage:"The shipping notification was successfully sent.",shipErrorTitle:"Shipping notice",invoiceNotFoundMessage:"No invoice was found for this order.",couldNotRetrieveMessage:"The payment details could not be retrieved, please check the log files for more information.",documentDateMissingError:"Document date for invoice is empty.",paymentMissingError:"Payment could not be found",paylaterInvoiceDocumentRequiredErrorMessage:"Please create or upload an invoice for the order first.",cancelSuccessTitle:"Cancel",cancelErrorTitle:"Cancel",cancelSuccessMessage:"The reversal was successfully completed.",cancelErrorMessage:"The reversal could not be performed."}},"order-list":{transactionId:"Unzer transaction ID"},methods:{paylaterInvoice:{main:"Invoice","b2b-eur":"Invoice B2B EUR","b2b-chf":"Invoice B2B CHF","b2c-eur":"Invoice B2C EUR","b2c-chf":"Invoice B2C CHF"},paylaterInstallment:{main:"Installment","b2c-eur":"Installment B2C EUR","b2c-chf":"Installment B2C CHF"},paylaterDirectDebitSecured:{main:"Direct Debit","b2c-eur":"Direct Debit B2C EUR"}}},"unzer-payment-settings":{subheadings:{paymentSettingsBookingModes:"Booking Modes",paymentSettingsSaveDevices:"Save Payment Details",paymentSettingsExpressCheckout:"Express Checkout"},module:{title:"Unzer Payment",description:"Unzer Payment"},"google-pay":{gatewayMerchantId:"Gateway Merchant ID"},form:{message:{success:{title:"Test succeeded",message:"The provided credentials are valid!"},error:{title:"Test failed",message:"API Credentials are invalid, please correct them and try again!"}},testButton:"Test API credentials",webhookButton:"Register webhooks",privateKey:"Private Key",publicKey:"Public Key",additionalKeys:"API Keys for additional payment methods",additionalKeysHelpText:"If additional keypairs fields are empty, main keypairs will be inherited by default."},modal:{close:"Close",webhook:{title:"Webhooks",httpsInfo:"Only one HTTPS domain per sales channel can be registered.",registered:"Webhook is already registered",placeholder:"Please select a domain",submit:{register:"Register webhooks",clear:"Select items to clear | Clear selected webhook | Clear {count} webhooks"}}},webhook:{messagePrefix:"Domain: ",register:{done:"Webhook registered | Webhooks registered",error:"Webhook could not be registered | Webhooks could not be registered"},clear:{done:"Webhook cleared | Webhooks cleared",error:"Webhook could not be cleared | Webhooks could not be cleared"},missing:{fields:"Some mandatory fields are missing",context:"The context could not be refreshed",selection:"No domain was selected"},notFound:{salesChannelDomain:"The selected domain could not be found"},globalError:{title:"An error has occurred!",message:"Please contact us for more information"},empty:"There are no webhooks registered for this private key. Make sure the private key is valid and check for other specific sales channel configurations.",show:"Show webhooks"}},"sw-payment-card":{deprecated:"Deprecated"}},{Module:de}=Shopware,ue={type:"plugin",name:"UnzerPayment",title:"unzer-payment-settings.module.title",description:"unzer-payment-settings.module.description",version:"1.1.0",targetVersion:"1.1.0",snippets:{"de-DE":f,"en-GB":b},routes:{settings:{component:"unzer-payment-settings",path:"settings",meta:{parentPath:"sw.settings.index"}}},extensionEntryRoute:{extensionName:"UnzerPayment6",route:"unzer.payment.configuration.settings"},settingsItem:{name:"unzer-payment-configuration",to:"unzer.payment.configuration.settings",label:"unzer-payment-settings.module.title",group:"plugins",iconComponent:"unzer-payment-plugin-icon",backgroundEnabled:!1}};de.register("unzer-payment-configuration",ue);const{Application:y}=Shopware,r=Shopware.Classes.ApiService;class me extends r{constructor(t,n,a="unzer-payment"){super(t,n,a)}fetchPaymentDetails(t){const n=`_action/${this.getApiBasePath()}/transaction/${t}/details`;return this.httpClient.get(n,{headers:this.getBasicHeaders()}).then(a=>r.handleResponse(a))}chargeTransaction(t,n,a){const s=`_action/${this.getApiBasePath()}/transaction/${t}/charge/${a}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(i=>r.handleResponse(i))}refundTransaction(t,n,a,s=null){let i=`_action/${this.getApiBasePath()}/transaction/${t}/refund/${n}/${a}`;return s!==null&&(i=`${i}/${s}`),this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(k=>r.handleResponse(k))}cancelTransaction(t,n,a){const s=`_action/${this.getApiBasePath()}/transaction/${t}/cancel/${n}/${a}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(i=>r.handleResponse(i))}ship(t){const n=`_action/${this.getApiBasePath()}/transaction/${t}/ship`;return this.httpClient.get(n,{headers:this.getBasicHeaders()}).then(a=>r.handleResponse(a))}}y.addServiceProvider("UnzerPaymentService",e=>{const t=y.getContainer("init");return new me(t.httpClient,e.loginService)});const{Application:g}=Shopware,o=Shopware.Classes.ApiService;class he extends o{constructor(t,n,a="unzer-payment"){super(t,n,a)}validateCredentials(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/validate-credentials`,t,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}registerWebhooks(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/register-webhooks`,t,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}clearWebhooks(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/clear-webhooks`,t,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}getWebhooks(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/get-webhooks`,{privateKey:t},{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}getGooglePayGatewayMerchantId(t){return this.httpClient.get(`_action/${this.getApiBasePath()}/get-google-pay-gateway-merchant-id?salesChannelId=${t||""}`,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}}g.addServiceProvider("UnzerPaymentConfigurationService",e=>{const t=g.getContainer("init");return new he(t.httpClient,e.loginService)});const pe=`{% block sw_payment_card_description %}
{{ $tc('sw-payment-card.deprecated') }}
{% endblock %}`;Shopware.Component.override("sw-payment-card",{template:pe,snippets:{"de-DE":f,"en-GB":b}}); -//# sourceMappingURL=unzer-payment6-A0MDUaR-.js.map diff --git a/src/Resources/public/administration/assets/unzer-payment6-A0MDUaR-.js.map b/src/Resources/public/administration/assets/unzer-payment6-A0MDUaR-.js.map deleted file mode 100644 index 400ab0a7..00000000 --- a/src/Resources/public/administration/assets/unzer-payment6-A0MDUaR-.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unzer-payment6-A0MDUaR-.js","sources":["../../../app/administration/src/module/unzer-payment/component/unzer-payment-actions/unzer-payment-actions.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-actions/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-detail/unzer-payment-detail.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-detail/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-history/unzer-payment-history.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-history/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-metadata/unzer-payment-metadata.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-metadata/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-basket/unzer-payment-basket.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-basket/index.js","../../../app/administration/src/module/unzer-payment/extension/sw-order-create-details-footer/sw-order-create-details-footer.html.twig","../../../app/administration/src/module/unzer-payment/extension/sw-order-create-details-footer/index.js","../../../app/administration/src/module/unzer-payment/extension/sw-order-detail/sw-order-detail.html.twig","../../../app/administration/src/module/unzer-payment/extension/sw-order-detail/index.js","../../../app/administration/src/module/unzer-payment/extension/sw-order-list/sw-order-list.html.twig","../../../app/administration/src/module/unzer-payment/extension/sw-order-list/index.js","../../../app/administration/src/module/unzer-payment/page/unzer-payment-tab/unzer-payment-tab.html.twig","../../../app/administration/src/module/unzer-payment/page/unzer-payment-tab/index.js","../../../app/administration/src/module/unzer-payment/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/register-webhook/register-webhook.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/register-webhook/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-webhooks-modal/unzer-webhooks-modal.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-webhooks-modal/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-entity-single-select-delivery-status/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-entity-multi-select-delivery-status/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-google-pay-gateway-merchant-id/unzer-google-pay-gateway-merchant-id.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-google-pay-gateway-merchant-id/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-payment-plugin-icon/unzer-payment-plugin-icon.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-payment-plugin-icon/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-settings-subheading/unzer-settings-subheading.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-settings-subheading/index.js","../../../app/administration/src/module/unzer-payment-configuration/extension/sw-system-config/index.js","../../../app/administration/src/module/unzer-payment-configuration/page/unzer-payment-settings/unzer-payment-settings.html.twig","../../../app/administration/src/module/unzer-payment-configuration/page/unzer-payment-settings/index.js","../../../app/administration/src/module/unzer-payment-configuration/index.js","../../../app/administration/src/api/unzer-payment.service.js","../../../app/administration/src/api/unzer-payment-configuration.service.js","../../../app/administration/src/extension/sw-payment-card/sw-payment-card.html.twig","../../../app/administration/src/extension/sw-payment-card/index.js"],"sourcesContent":["{% block unzer_payment_actions %}\n \n {% block unzer_payment_actions_amount_field %}\n
\n \n \n
\n {% endblock %}\n
\n \n {% block unzer_payment_actions_charge_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.chargeButton') }}\n \n {% endblock %}\n\n {% block unzer_payment_actions_cancel_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.cancelButton') }}\n \n {% endblock %}\n \n \n {% block unzer_payment_actions_reason_field %}\n \n \n {% endblock %}\n\n {% block unzer_payment_actions_refund_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.refundButton') }}\n \n {% endblock %}\n \n {% block unzer_payment_actions_button_container_inner %}{% endblock %}\n
\n \n\n
\n {{ $tc('unzer-payment.paymentDetails.actions.noActions') }}\n
\n{% endblock %}","import template from './unzer-payment-actions.html.twig';\nimport './unzer-payment-actions.scss';\n\nconst { Component, Mixin } = Shopware;\nconst reasonCodes = {\n CANCEL: 'CANCEL',\n RETURN: 'RETURN',\n CREDIT: 'CREDIT',\n};\n\nComponent.register('unzer-payment-actions', {\n template,\n\n inject: ['UnzerPaymentService'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n isLoading: false,\n isSuccessful: false,\n transactionAmount: 0.0,\n reasonCode: null,\n };\n },\n\n props: {\n transactionResource: {\n type: Object,\n required: true,\n },\n\n paymentResource: {\n type: Object,\n required: true,\n },\n\n decimalPrecision: {\n type: Number,\n required: true,\n default: 4,\n },\n },\n\n computed: {\n isChargePossible: function () {\n return (\n this.transactionResource.type === 'authorization' &&\n this.transactionResource.state !== 'error'\n );\n },\n\n isRefundPossible: function () {\n return (\n this.transactionResource.type === 'charge' &&\n this.transactionResource.state !== 'error' &&\n !(\n this.transactionResource.isFirst &&\n this.paymentResource.paymentMethodId ===\n '085b64d0028a8bd447294e03c4eb411a' &&\n this.paymentResource.state.name !== 'pending' &&\n this.paymentResource.state.name !== 'partly'\n )\n );\n },\n\n maxTransactionAmount() {\n let amount = 0;\n\n let isAmountForPrepaymentRefund =\n this.isRefundPossible &&\n this.paymentResource.paymentMethodId ===\n '085b64d0028a8bd447294e03c4eb411a';\n\n if (this.isRefundPossible) {\n amount = this.transactionResource.amount;\n }\n\n if (this.isChargePossible) {\n amount = this.paymentResource.amount.remaining;\n }\n\n if ('remainingAmount' in this.transactionResource) {\n amount = this.transactionResource.remainingAmount;\n }\n\n if (\n this.transactionResource.isFirst &&\n isAmountForPrepaymentRefund\n ) {\n amount = this.paymentResource.amount.remaining;\n }\n\n return amount / 10 ** this.paymentResource.amount.decimalPrecision;\n },\n\n reasonCodeSelection() {\n return [\n {\n label: this.$tc(\n 'unzer-payment.paymentDetails.actions.reason.cancel'\n ),\n value: reasonCodes.CANCEL,\n },\n {\n label: this.$tc(\n 'unzer-payment.paymentDetails.actions.reason.credit'\n ),\n value: reasonCodes.CREDIT,\n },\n {\n label: this.$tc(\n 'unzer-payment.paymentDetails.actions.reason.return'\n ),\n value: reasonCodes.RETURN,\n },\n ];\n },\n },\n\n created() {\n this.transactionAmount = this.maxTransactionAmount;\n },\n\n methods: {\n charge() {\n this.isLoading = true;\n\n this.UnzerPaymentService.chargeTransaction(\n this.paymentResource.orderTransactionId,\n this.transactionResource.id,\n this.transactionAmount\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.chargeSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.chargeSuccessMessage'\n ),\n });\n\n this.isSuccessful = true;\n\n this.$emit('reload');\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n );\n }\n\n if (message === 'paylater-invoice-document-required') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.paylaterInvoiceDocumentRequiredErrorMessage'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.chargeErrorTitle'\n ),\n message: message,\n });\n\n this.isLoading = false;\n });\n },\n\n refund() {\n this.isLoading = true;\n\n this.UnzerPaymentService.refundTransaction(\n this.paymentResource.orderTransactionId,\n this.transactionResource.id,\n this.transactionAmount,\n this.reasonCode\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.refundSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.refundSuccessMessage'\n ),\n });\n\n this.isSuccessful = true;\n\n this.$emit('reload');\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.refundErrorTitle'\n ),\n message: message,\n });\n\n this.isLoading = false;\n });\n },\n\n startCancel() {\n this.$emit('cancel', this.transactionAmount);\n },\n },\n});\n","{% block unzer_payment_detail %}\n \n
\n {% block unzer_payment_detail_container %}\n \n {% block unzer_payment_detail_container_left %}\n \n
\n {{ $tc('unzer-payment.paymentDetails.detail.amountRemaining') }}\n
\n
\n {{ formatCurrency(remainingAmount) }}\n
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.amountCancelled') }}\n
\n
\n {{ formatCurrency(cancelledAmount) }}\n
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.amountCharged') }}\n
\n
\n {{ formatCurrency(chargedAmount) }}\n
\n {% block unzer_payment_detail_container_left_inner %}{% endblock %}\n
\n {% endblock %}\n\n {% block unzer_payment_detail_container_right %}\n \n
\n {{ $tc('unzer-payment.paymentDetails.detail.shortId') }}\n
\n
{{ paymentResource.shortId }}
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.id') }}\n
\n
{{ paymentResource.id }}
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.state') }}\n
\n
\n {{ paymentResource.state.name }}\n
\n \n
\n {{ $tc('unzer-payment.paymentDetails.detail.descriptor') }}\n
\n
\n {{ paymentResource.descriptor }}\n
\n \n {% block unzer_payment_detail_container_right_inner %}{% endblock %}\n
\n {% endblock %}\n \n {% endblock %}\n
\n {% block unzer_payment_detail_footer %}\n \n {% block unzer_payment_detail_ship_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.shipButton') }}\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}","import template from './unzer-payment-detail.html.twig';\n\nconst { Component, Mixin, Module } = Shopware;\n\nComponent.register('unzer-payment-detail', {\n template,\n\n inject: ['UnzerPaymentService'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n isLoading: false,\n isSuccessful: false,\n paylaterPaymentMethods: [\n '09588ffee8064f168e909ff31889dd7f', // see \\UnzerPayment6\\Installer\\PaymentInstaller::PAYMENT_ID_PAYLATER_INVOICE\n '12fbfbce271a43a89b3783453b88e9a6', // see \\UnzerPayment6\\Installer\\PaymentInstaller::PAYMENT_ID_PAYLATER_INSTALLMENT\n '6d6adcd4b7bf40499873c294a85f32ed', // see \\UnzerPayment6\\Installer\\PaymentInstaller::PAYMENT_ID_PAYLATER_DIRECT_DEBIT_SECURED\n ],\n };\n },\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n unzerMaxDigits() {\n const unzerPaymentModule =\n Module.getModuleRegistry().get('unzer-payment');\n\n if (!unzerPaymentModule || !unzerPaymentModule.manifest) {\n return 4;\n }\n\n return unzerPaymentModule.manifest.maxDigits;\n },\n\n remainingAmount() {\n if (!this.paymentResource || !this.paymentResource.amount) {\n return 0;\n }\n\n return this.formatAmount(\n this.paymentResource.amount.remaining,\n this.paymentResource.amount.decimalPrecision\n );\n },\n\n cancelledAmount() {\n if (!this.paymentResource || !this.paymentResource.amount) {\n return 0;\n }\n\n return this.formatAmount(\n this.paymentResource.amount.cancelled,\n this.paymentResource.amount.decimalPrecision\n );\n },\n\n chargedAmount() {\n if (!this.paymentResource || !this.paymentResource.amount) {\n return 0;\n }\n\n return this.formatAmount(\n this.paymentResource.amount.charged,\n this.paymentResource.amount.decimalPrecision\n );\n },\n },\n\n methods: {\n reloadOrderDetail() {\n this.$emit('reloadOrderDetails');\n },\n\n ship() {\n this.isLoading = true;\n\n this.UnzerPaymentService.ship(\n this.paymentResource.orderTransactionId\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.shipSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.shipSuccessMessage'\n ),\n });\n\n this.isSuccessful = true;\n\n this.$emit('reload');\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n );\n } else if (message === 'invoice-missing-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.invoiceNotFoundMessage'\n );\n } else if (message === 'documentdate-missing-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.documentDateMissingError'\n );\n } else if (message === 'payment-missing-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.paymentMissingError'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.shipErrorTitle'\n ),\n message: message,\n });\n\n this.isLoading = false;\n });\n },\n\n formatAmount(cents, decimalPrecision) {\n return (\n cents / 10 ** Math.min(this.unzerMaxDigits, decimalPrecision)\n );\n },\n\n formatCurrency(value) {\n return Shopware.Utils.format.currency(\n value || 0.0,\n this.paymentResource.currency\n );\n },\n\n isPaylaterPaymentMethod(paymentMethodId) {\n return this.paylaterPaymentMethods.indexOf(paymentMethodId) >= 0;\n },\n },\n});\n","{% block unzer_payment_history %}\n \n {% block unzer_payment_history_container %}\n \n {% endblock %}\n \n{% endblock %}","import template from './unzer-payment-history.html.twig';\n\nconst { Component, Module, Mixin } = Shopware;\n\nComponent.register('unzer-payment-history', {\n template,\n\n inject: ['repositoryFactory', 'UnzerPaymentService'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n showCancelModal: false,\n isCancelLoading: false,\n cancelAmount: 0,\n };\n },\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n unzerMaxDigits() {\n const unzerPaymentModule =\n Module.getModuleRegistry().get('unzer-payment');\n\n if (!unzerPaymentModule || !unzerPaymentModule.manifest) {\n return 4;\n }\n\n return unzerPaymentModule.manifest.maxDigits;\n },\n\n orderTransactionRepository: function () {\n return this.repositoryFactory.create('order_transaction');\n },\n\n decimalPrecision() {\n if (\n !this.paymentResource ||\n !this.paymentResource.amount ||\n !this.paymentResource.amount.decimalPrecision\n ) {\n return this.unzerMaxDigits;\n }\n\n return Math.min(\n this.unzerMaxDigits,\n this.paymentResource.amount.decimalPrecision\n );\n },\n\n data: function () {\n const data = [];\n\n Object.values(this.paymentResource.transactions).forEach(\n (transaction) => {\n // const amount = this.$options.filters.currency(\n // this.formatAmount(parseFloat(transaction.amount), this.decimalPrecision),\n // this.paymentResource.currency\n // );\n const amount = this.formatCurrency(\n this.formatAmount(\n parseFloat(transaction.amount),\n this.decimalPrecision\n )\n );\n const date = Shopware.Filter.getByName('date')(\n transaction.date,\n {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n }\n );\n\n data.push({\n type: this.transactionTypeRenderer(transaction.type),\n amount: amount,\n date: date,\n state: transaction.state || '',\n resource: transaction,\n });\n }\n );\n\n return data;\n },\n\n columns: function () {\n return [\n {\n property: 'type',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.type'\n ),\n rawData: true,\n },\n {\n property: 'amount',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.amount'\n ),\n rawData: true,\n },\n {\n property: 'date',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.date'\n ),\n rawData: true,\n },\n {\n property: 'state',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.state'\n ),\n rawData: true,\n },\n ];\n },\n },\n\n methods: {\n transactionTypeRenderer: function (value) {\n switch (value) {\n case 'authorization':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.authorization'\n );\n case 'charge':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.charge'\n );\n case 'shipment':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.shipment'\n );\n case 'refund':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.refund'\n );\n case 'cancellation':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.cancellation'\n );\n default:\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.default'\n );\n }\n },\n\n reload: function () {\n this.$emit('reload');\n this.$emit('reloadOrderDetails');\n },\n\n formatAmount(cents, decimalPrecision) {\n return cents / 10 ** decimalPrecision;\n },\n\n openCancelModal(item, cancelAmount) {\n this.showCancelModal = item.resource.id;\n this.cancelAmount = cancelAmount;\n },\n\n closeCancelModal() {\n this.showCancelModal = false;\n this.cancelAmount = 0;\n },\n\n cancel() {\n this.isCancelLoading = true;\n\n this.UnzerPaymentService.cancelTransaction(\n this.paymentResource.orderTransactionId,\n this.paymentResource.id,\n this.cancelAmount\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelSuccessMessage'\n ),\n });\n\n this.reload();\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelErrorMessage'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelErrorTitle'\n ),\n message: message,\n });\n\n this.isCancelLoading = false;\n this.reload();\n });\n },\n formatCurrency(value) {\n return Shopware.Utils.format.currency(\n value || 0.0,\n this.paymentResource.currency\n );\n },\n },\n});\n","{% block unzer_payment_metadata %}\n \n \n \n{% endblock %}","import template from './unzer-payment-metadata.html.twig';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-payment-metadata', {\n template,\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n data: function () {\n const data = [];\n\n this.paymentResource.metadata.forEach((meta) => {\n data.push({\n key: meta.key,\n value: meta.value,\n });\n });\n\n return data;\n },\n\n columns: function () {\n return [\n {\n property: 'key',\n label: this.$tc(\n 'unzer-payment.paymentDetails.metadata.column.key'\n ),\n rawData: true,\n },\n {\n property: 'value',\n label: this.$tc(\n 'unzer-payment.paymentDetails.metadata.column.value'\n ),\n rawData: true,\n },\n ];\n },\n },\n});\n","{% block unzer_payment_basket %}\n \n \n \n{% endblock %}","import template from './unzer-payment-basket.html.twig';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-payment-basket', {\n template,\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n data: function () {\n const data = [];\n\n this.paymentResource.basket.basketItems.forEach((basketItem) => {\n let amountGross = this.formatCurrency(\n parseFloat(basketItem.amountGross.toFixed(2))\n );\n let amountNet = this.formatCurrency(\n parseFloat(basketItem.amountNet.toFixed(2))\n );\n\n if (basketItem.amountDiscount > 0) {\n amountGross = this.formatCurrency(\n parseFloat(basketItem.amountDiscount.toFixed(2)) * -1\n );\n\n amountNet = this.formatCurrency(\n parseFloat(\n (\n basketItem.amountDiscount - basketItem.amountVat\n ).toFixed(2)\n ) * -1\n );\n }\n\n data.push({\n quantity: basketItem.quantity,\n title: basketItem.title,\n amountGross: amountGross,\n amountNet: amountNet,\n });\n });\n\n return data;\n },\n\n columns: function () {\n return [\n {\n property: 'quantity',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.quantity'\n ),\n rawData: true,\n },\n {\n property: 'title',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.title'\n ),\n rawData: true,\n },\n {\n property: 'amountGross',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.amountGross'\n ),\n rawData: true,\n },\n {\n property: 'amountNet',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.amountNet'\n ),\n rawData: true,\n },\n ];\n },\n },\n methods: {\n formatCurrency(value) {\n return Shopware.Utils.format.currency(\n value || 0.0,\n this.paymentResource.currency\n );\n },\n },\n});\n","{% block sw_order_create_details_footer_payment_method %}\n \n{% endblock %}","import template from './sw-order-create-details-footer.html.twig';\n\nconst { Criteria } = Shopware.Data;\nconst unzerPaymentIds = [\n 'bc4c2cbfb5fda0bf549e4807440d0a54', //PAYMENT_ID_ALIPAY\n '4673044aff79424a938d42e9847693c3', //PAYMENT_ID_CREDIT_CARD\n '713c7a332b432dcd4092701eda522a7e', //PAYMENT_ID_DIRECT_DEBIT\n '5123af5ce94a4a286641973e8de7eb60', //PAYMENT_ID_DIRECT_DEBIT_SECURED\n '17830aa7e6a00b99eab27f0e45ac5e0d', //PAYMENT_ID_EPS\n '4ebb99451f36ba01f13d5871a30bce2c', //PAYMENT_ID_FLEXIPAY\n 'd4b90a17af62c1bb2f6c3b1fed339425', //PAYMENT_ID_GIROPAY\n '4b9f8d08b46a83839fd0eb14fe00efe6', //PAYMENT_ID_INSTALLMENT_SECURED\n '08fb8d9a72ab4ca62b811e74f2eca79f', //PAYMENT_ID_INVOICE\n '6cc3b56ce9b0f80bd44039c047282a41', //PAYMENT_ID_INVOICE_SECURED\n '614ad722a03ee96baa2446793143215b', //PAYMENT_ID_IDEAL\n '409fe641d6d62a4416edd6307d758791', //PAYMENT_ID_PAYPAL\n '085b64d0028a8bd447294e03c4eb411a', //PAYMENT_ID_PRE_PAYMENT\n 'cd6f59d572e6c90dff77a48ce16b44db', //PAYMENT_ID_PRZELEWY24\n 'fd96d03535a46d197f5adac17c9f8bac', //PAYMENT_ID_WE_CHAT\n '09588ffee8064f168e909ff31889dd7f', //PAYMENT_ID_PAYLATER_INVOICE\n];\n\nShopware.Component.override('sw-order-create-details-footer', {\n template,\n\n computed: {\n paymentMethodCriteria() {\n /** @var {Criteria} paymentCriteria */\n const criteria = new Criteria();\n\n if (this.salesChannelId) {\n criteria.addFilter(\n Criteria.equals('salesChannels.id', this.salesChannelId)\n );\n }\n\n criteria.addFilter(\n Criteria.not('AND', [Criteria.equalsAny('id', unzerPaymentIds)])\n );\n\n return criteria;\n },\n },\n});\n","{% block sw_order_detail_content_tabs_general %}\n {% parent() %}\n\n {% block unzer_payment_payment_tab %}\n \n {{ $tc('unzer-payment.tabTitle') }}\n \n {% endblock %}\n{% endblock %}","import template from './sw-order-detail.html.twig';\n\nconst { Component, Context } = Shopware;\nconst { Criteria } = Shopware.Data;\n\nComponent.override('sw-order-detail', {\n template,\n\n data() {\n return {\n isUnzerPayment: false,\n };\n },\n\n computed: {\n showTabs() {\n return true; // TODO remove with PT-10455\n },\n },\n\n watch: {\n orderId: {\n deep: true,\n handler() {\n if (!this.orderId) {\n this.isUnzerPayment = false;\n\n return;\n }\n\n const orderRepository = this.repositoryFactory.create('order');\n const orderCriteria = new Criteria(1, 1);\n orderCriteria.addAssociation('transactions');\n\n orderRepository\n .get(this.orderId, Context.api, orderCriteria)\n .then((order) => {\n order.transactions.forEach((orderTransaction) => {\n if (!orderTransaction.customFields) {\n return;\n }\n\n if (\n !orderTransaction.customFields\n .unzer_payment_is_transaction &&\n !orderTransaction.customFields\n .heidelpay_is_transaction\n ) {\n return;\n }\n\n this.isUnzerPayment = true;\n });\n });\n },\n immediate: true,\n },\n },\n});\n","{% block sw_order_list_grid_columns %}\n {% parent() %}\n\n {% block unzer_payment_column_transaction %}\n \n {% endblock %}\n{% endblock %}","import template from './sw-order-list.html.twig';\n\nShopware.Component.override('sw-order-list', {\n template,\n\n methods: {\n getOrderColumns() {\n const baseColumns = this.$super('getOrderColumns');\n\n baseColumns.splice(1, 0, {\n property: 'unzerPaymentTransactionId',\n label: 'unzer-payment.order-list.transactionId',\n allowResize: true,\n });\n\n return baseColumns;\n },\n },\n});\n","{% block unzer_payment_payment_details %}\n
\n
\n {% block unzer_payment_payment_details_content %}\n \n {% endblock %}\n
\n \n
\n{% endblock %}","import template from './unzer-payment-tab.html.twig';\n\nconst { Component, Context, Mixin } = Shopware;\nconst { Criteria } = Shopware.Data;\n\nComponent.register('unzer-payment-tab', {\n template,\n\n inject: ['UnzerPaymentService', 'repositoryFactory'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n paymentResources: [],\n loadedResources: 0,\n isLoading: true,\n order: null,\n };\n },\n\n created() {\n this.createdComponent();\n },\n\n computed: {\n orderRepository() {\n return this.repositoryFactory.create('order');\n },\n },\n\n watch: {\n $route() {\n this.resetDataAttributes();\n this.createdComponent();\n },\n },\n\n methods: {\n createdComponent() {\n this.loadData();\n },\n\n resetDataAttributes() {\n this.paymentResources = [];\n this.loadedResources = 0;\n this.isLoading = true;\n },\n\n reloadPaymentDetails() {\n this.resetDataAttributes();\n this.loadData();\n },\n\n loadData() {\n const orderId = this.$route.params.id;\n const criteria = new Criteria();\n criteria\n .getAssociation('transactions')\n .addSorting(Criteria.sort('createdAt', 'DESC'));\n\n this.orderRepository\n .get(orderId, Context.api, criteria)\n .then((order) => {\n this.order = order;\n\n if (!order.transactions) {\n return;\n }\n\n order.transactions.forEach((orderTransaction, index) => {\n if (!orderTransaction.customFields) {\n this.loadedResources++;\n\n return;\n }\n\n if (\n !orderTransaction.customFields\n .unzer_payment_is_transaction &&\n !orderTransaction.customFields\n .heidelpay_is_transaction\n ) {\n this.loadedResources++;\n\n return;\n }\n\n this.UnzerPaymentService.fetchPaymentDetails(\n orderTransaction.id\n )\n .then((response) => {\n this.paymentResources[index] = response;\n this.paymentResources[\n index\n ].orderTransactionId = orderTransaction.id;\n this.loadedResources++;\n\n this.isLoading =\n this.order.transactions.length !==\n this.loadedResources;\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.couldNotRetrieveMessage'\n ),\n });\n\n this.isLoading = false;\n });\n });\n });\n },\n\n reloadOrderDetails() {\n //we cannot know, when the webhook is called, but 5 seconds should be enough to wait for most cases\n setTimeout(() => {\n this.findOrderDetailComponentAndReInit();\n }, 5000);\n },\n\n async findOrderDetailComponentAndReInit(base = this) {\n const componentName = 'sw-order-detail';\n const parent = base.$parent;\n\n if (parent === undefined) {\n return null;\n }\n\n if (parent.$options.name !== componentName) {\n return this.findOrderDetailComponentAndReInit(parent);\n }\n\n if (parent.isOrderEditing) {\n return null;\n }\n\n // we reinitialize the orderDetail component, because there is no other way to update it is not updating the order state\n parent.createdComponent();\n },\n },\n});\n","import './component/unzer-payment-actions';\nimport './component/unzer-payment-detail';\nimport './component/unzer-payment-history';\nimport './component/unzer-payment-metadata';\nimport './component/unzer-payment-basket';\nimport './extension/sw-order-create-details-footer';\nimport './extension/sw-order-detail';\nimport './extension/sw-order-list';\nimport './page/unzer-payment-tab';\n\nconst { Module } = Shopware;\n\nModule.register('unzer-payment', {\n type: 'plugin',\n name: 'UnzerPayment',\n title: 'unzer-payment.general.title',\n description: 'unzer-payment.general.descriptionTextModule',\n version: '0.0.1',\n targetVersion: '0.0.1',\n maxDigits: 4,\n\n routeMiddleware(next, currentRoute) {\n if (currentRoute.name === 'sw.order.detail') {\n currentRoute.children.push({\n component: 'unzer-payment-tab',\n name: 'unzer-payment.payment.detail',\n path: '/sw/order/detail/:id/unzer-payment',\n isChildren: true,\n meta: {\n parentPath: 'sw.order.index',\n },\n });\n }\n\n next(currentRoute);\n },\n});\n","{% block unzer_payment_payment_register_webhook %}\n
\n {% block unzer_payment_payment_register_webhook_button %}\n \n {{ $tc('unzer-payment-settings.form.webhookButton') }}\n \n {% endblock %}\n\n {% block unzer_payment_payment_register_webhook_modal %}\n \n \n\n \n \n {% endblock %}\n
\n{% endblock %}","import template from './register-webhook.html.twig';\nimport './style.scss';\n\nconst Criteria = Shopware.Data.Criteria;\n\nShopware.Component.register('unzer-payment-register-webhook', {\n template,\n\n mixins: [Shopware.Mixin.getByName('notification')],\n\n inject: ['repositoryFactory', 'UnzerPaymentConfigurationService'],\n\n props: {\n webhooks: {\n type: Array,\n required: true,\n },\n isLoading: {\n type: Boolean,\n required: false,\n },\n selectedSalesChannelId: {\n type: String,\n required: false,\n },\n privateKey: {\n type: String,\n required: true,\n },\n isDisabled: {\n type: Boolean,\n required: false,\n },\n },\n\n computed: {\n salesChannelRepository() {\n return this.repositoryFactory.create('sales_channel');\n },\n },\n\n data() {\n return {\n isModalActive: false,\n isRegistering: false,\n isRegistrationSuccessful: false,\n isDataLoading: false,\n selection: {},\n selectedDomain: null,\n entitySelection: {},\n salesChannels: {},\n };\n },\n\n created() {\n this.createdComponent();\n },\n\n methods: {\n createdComponent() {\n this.loadData();\n },\n\n loadData(page, limit) {\n let me = this;\n\n this.isDataLoading = true;\n\n let criteria = new Criteria(page, limit);\n criteria.addAssociation('domains');\n\n this.salesChannelRepository\n .search(criteria, Shopware.Context.api)\n .then((result) => {\n me.salesChannels = result;\n me.isDataLoading = false;\n });\n },\n\n onPageChange(args) {\n this.loadData(args.page, args.limit);\n },\n\n openModal() {\n this.$emit('modal-open');\n this.isModalActive = true;\n },\n\n closeModal() {\n this.isModalActive = false;\n },\n\n registerWebhooks() {\n const me = this;\n this.isRegistrationSuccessful = false;\n this.isRegistering = true;\n\n this.UnzerPaymentConfigurationService.registerWebhooks({\n selection: this.entitySelection,\n })\n .then((response) => {\n me.isRegistrationSuccessful = true;\n\n if (undefined !== response) {\n me.messageGeneration(response);\n }\n\n this.$emit('webhook-registered', response);\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment-settings.webhook.globalError.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.webhook.globalError.message'\n ),\n });\n })\n .finally(() => {\n me.isRegistering = false;\n });\n },\n\n onRegistrationFinished() {\n this.isRegistrationSuccessful = false;\n this.selection = {};\n },\n\n onSelectItem(domainId, domain) {\n if (!domain) {\n return;\n }\n\n domain['privateKey'] = this.privateKey;\n\n this.entitySelection[domain.salesChannelId] = domain;\n },\n\n messageGeneration(data) {\n const domainAmount = data.length;\n\n Object.keys(data).forEach((domain) => {\n if (data[domain].success) {\n this.createNotificationSuccess({\n title: this.$tc(data[domain].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + domain,\n });\n } else {\n this.createNotificationError({\n title: this.$tc(data[domain].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + domain,\n });\n }\n });\n },\n\n isWebhookRegisteredForSalesChannel(salesChannelId) {\n let result = false;\n\n const salesChannel = this.getSalesChannelById(salesChannelId);\n\n if (!this.webhooks.length) {\n return false;\n }\n\n salesChannel.domains.forEach((domain) => {\n this.webhooks.forEach((webhook) => {\n if (webhook.url.indexOf(domain.url) > -1) {\n result = true;\n return true;\n }\n });\n });\n\n return result;\n },\n\n getSalesChannelById(salesChannelId) {\n let result = null;\n\n this.salesChannels.forEach((salesChannel) => {\n if (salesChannel.id === salesChannelId) {\n result = salesChannel;\n return true;\n }\n });\n\n return result;\n },\n\n getSalesChannelDomainCriteria(salesChannelId) {\n let criteria = new Criteria();\n\n criteria.addFilter(Criteria.prefix('url', 'https://'));\n criteria.addFilter(\n Criteria.equals('salesChannelId', salesChannelId)\n );\n\n return criteria;\n },\n },\n});\n","\n \n {{ $tc('unzer-payment-settings.webhook.empty') }}\n \n
\n \n \n \n {{ $tc('unzer-payment-settings.modal.webhook.submit.clear', webhookSelectionLength, {count: webhookSelectionLength}) }}\n \n
\n","import template from './unzer-webhooks-modal.html.twig';\n\nconst { Component, Mixin, Context } = Shopware;\n\nComponent.register('unzer-webhooks-modal', {\n template,\n\n mixins: [Mixin.getByName('notification')],\n\n inject: ['UnzerPaymentConfigurationService'],\n\n props: {\n keyPair: {\n type: Array,\n required: true,\n },\n webhooks: {\n type: Array,\n required: true,\n },\n isLoadingWebhooks: {\n type: Boolean,\n },\n },\n\n data() {\n return {\n isClearing: false,\n isClearingSuccessful: false,\n webhookSelection: null,\n webhookSelectionLength: 0,\n };\n },\n\n computed: {\n webhookColumns() {\n return [\n {\n property: 'event',\n dataIndex: 'event',\n label: 'Event',\n },\n {\n property: 'url',\n dataIndex: 'url',\n label: 'URL',\n },\n ];\n },\n },\n\n methods: {\n clearWebhooks(privateKey) {\n const me = this;\n this.isClearingSuccessful = false;\n this.isClearing = true;\n this.isLoading = true;\n\n this.UnzerPaymentConfigurationService.clearWebhooks({\n privateKey: privateKey,\n selection: this.webhookSelection,\n })\n .then((response) => {\n me.isClearingSuccessful = true;\n me.webhookSelection = [];\n me.webhookSelectionLength = 0;\n\n me.$refs.webhookDataGrid.resetSelection();\n\n me.$emit('load-webhooks', privateKey);\n\n if (undefined !== response) {\n me.messageGeneration(response);\n }\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment-settings.webhook.globalError.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.webhook.globalError.message'\n ),\n });\n })\n .finally(() => {\n me.isLoading = false;\n me.isClearing = false;\n });\n },\n\n onClearingFinished() {\n this.isClearingSuccessful = false;\n this.isClearing = false;\n },\n\n onSelectWebhook(selectedItems) {\n this.webhookSelectionLength = Object.keys(selectedItems).length;\n this.webhookSelection = selectedItems;\n },\n\n messageGeneration(data) {\n const domainAmount = data.length;\n\n Object.keys(data).forEach((url) => {\n if (data[url].success) {\n this.createNotificationSuccess({\n title: this.$tc(data[url].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + url,\n });\n } else {\n this.createNotificationError({\n title: this.$tc(data[url].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + url,\n });\n }\n });\n },\n },\n});\n","const { Component } = Shopware;\nconst { Criteria } = Shopware.Data;\n\n// extend the existing component `sw-entity-single-select` by\n// overwriting the default criteria\nComponent.extend(\n 'unzer-entity-single-select-delivery-status',\n 'sw-entity-single-select',\n {\n props: {\n criteria: {\n type: Object,\n required: false,\n default() {\n const criteria = new Criteria(1, 100);\n\n criteria.addFilter(\n Criteria.equals(\n 'stateMachine.technicalName',\n 'order_delivery.state'\n )\n );\n\n return criteria;\n },\n },\n },\n }\n);\n","const { Component, Service } = Shopware;\nconst { Criteria, EntityCollection } = Shopware.Data;\n\nComponent.extend(\n 'unzer-entity-multi-select-delivery-status',\n 'sw-entity-multi-id-select',\n {\n props: {\n repository: {\n type: Object,\n required: true,\n default() {\n return Service('repositoryFactory').create(\n 'state_machine_state'\n );\n },\n },\n criteria: {\n type: Object,\n required: false,\n default() {\n const criteria = new Criteria(1, 100);\n\n criteria.addFilter(\n Criteria.equals(\n 'stateMachine.technicalName',\n 'order_delivery.state'\n )\n );\n\n return criteria;\n },\n },\n },\n }\n);\n","\n","const { Component } = Shopware;\n\nimport template from './unzer-google-pay-gateway-merchant-id.html.twig';\n\nComponent.register('unzer-google-pay-gateway-merchant-id', {\n template,\n inject: ['UnzerPaymentConfigurationService'],\n data() {\n return {\n readOnlyUnzerGooglePayGatewayMerchantId: '',\n };\n },\n props: {\n currentSalesChannelId: {\n type: String,\n required: true,\n },\n },\n watch: {\n currentSalesChannelId() {\n this.getUnzerGooglePayGatewayMerchantId();\n },\n },\n created() {\n this.getUnzerGooglePayGatewayMerchantId();\n document.addEventListener(\n 'unzer-settings-saved',\n this.getUnzerGooglePayGatewayMerchantId\n );\n },\n methods: {\n getUnzerGooglePayGatewayMerchantId() {\n console.log('get', this.currentSalesChannelId);\n this.UnzerPaymentConfigurationService.getGooglePayGatewayMerchantId(\n this.currentSalesChannelId\n )\n .then((response) => {\n this.readOnlyUnzerGooglePayGatewayMerchantId =\n response.gatewayMerchantId;\n })\n .catch(() => {});\n },\n },\n});\n","{% block unzer_plugin_icon %}\n \n{% endblock %}","import template from './unzer-payment-plugin-icon.html.twig';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-payment-plugin-icon', {\n template,\n computed: {\n assetFilter() {\n return Shopware.Filter.getByName('asset');\n },\n },\n});\n","{% block unzer_settings_subheading %}\n
{{ label }}
\n{% endblock %}","import template from './unzer-settings-subheading.html.twig';\nimport './style.scss';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-settings-subheading', {\n template,\n computed: {\n label() {\n // get part after last dot\n const parts = this.$attrs.name.split('.');\n const key = parts[parts.length - 1];\n return this.$tc('unzer-payment-settings.subheadings.' + key);\n },\n },\n});\n","const { Component } = Shopware;\n\nComponent.override('sw-system-config', {\n watch: {\n currentSalesChannelId() {\n this.$emit(\n 'sales-channel-changed',\n this.actualConfigData[this.currentSalesChannelId],\n this.currentSalesChannelId\n );\n },\n },\n});\n","{% block unzer_payment_settings %}\n \n {% block unzer_payment_settings_header %}\n \n {% endblock %}\n\n {% block unzer_payment_settings_actions %}\n \n {% endblock %}\n\n {% block unzer_payment_settings_content %}\n \n \n \n \n \n {% endblock %}\n \n{% endblock %}","import template from './unzer-payment-settings.html.twig';\nimport './unzer-payment-settings.scss';\n\nconst { Component, Mixin, Context } = Shopware;\n\nComponent.register('unzer-payment-settings', {\n template,\n\n mixins: [\n Mixin.getByName('notification'),\n Mixin.getByName('sw-inline-snippet'),\n ],\n\n inject: ['repositoryFactory', 'UnzerPaymentConfigurationService'],\n\n data() {\n return {\n isLoading: true,\n isLoadingWebhooks: true,\n isAdditionalKeysExpanded: false,\n selectedKeyPairForTesting: false,\n isTestSuccessful: false,\n isSaveSuccessful: false,\n config: {},\n webhooks: [],\n loadedWebhooksPrivateKey: false,\n selectedSalesChannelId: null,\n keyPairSettings: [\n {\n key: 'b2b-eur',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2b-chf',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2c-eur',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2c-chf',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2c-eur',\n group: 'paylaterInstallment',\n },\n {\n key: 'b2c-chf',\n group: 'paylaterInstallment',\n },\n {\n key: 'b2c-eur',\n group: 'paylaterDirectDebitSecured',\n },\n ],\n openModalKeyPair: null,\n };\n },\n\n metaInfo() {\n return {\n title: 'UnzerPayment',\n };\n },\n\n computed: {\n paymentMethodRepository() {\n return this.repositoryFactory.create('payment_method');\n },\n\n arrowIconName() {\n const match = Context.app.config.version.match(\n /((\\d+)\\.?(\\d+?)\\.?(\\d+)?\\.?(\\d*))-?([A-z]+?\\d+)?/i\n );\n\n if (match[3] >= 5) {\n return 'regular-chevron-right-xs';\n }\n\n return 'small-arrow-medium-right';\n },\n\n defaultKeyPair() {\n return {\n privateKey: this.getConfigValue('privateKey'),\n publicKey: this.getConfigValue('publicKey'),\n };\n },\n },\n\n watch: {\n openModalKeyPair(val) {\n if (val && val.privateKey !== this.loadedWebhooksPrivateKey) {\n this.loadWebhooks(val.privateKey);\n }\n },\n },\n\n methods: {\n getConfigValue(field) {\n if (\n !this.config ||\n !this.$refs.systemConfig ||\n !this.$refs.systemConfig.actualConfigData ||\n !this.$refs.systemConfig.actualConfigData.null\n ) {\n return '';\n }\n\n const defaultConfig = this.$refs.systemConfig.actualConfigData.null;\n\n return (\n this.config[`UnzerPayment6.settings.${field}`] ||\n defaultConfig[`UnzerPayment6.settings.${field}`]\n );\n },\n\n onValidateCredentials(keyPairSetting) {\n this.isTestSuccessful = false;\n this.selectedKeyPairForTesting = keyPairSetting;\n const keyPairIndex =\n this.getArrayKeyOfKeyPairSetting(keyPairSetting);\n let keyPairValues = keyPairSetting;\n if (keyPairIndex !== -1) {\n keyPairValues = this.keyPairSettings[keyPairIndex];\n }\n\n const credentials = {\n publicKey: keyPairValues.publicKey,\n privateKey: keyPairValues.privateKey,\n salesChannel: this.$refs.systemConfig.currentSalesChannelId,\n };\n\n this.UnzerPaymentConfigurationService.validateCredentials(\n credentials\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment-settings.form.message.success.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.form.message.success.message'\n ),\n });\n\n this.isTestSuccessful = true;\n this.selectedKeyPairForTesting = false;\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment-settings.form.message.error.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.form.message.error.message'\n ),\n });\n\n this.onTestFinished();\n });\n },\n\n onTestFinished() {\n this.selectedKeyPairForTesting = false;\n this.isTestSuccessful = false;\n },\n\n getArrayKeyOfKeyPairSetting(keyPairSetting) {\n return this.keyPairSettings.findIndex((keyPairSettingItem) => {\n return (\n keyPairSettingItem.key === keyPairSetting.key &&\n keyPairSettingItem.group === keyPairSetting.group\n );\n });\n },\n\n onSave() {\n this.isLoading = true;\n\n [\n 'paylaterInvoice',\n 'paylaterInstallment',\n 'paylaterDirectDebitSecured',\n ].forEach((group) => {\n this.config[`UnzerPayment6.settings.${group}`] = [];\n });\n this.keyPairSettings.reduce((config, keyPairSetting) => {\n if (\n !keyPairSetting ||\n !keyPairSetting.privateKey ||\n !keyPairSetting.publicKey\n ) {\n return config;\n }\n\n config[`UnzerPayment6.settings.${keyPairSetting.group}`].push(\n keyPairSetting\n );\n\n return config;\n }, this.config);\n\n this.$refs.systemConfig\n .saveAll()\n .then(() => {\n this.isSaveSuccessful = true;\n\n let messageSaveSuccess = this.$tc(\n 'sw-plugin-config.messageSaveSuccess'\n );\n\n if (\n messageSaveSuccess ===\n 'sw-plugin-config.messageSaveSuccess'\n ) {\n messageSaveSuccess = this.$tc(\n 'sw-extension-store.component.sw-extension-config.messageSaveSuccess'\n );\n }\n\n this.createNotificationSuccess({\n title: this.$tc('global.default.success'),\n message: messageSaveSuccess,\n });\n\n document.dispatchEvent(\n new CustomEvent('unzer-settings-saved', {})\n );\n })\n .catch((err) => {\n this.isSaveSuccessful = false;\n\n this.createNotificationError({\n title: this.$tc('global.default.error'),\n message: err,\n });\n\n this.isLoading = false;\n });\n },\n\n onConfigChange(config) {\n this.config = config;\n this.isLoading = false;\n this.syncKeyPairConfig();\n },\n\n onLoadingChanged(value) {\n this.isLoading = value;\n },\n\n onSalesChannelChanged(config, salesChannelId) {\n if (config) {\n this.onConfigChange(config);\n }\n\n this.selectedSalesChannelId = salesChannelId;\n },\n\n onWebhookRegistered(privateKey) {\n this.loadWebhooks(privateKey);\n },\n\n loadWebhooks(privateKey) {\n this.isLoadingWebhooks = true;\n\n this.UnzerPaymentConfigurationService.getWebhooks(privateKey)\n .then((response) => {\n this.webhooks = response;\n this.webhookSelection = null;\n this.webhookSelectionLength = 0;\n this.loadedWebhooksPrivateKey = privateKey;\n })\n .catch(() => {\n this.webhooks = [];\n this.loadedWebhooksPrivateKey = false;\n })\n .finally(() => {\n this.isLoadingWebhooks = false;\n this.isClearingSuccessful = false;\n });\n },\n\n getBind(element, config) {\n let originalElement;\n\n if (config !== this.config) {\n this.config = config;\n }\n\n this.$refs.systemConfig.config.forEach((configElement) => {\n configElement.elements.forEach((child) => {\n if (child.name === element.name) {\n originalElement = child;\n return;\n }\n });\n });\n\n return originalElement || element;\n },\n\n keyPairSettingTitle(keyPairSetting) {\n return this.$tc(\n `unzer-payment.methods.${keyPairSetting.group}.${keyPairSetting.key}`\n );\n },\n\n keyPairSettingGroupTitle(keyPairSetting) {\n return this.$tc(\n `unzer-payment.methods.${keyPairSetting.group}.main`\n );\n },\n\n isShowWebhooksButtonEnabled(keyPairSetting) {\n return (\n keyPairSetting &&\n keyPairSetting.privateKey &&\n keyPairSetting.publicKey\n );\n },\n\n isRegisterWebhooksButtonEnabled(keyPairSetting) {\n return (\n !this.isLoading && keyPairSetting && keyPairSetting.privateKey\n );\n },\n\n syncKeyPairConfig() {\n const me = this;\n [\n 'paylaterInvoice',\n 'paylaterInstallment',\n 'paylaterDirectDebitSecured',\n ].forEach((group) => {\n if (!this.config[`UnzerPayment6.settings.${group}`]) {\n return;\n }\n this.config[`UnzerPayment6.settings.${group}`].forEach(\n (configKeyPairSetting) => {\n me.keyPairSettings.forEach(\n (keyPairSetting, index, collection) => {\n if (\n keyPairSetting.group ===\n configKeyPairSetting.group &&\n keyPairSetting.key ===\n configKeyPairSetting.key\n ) {\n collection[index] = configKeyPairSetting;\n }\n }\n );\n }\n );\n });\n },\n\n toggleAdditionalKeys() {\n this.isAdditionalKeysExpanded = !this.isAdditionalKeysExpanded;\n },\n },\n});\n","import './component/register-webhook';\nimport './component/unzer-webhooks-modal';\nimport './component/unzer-entity-single-select-delivery-status';\nimport './component/unzer-entity-multi-select-delivery-status';\nimport './component/unzer-google-pay-gateway-merchant-id';\nimport './component/unzer-payment-plugin-icon';\nimport './component/unzer-settings-subheading';\nimport './extension/sw-system-config';\n\nimport './page/unzer-payment-settings';\n\nimport deDE from '../../snippets/de-DE.json';\nimport enGB from '../../snippets/en-GB.json';\n\nconst { Module } = Shopware;\n\nconst configuration = {\n type: 'plugin',\n name: 'UnzerPayment',\n title: 'unzer-payment-settings.module.title',\n description: 'unzer-payment-settings.module.description',\n version: '1.1.0',\n targetVersion: '1.1.0',\n\n snippets: {\n 'de-DE': deDE,\n 'en-GB': enGB,\n },\n\n routes: {\n settings: {\n component: 'unzer-payment-settings',\n path: 'settings',\n meta: {\n parentPath: 'sw.settings.index',\n },\n },\n },\n\n extensionEntryRoute: {\n extensionName: 'UnzerPayment6',\n route: 'unzer.payment.configuration.settings',\n },\n\n settingsItem: {\n name: 'unzer-payment-configuration',\n to: 'unzer.payment.configuration.settings',\n label: 'unzer-payment-settings.module.title',\n group: 'plugins',\n iconComponent: 'unzer-payment-plugin-icon',\n backgroundEnabled: false,\n },\n};\n\nModule.register('unzer-payment-configuration', configuration);\n","const { Application } = Shopware;\nconst ApiService = Shopware.Classes.ApiService;\n\nclass UnzerPaymentService extends ApiService {\n constructor(httpClient, loginService, apiEndpoint = 'unzer-payment') {\n super(httpClient, loginService, apiEndpoint);\n }\n\n fetchPaymentDetails(transaction) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/details`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n chargeTransaction(transaction, payment, amount) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/charge/${amount}`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n refundTransaction(transaction, charge, amount, reasonCode = null) {\n let apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/refund/${charge}/${amount}`;\n\n if (reasonCode !== null) {\n apiRoute = `${apiRoute}/${reasonCode}`;\n }\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n cancelTransaction(transaction, authorize, amount) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/cancel/${authorize}/${amount}`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n ship(transaction) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/ship`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n}\n\nApplication.addServiceProvider('UnzerPaymentService', (container) => {\n const initContainer = Application.getContainer('init');\n\n return new UnzerPaymentService(\n initContainer.httpClient,\n container.loginService\n );\n});\n","const { Application } = Shopware;\nconst ApiService = Shopware.Classes.ApiService;\n\nclass UnzerPaymentConfigurationService extends ApiService {\n constructor(httpClient, loginService, apiEndpoint = 'unzer-payment') {\n super(httpClient, loginService, apiEndpoint);\n }\n\n validateCredentials(credentials) {\n return this.httpClient\n .post(\n `_action/${this.getApiBasePath()}/validate-credentials`,\n credentials,\n {\n headers: this.getBasicHeaders(),\n }\n )\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n registerWebhooks(data) {\n return this.httpClient\n .post(`_action/${this.getApiBasePath()}/register-webhooks`, data, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n clearWebhooks(data) {\n return this.httpClient\n .post(`_action/${this.getApiBasePath()}/clear-webhooks`, data, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n getWebhooks(privateKey) {\n return this.httpClient\n .post(\n `_action/${this.getApiBasePath()}/get-webhooks`,\n { privateKey: privateKey },\n {\n headers: this.getBasicHeaders(),\n }\n )\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n getGooglePayGatewayMerchantId(salesChannelId) {\n return this.httpClient\n .get(\n `_action/${this.getApiBasePath()}/get-google-pay-gateway-merchant-id?salesChannelId=${salesChannelId || ''}`,\n {\n headers: this.getBasicHeaders(),\n }\n )\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n}\n\nApplication.addServiceProvider(\n 'UnzerPaymentConfigurationService',\n (container) => {\n const initContainer = Application.getContainer('init');\n\n return new UnzerPaymentConfigurationService(\n initContainer.httpClient,\n container.loginService\n );\n }\n);\n","{% block sw_payment_card_description %}\n
\n \n \n {{ $tc('sw-payment-card.deprecated') }}\n \n
\n
\n \n{% endblock %}","import template from './sw-payment-card.html.twig';\nimport deDE from '../../snippets/de-DE.json';\nimport enGB from '../../snippets/en-GB.json';\n\nShopware.Component.override('sw-payment-card', {\n template,\n snippets: {\n 'de-DE': deDE,\n 'en-GB': enGB,\n },\n});\n"],"names":["template$f","Component","Mixin","reasonCodes","template","amount","isAmountForPrepaymentRefund","errorResponse","message","template$e","Module","unzerPaymentModule","cents","decimalPrecision","value","paymentMethodId","template$d","data","transaction","date","item","cancelAmount","template$c","meta","template$b","basketItem","amountGross","amountNet","template$a","Criteria","unzerPaymentIds","criteria","template$9","Context","orderRepository","orderCriteria","order","orderTransaction","template$8","baseColumns","template$7","orderId","index","response","base","componentName","parent","next","currentRoute","template$6","page","limit","me","result","args","domainId","domain","domainAmount","salesChannelId","salesChannel","webhook","template$5","privateKey","selectedItems","url","Service","EntityCollection","template$4","template$3","template$2","parts","key","template$1","val","field","defaultConfig","keyPairSetting","keyPairIndex","keyPairValues","credentials","keyPairSettingItem","group","config","messageSaveSuccess","err","element","originalElement","configElement","child","configKeyPairSetting","collection","configuration","deDE","enGB","Application","ApiService","UnzerPaymentService","httpClient","loginService","apiEndpoint","apiRoute","payment","charge","reasonCode","authorize","container","initContainer","UnzerPaymentConfigurationService"],"mappings":"AAAA,MAAeA,EAAA,ijECGT,WAAEC,EAAS,MAAEC,CAAK,EAAK,SACvBC,EAAc,CAChB,OAAQ,SACR,OAAQ,SACR,OAAQ,QACZ,EAEAF,EAAU,SAAS,wBAAyB,CAC5C,SAAIG,EAEA,OAAQ,CAAC,qBAAqB,EAE9B,OAAQ,CAACF,EAAM,UAAU,cAAc,CAAC,EAExC,MAAO,CACH,MAAO,CACH,UAAW,GACX,aAAc,GACd,kBAAmB,EACnB,WAAY,IACf,CACJ,EAED,MAAO,CACH,oBAAqB,CACjB,KAAM,OACN,SAAU,EACb,EAED,gBAAiB,CACb,KAAM,OACN,SAAU,EACb,EAED,iBAAkB,CACd,KAAM,OACN,SAAU,GACV,QAAS,CACZ,CACJ,EAED,SAAU,CACN,iBAAkB,UAAY,CAC1B,OACI,KAAK,oBAAoB,OAAS,iBAClC,KAAK,oBAAoB,QAAU,OAE1C,EAED,iBAAkB,UAAY,CAC1B,OACI,KAAK,oBAAoB,OAAS,UAClC,KAAK,oBAAoB,QAAU,SACnC,EACI,KAAK,oBAAoB,SACzB,KAAK,gBAAgB,kBACjB,oCACJ,KAAK,gBAAgB,MAAM,OAAS,WACpC,KAAK,gBAAgB,MAAM,OAAS,SAG/C,EAED,sBAAuB,CACnB,IAAIG,EAAS,EAETC,EACA,KAAK,kBACL,KAAK,gBAAgB,kBACjB,mCAER,OAAI,KAAK,mBACLD,EAAS,KAAK,oBAAoB,QAGlC,KAAK,mBACLA,EAAS,KAAK,gBAAgB,OAAO,WAGrC,oBAAqB,KAAK,sBAC1BA,EAAS,KAAK,oBAAoB,iBAIlC,KAAK,oBAAoB,SACzBC,IAEAD,EAAS,KAAK,gBAAgB,OAAO,WAGlCA,EAAS,IAAM,KAAK,gBAAgB,O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AAS,KAAK,gBAAiB,CAClC,CAAA,EACA,KAAM0B,GACIoD,EAAW,eAAepD,CAAQ,CAC5C,CACb,CAEI,cAAc1B,EAAM,CAChB,OAAO,KAAK,WACP,KAAK,WAAW,KAAK,eAAc,CAAE,kBAAmBA,EAAM,CAC3D,QAAS,KAAK,gBAAiB,CAClC,CAAA,EACA,KAAM0B,GACIoD,EAAW,eAAepD,CAAQ,CAC5C,CACb,CAEI,YAAYmB,EAAY,CACpB,OAAO,KAAK,WACP,KACG,WAAW,KAAK,eAAc,CAAE,gBAChC,CAAE,WAAYA,CAAY,EAC1B,CACI,QAAS,KAAK,gBAAiB,CACnD,CACA,EACa,KAAMnB,GACIoD,EAAW,eAAepD,CAAQ,CAC5C,CACb,CAEI,8BAA8Be,EAAgB,CAC1C,OAAO,KAAK,WACP,IACG,WAAW,KAAK,eAAc,CAAE,sDAAsDA,GAAkB,EAAE,GAC1G,CACI,QAAS,KAAK,gBAAiB,CACnD,CACA,EACa,KAAMf,GACIoD,EAAW,eAAepD,CAAQ,CAC5C,CACb,CACA,CAEAmD,EAAY,mBACR,mCACCW,GAAc,CACX,MAAMC,EAAgBZ,EAAY,aAAa,MAAM,EAErD,OAAO,IAAIa,GACPD,EAAc,WACdD,EAAU,YACb,CACT,CACA,EChFA,MAAerG,GAAA,+VCIf,SAAS,UAAU,SAAS,kBAAmB,CAC3C,SAAAA,GACA,SAAU,CACN,QAASwF,EACT,QAASC,CACZ,CACL,CAAC"} \ No newline at end of file diff --git a/src/Resources/public/administration/assets/unzer-payment6-BVnPNgB2.js b/src/Resources/public/administration/assets/unzer-payment6-BVnPNgB2.js new file mode 100644 index 00000000..2a3f10e1 --- /dev/null +++ b/src/Resources/public/administration/assets/unzer-payment6-BVnPNgB2.js @@ -0,0 +1,2 @@ +const w=`{% block unzer_payment_actions %} {% block unzer_payment_actions_amount_field %}
{% endblock %}
{% block unzer_payment_actions_charge_button %} {{ $tc('unzer-payment.paymentDetails.actions.chargeButton') }} {% endblock %} {% block unzer_payment_actions_cancel_button %} {{ $tc('unzer-payment.paymentDetails.actions.cancelButton') }} {% endblock %} {% block unzer_payment_actions_reason_field %} {% endblock %} {% block unzer_payment_actions_refund_button %} {{ $tc('unzer-payment.paymentDetails.actions.refundButton') }} {% endblock %} {% block unzer_payment_actions_button_container_inner %}{% endblock %}
{{ $tc('unzer-payment.paymentDetails.actions.noActions') }}
{% endblock %}`,{Component:z,Mixin:C}=Shopware,d={CANCEL:"CANCEL",RETURN:"RETURN",CREDIT:"CREDIT"};z.register("unzer-payment-actions",{template:w,inject:["UnzerPaymentService"],mixins:[C.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,transactionAmount:0,reasonCode:null}},props:{transactionResource:{type:Object,required:!0},paymentResource:{type:Object,required:!0},decimalPrecision:{type:Number,required:!0,default:4}},computed:{isChargePossible:function(){return this.transactionResource.type==="authorization"&&this.transactionResource.state!=="error"},isRefundPossible:function(){return this.transactionResource.type==="charge"&&this.transactionResource.state!=="error"&&!(this.transactionResource.isFirst&&this.paymentResource.paymentMethodId==="085b64d0028a8bd447294e03c4eb411a"&&this.paymentResource.state.name!=="pending"&&this.paymentResource.state.name!=="partly")},maxTransactionAmount(){let e=0,t=this.isRefundPossible&&this.paymentResource.paymentMethodId==="085b64d0028a8bd447294e03c4eb411a";return this.isRefundPossible&&(e=this.transactionResource.amount),this.isChargePossible&&(e=this.paymentResource.amount.remaining),"remainingAmount"in this.transactionResource&&(e=this.transactionResource.remainingAmount),this.transactionResource.isFirst&&t&&(e=this.paymentResource.amount.remaining),e/10**this.paymentResource.amount.decimalPrecision},reasonCodeSelection(){return[{label:this.$tc("unzer-payment.paymentDetails.actions.reason.cancel"),value:d.CANCEL},{label:this.$tc("unzer-payment.paymentDetails.actions.reason.credit"),value:d.CREDIT},{label:this.$tc("unzer-payment.paymentDetails.actions.reason.return"),value:d.RETURN}]}},created(){this.transactionAmount=this.maxTransactionAmount},methods:{charge(){this.isLoading=!0,this.UnzerPaymentService.chargeTransaction(this.paymentResource.orderTransactionId,this.transactionResource.id,this.transactionAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.chargeSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.chargeSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage")),t==="paylater-invoice-document-required"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.paylaterInvoiceDocumentRequiredErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.chargeErrorTitle"),message:t}),this.isLoading=!1})},refund(){this.isLoading=!0,this.UnzerPaymentService.refundTransaction(this.paymentResource.orderTransactionId,this.transactionResource.id,this.transactionAmount,this.reasonCode).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.refundSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.refundSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.refundErrorTitle"),message:t}),this.isLoading=!1})},startCancel(){this.$emit("cancel",this.transactionAmount)}}});const S=`{% block unzer_payment_detail %}
{% block unzer_payment_detail_container %} {% block unzer_payment_detail_container_left %}
{{ $tc('unzer-payment.paymentDetails.detail.amountRemaining') }}
{{ formatCurrency(remainingAmount) }}
{{ $tc('unzer-payment.paymentDetails.detail.amountCancelled') }}
{{ formatCurrency(cancelledAmount) }}
{{ $tc('unzer-payment.paymentDetails.detail.amountCharged') }}
{{ formatCurrency(chargedAmount) }}
{% block unzer_payment_detail_container_left_inner %}{% endblock %}
{% endblock %} {% block unzer_payment_detail_container_right %}
{{ $tc('unzer-payment.paymentDetails.detail.shortId') }}
{{ paymentResource.shortId }}
{{ $tc('unzer-payment.paymentDetails.detail.id') }}
{{ paymentResource.id }}
{{ $tc('unzer-payment.paymentDetails.detail.state') }}
{{ paymentResource.state.name }}
{{ $tc('unzer-payment.paymentDetails.detail.descriptor') }}
{{ paymentResource.descriptor }}
{% block unzer_payment_detail_container_right_inner %}{% endblock %}
{% endblock %}
{% endblock %}
{% block unzer_payment_detail_footer %} {% endblock %}
{% endblock %}`,{Component:v,Mixin:_,Module:$}=Shopware;v.register("unzer-payment-detail",{template:S,inject:["UnzerPaymentService"],mixins:[_.getByName("notification")],data(){return{isLoading:!1,isSuccessful:!1,paylaterPaymentMethods:["09588ffee8064f168e909ff31889dd7f","12fbfbce271a43a89b3783453b88e9a6","6d6adcd4b7bf40499873c294a85f32ed"]}},props:{paymentResource:{type:Object,required:!0}},computed:{unzerMaxDigits(){const e=$.getModuleRegistry().get("unzer-payment");return!e||!e.manifest?4:e.manifest.maxDigits},remainingAmount(){return!this.paymentResource||!this.paymentResource.amount?0:this.formatAmount(this.paymentResource.amount.remaining,this.paymentResource.amount.decimalPrecision)},cancelledAmount(){return!this.paymentResource||!this.paymentResource.amount?0:this.formatAmount(this.paymentResource.amount.cancelled,this.paymentResource.amount.decimalPrecision)},chargedAmount(){return!this.paymentResource||!this.paymentResource.amount?0:this.formatAmount(this.paymentResource.amount.charged,this.paymentResource.amount.decimalPrecision)}},methods:{reloadOrderDetail(){this.$emit("reloadOrderDetails")},ship(){this.isLoading=!0,this.UnzerPaymentService.ship(this.paymentResource.orderTransactionId).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.shipSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.shipSuccessMessage")}),this.isSuccessful=!0,this.$emit("reload")}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"?t=this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage"):t==="invoice-missing-error"?t=this.$tc("unzer-payment.paymentDetails.notifications.invoiceNotFoundMessage"):t==="documentdate-missing-error"?t=this.$tc("unzer-payment.paymentDetails.notifications.documentDateMissingError"):t==="payment-missing-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.paymentMissingError")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.shipErrorTitle"),message:t}),this.isLoading=!1})},formatAmount(e,t){return e/10**Math.min(this.unzerMaxDigits,t)},formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)},isPaylaterPaymentMethod(e){return this.paylaterPaymentMethods.indexOf(e)>=0}}});const D=`{% block unzer_payment_history %} {% block unzer_payment_history_container %} {% endblock %} {% endblock %}`,{Component:P,Module:R,Mixin:M}=Shopware;P.register("unzer-payment-history",{template:D,inject:["repositoryFactory","UnzerPaymentService"],mixins:[M.getByName("notification")],data(){return{showCancelModal:!1,isCancelLoading:!1,cancelAmount:0}},props:{paymentResource:{type:Object,required:!0}},computed:{unzerMaxDigits(){const e=R.getModuleRegistry().get("unzer-payment");return!e||!e.manifest?4:e.manifest.maxDigits},orderTransactionRepository:function(){return this.repositoryFactory.create("order_transaction")},decimalPrecision(){return!this.paymentResource||!this.paymentResource.amount||!this.paymentResource.amount.decimalPrecision?this.unzerMaxDigits:Math.min(this.unzerMaxDigits,this.paymentResource.amount.decimalPrecision)},data:function(){const e=[];return Object.values(this.paymentResource.transactions).forEach(t=>{const n=this.formatCurrency(this.formatAmount(parseFloat(t.amount),this.decimalPrecision)),a=Shopware.Filter.getByName("date")(t.date,{hour:"numeric",minute:"numeric",second:"numeric"});e.push({type:this.transactionTypeRenderer(t.type),amount:n,date:a,state:t.state||"",resource:t})}),e},columns:function(){return[{property:"type",label:this.$tc("unzer-payment.paymentDetails.history.column.type"),rawData:!0},{property:"amount",label:this.$tc("unzer-payment.paymentDetails.history.column.amount"),rawData:!0},{property:"date",label:this.$tc("unzer-payment.paymentDetails.history.column.date"),rawData:!0},{property:"state",label:this.$tc("unzer-payment.paymentDetails.history.column.state"),rawData:!0}]}},methods:{transactionTypeRenderer:function(e){switch(e){case"authorization":return this.$tc("unzer-payment.paymentDetails.history.type.authorization");case"charge":return this.$tc("unzer-payment.paymentDetails.history.type.charge");case"shipment":return this.$tc("unzer-payment.paymentDetails.history.type.shipment");case"refund":return this.$tc("unzer-payment.paymentDetails.history.type.refund");case"cancellation":return this.$tc("unzer-payment.paymentDetails.history.type.cancellation");default:return this.$tc("unzer-payment.paymentDetails.history.type.default")}},reload:function(){this.$emit("reload"),this.$emit("reloadOrderDetails")},formatAmount(e,t){return e/10**t},openCancelModal(e,t){this.showCancelModal=e.resource.id,this.cancelAmount=t},closeCancelModal(){this.showCancelModal=!1,this.cancelAmount=0},cancel(){this.isCancelLoading=!0,this.UnzerPaymentService.cancelTransaction(this.paymentResource.orderTransactionId,this.paymentResource.id,this.cancelAmount).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment.paymentDetails.notifications.cancelSuccessTitle"),message:this.$tc("unzer-payment.paymentDetails.notifications.cancelSuccessMessage")}),this.reload()}).catch(e=>{let t=e.response.data.errors[0];t==="generic-error"&&(t=this.$tc("unzer-payment.paymentDetails.notifications.cancelErrorMessage")),this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.cancelErrorTitle"),message:t}),this.isCancelLoading=!1,this.reload()})},formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)}}});const E=`{% block unzer_payment_metadata %} {% endblock %}`,{Component:I}=Shopware;I.register("unzer-payment-metadata",{template:E,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){const e=[];return this.paymentResource.metadata.forEach(t=>{e.push({key:t.key,value:t.value})}),e},columns:function(){return[{property:"key",label:this.$tc("unzer-payment.paymentDetails.metadata.column.key"),rawData:!0},{property:"value",label:this.$tc("unzer-payment.paymentDetails.metadata.column.value"),rawData:!0}]}}});const A=`{% block unzer_payment_basket %} {% endblock %}`,{Component:T}=Shopware;T.register("unzer-payment-basket",{template:A,props:{paymentResource:{type:Object,required:!0}},computed:{data:function(){const e=[];return this.paymentResource.basket.basketItems.forEach(t=>{let n=this.formatCurrency(parseFloat(t.amountGross.toFixed(2))),a=this.formatCurrency(parseFloat(t.amountNet.toFixed(2)));t.amountDiscount>0&&(n=this.formatCurrency(parseFloat(t.amountDiscount.toFixed(2))*-1),a=this.formatCurrency(parseFloat((t.amountDiscount-t.amountVat).toFixed(2))*-1)),e.push({quantity:t.quantity,title:t.title,amountGross:n,amountNet:a})}),e},columns:function(){return[{property:"quantity",label:this.$tc("unzer-payment.paymentDetails.basket.column.quantity"),rawData:!0},{property:"title",label:this.$tc("unzer-payment.paymentDetails.basket.column.title"),rawData:!0},{property:"amountGross",label:this.$tc("unzer-payment.paymentDetails.basket.column.amountGross"),rawData:!0},{property:"amountNet",label:this.$tc("unzer-payment.paymentDetails.basket.column.amountNet"),rawData:!0}]}},methods:{formatCurrency(e){return Shopware.Utils.format.currency(e||0,this.paymentResource.currency)}}});const B=`{% block sw_order_create_details_footer_payment_method %} {% endblock %}`,{Criteria:c}=Shopware.Data,x=["bc4c2cbfb5fda0bf549e4807440d0a54","4673044aff79424a938d42e9847693c3","713c7a332b432dcd4092701eda522a7e","5123af5ce94a4a286641973e8de7eb60","17830aa7e6a00b99eab27f0e45ac5e0d","4ebb99451f36ba01f13d5871a30bce2c","d4b90a17af62c1bb2f6c3b1fed339425","4b9f8d08b46a83839fd0eb14fe00efe6","08fb8d9a72ab4ca62b811e74f2eca79f","6cc3b56ce9b0f80bd44039c047282a41","614ad722a03ee96baa2446793143215b","409fe641d6d62a4416edd6307d758791","085b64d0028a8bd447294e03c4eb411a","cd6f59d572e6c90dff77a48ce16b44db","fd96d03535a46d197f5adac17c9f8bac","09588ffee8064f168e909ff31889dd7f"];Shopware.Component.override("sw-order-create-details-footer",{template:B,computed:{paymentMethodCriteria(){const e=new c;return this.salesChannelId&&e.addFilter(c.equals("salesChannels.id",this.salesChannelId)),e.addFilter(c.not("AND",[c.equalsAny("id",x)])),e}}});const K=`{% block sw_order_detail_content_tabs_general %} {% parent() %} {% block unzer_payment_payment_tab %} {{ $tc('unzer-payment.tabTitle') }} {% endblock %} {% endblock %}`,{Component:L,Context:F}=Shopware,{Criteria:W}=Shopware.Data;L.override("sw-order-detail",{template:K,data(){return{isUnzerPayment:!1}},computed:{showTabs(){return!0}},watch:{orderId:{deep:!0,handler(){if(!this.orderId){this.isUnzerPayment=!1;return}const e=this.repositoryFactory.create("order"),t=new W(1,1);t.addAssociation("transactions"),e.get(this.orderId,F.api,t).then(n=>{n.transactions.forEach(a=>{a.customFields&&(!a.customFields.unzer_payment_is_transaction&&!a.customFields.heidelpay_is_transaction||(this.isUnzerPayment=!0))})})},immediate:!0}}});const U='{% block sw_order_list_grid_columns %} {% parent() %} {% block unzer_payment_column_transaction %} {% endblock %} {% endblock %}';Shopware.Component.override("sw-order-list",{template:U,methods:{getOrderColumns(){const e=this.$super("getOrderColumns");return e.splice(1,0,{property:"unzerPaymentTransactionId",label:"unzer-payment.order-list.transactionId",allowResize:!0}),e}}});const N='{% block unzer_payment_payment_details %}
{% block unzer_payment_payment_details_content %} {% endblock %}
{% endblock %}',{Component:G,Context:O,Mixin:q}=Shopware,{Criteria:u}=Shopware.Data;G.register("unzer-payment-tab",{template:N,inject:["UnzerPaymentService","repositoryFactory"],mixins:[q.getByName("notification")],data(){return{paymentResources:[],loadedResources:0,isLoading:!0,order:null}},created(){this.createdComponent()},computed:{orderRepository(){return this.repositoryFactory.create("order")}},watch:{$route(){this.resetDataAttributes(),this.createdComponent()}},methods:{createdComponent(){this.loadData()},resetDataAttributes(){this.paymentResources=[],this.loadedResources=0,this.isLoading=!0},reloadPaymentDetails(){this.resetDataAttributes(),this.loadData()},loadData(){const e=this.$route.params.id,t=new u;t.addAssociation("currency").addAssociation("lineItems.promotion").getAssociation("transactions").addSorting(u.sort("createdAt","DESC")),this.orderRepository.get(e,O.api,t).then(n=>{this.order=n,n.transactions&&n.transactions.forEach((a,s)=>{if(!a.customFields){this.loadedResources++;return}if(!a.customFields.unzer_payment_is_transaction&&!a.customFields.heidelpay_is_transaction){this.loadedResources++;return}this.UnzerPaymentService.fetchPaymentDetails(a.id).then(i=>{this.paymentResources[s]=i,this.paymentResources[s].orderTransactionId=a.id,this.loadedResources++,this.isLoading=this.order.transactions.length!==this.loadedResources}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment.paymentDetails.notifications.genericErrorMessage"),message:this.$tc("unzer-payment.paymentDetails.notifications.couldNotRetrieveMessage")}),this.isLoading=!1})})})},reloadOrderDetails(){setTimeout(()=>{this.findOrderDetailComponentAndReInit()},5e3)},async findOrderDetailComponentAndReInit(e=this){const t="sw-order-detail",n=e.$parent;if(n===void 0)return null;if(n.$options.name!==t)return this.findOrderDetailComponentAndReInit(n);if(n.isOrderEditing)return null;n.createdComponent()}}});const{Module:H}=Shopware;H.register("unzer-payment",{type:"plugin",name:"UnzerPayment",title:"unzer-payment.general.title",description:"unzer-payment.general.descriptionTextModule",version:"0.0.1",targetVersion:"0.0.1",maxDigits:4,routeMiddleware(e,t){t.name==="sw.order.detail"&&t.children.push({component:"unzer-payment-tab",name:"unzer-payment.payment.detail",path:"/sw/order/detail/:id/unzer-payment",isChildren:!0,meta:{parentPath:"sw.order.index"}}),e(t)}});const j=`{% block unzer_payment_payment_register_webhook %}
{% block unzer_payment_payment_register_webhook_button %} {{ $tc('unzer-payment-settings.form.webhookButton') }} {% endblock %} {% block unzer_payment_payment_register_webhook_modal %} {% endblock %}
{% endblock %}`,l=Shopware.Data.Criteria;Shopware.Component.register("unzer-payment-register-webhook",{template:j,mixins:[Shopware.Mixin.getByName("notification")],inject:["repositoryFactory","UnzerPaymentConfigurationService"],props:{webhooks:{type:Array,required:!0},isLoading:{type:Boolean,required:!1},selectedSalesChannelId:{type:String,required:!1},privateKey:{type:String,required:!0},isDisabled:{type:Boolean,required:!1}},computed:{salesChannelRepository(){return this.repositoryFactory.create("sales_channel")}},data(){return{isModalActive:!1,isRegistering:!1,isRegistrationSuccessful:!1,isDataLoading:!1,selection:{},selectedDomain:null,entitySelection:{},salesChannels:{}}},created(){this.createdComponent()},methods:{createdComponent(){this.loadData()},loadData(e,t){let n=this;this.isDataLoading=!0;let a=new l(e,t);a.addAssociation("domains"),this.salesChannelRepository.search(a,Shopware.Context.api).then(s=>{n.salesChannels=s,n.isDataLoading=!1})},onPageChange(e){this.loadData(e.page,e.limit)},openModal(){this.$emit("modal-open"),this.isModalActive=!0},closeModal(){this.isModalActive=!1},registerWebhooks(){const e=this;this.isRegistrationSuccessful=!1,this.isRegistering=!0,this.UnzerPaymentConfigurationService.registerWebhooks({selection:this.entitySelection}).then(t=>{e.isRegistrationSuccessful=!0,t!==void 0&&e.messageGeneration(t),this.$emit("webhook-registered",t)}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.webhook.globalError.title"),message:this.$tc("unzer-payment-settings.webhook.globalError.message")})}).finally(()=>{e.isRegistering=!1})},onRegistrationFinished(){this.isRegistrationSuccessful=!1,this.selection={}},onSelectItem(e,t){t&&(t.privateKey=this.privateKey,this.entitySelection[t.salesChannelId]=t)},messageGeneration(e){const t=e.length;Object.keys(e).forEach(n=>{e[n].success?this.createNotificationSuccess({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n})})},isWebhookRegisteredForSalesChannel(e){let t=!1;const n=this.getSalesChannelById(e);return this.webhooks.length?(n.domains.forEach(a=>{this.webhooks.forEach(s=>{if(s.url.indexOf(a.url)>-1)return t=!0,!0})}),t):!1},getSalesChannelById(e){let t=null;return this.salesChannels.forEach(n=>{if(n.id===e)return t=n,!0}),t},getSalesChannelDomainCriteria(e){let t=new l;return t.addFilter(l.prefix("url","https://")),t.addFilter(l.equals("salesChannelId",e)),t}}});const V=` {{ $tc('unzer-payment-settings.webhook.empty') }}
{{ $tc('unzer-payment-settings.modal.webhook.submit.clear', webhookSelectionLength, {count: webhookSelectionLength}) }}
`,{Component:Z,Mixin:J,Context:ye}=Shopware;Z.register("unzer-webhooks-modal",{template:V,mixins:[J.getByName("notification")],inject:["UnzerPaymentConfigurationService"],props:{keyPair:{type:Array,required:!0},webhooks:{type:Array,required:!0},isLoadingWebhooks:{type:Boolean}},data(){return{isClearing:!1,isClearingSuccessful:!1,webhookSelection:null,webhookSelectionLength:0}},computed:{webhookColumns(){return[{property:"event",dataIndex:"event",label:"Event"},{property:"url",dataIndex:"url",label:"URL"}]}},methods:{clearWebhooks(e){const t=this;this.isClearingSuccessful=!1,this.isClearing=!0,this.isLoading=!0,this.UnzerPaymentConfigurationService.clearWebhooks({privateKey:e,selection:this.webhookSelection}).then(n=>{t.isClearingSuccessful=!0,t.webhookSelection=[],t.webhookSelectionLength=0,t.$refs.webhookDataGrid.resetSelection(),t.$emit("load-webhooks",e),n!==void 0&&t.messageGeneration(n)}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.webhook.globalError.title"),message:this.$tc("unzer-payment-settings.webhook.globalError.message")})}).finally(()=>{t.isLoading=!1,t.isClearing=!1})},onClearingFinished(){this.isClearingSuccessful=!1,this.isClearing=!1},onSelectWebhook(e){this.webhookSelectionLength=Object.keys(e).length,this.webhookSelection=e},messageGeneration(e){const t=e.length;Object.keys(e).forEach(n=>{e[n].success?this.createNotificationSuccess({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n}):this.createNotificationError({title:this.$tc(e[n].message,t),message:this.$tc("unzer-payment-settings.webhook.messagePrefix",t)+n})})}}});const{Component:Q}=Shopware,{Criteria:m}=Shopware.Data;Q.extend("unzer-entity-single-select-delivery-status","sw-entity-single-select",{props:{criteria:{type:Object,required:!1,default(){const e=new m(1,100);return e.addFilter(m.equals("stateMachine.technicalName","order_delivery.state")),e}}}});const{Component:Y,Service:X}=Shopware,{Criteria:h,EntityCollection:ge}=Shopware.Data;Y.extend("unzer-entity-multi-select-delivery-status","sw-entity-multi-id-select",{props:{repository:{type:Object,required:!0,default(){return X("repositoryFactory").create("state_machine_state")}},criteria:{type:Object,required:!1,default(){const e=new h(1,100);return e.addFilter(h.equals("stateMachine.technicalName","order_delivery.state")),e}}}});const ee=` `,{Component:te}=Shopware;te.register("unzer-google-pay-gateway-merchant-id",{template:ee,inject:["UnzerPaymentConfigurationService"],data(){return{readOnlyUnzerGooglePayGatewayMerchantId:""}},props:{currentSalesChannelId:{type:String,required:!0}},watch:{currentSalesChannelId(){this.getUnzerGooglePayGatewayMerchantId()}},created(){this.getUnzerGooglePayGatewayMerchantId(),document.addEventListener("unzer-settings-saved",this.getUnzerGooglePayGatewayMerchantId)},methods:{getUnzerGooglePayGatewayMerchantId(){console.log("get",this.currentSalesChannelId),this.UnzerPaymentConfigurationService.getGooglePayGatewayMerchantId(this.currentSalesChannelId).then(e=>{this.readOnlyUnzerGooglePayGatewayMerchantId=e.gatewayMerchantId}).catch(()=>{})}}});const ne=`{% block unzer_plugin_icon %} {% endblock %}`,{Component:ae}=Shopware;ae.register("unzer-payment-plugin-icon",{template:ne,computed:{assetFilter(){return Shopware.Filter.getByName("asset")}}});const se='{% block unzer_settings_subheading %}
{{ label }}
{% endblock %}',{Component:ie}=Shopware;ie.register("unzer-settings-subheading",{template:se,computed:{label(){const e=this.$attrs.name.split("."),t=e[e.length-1];return this.$tc("unzer-payment-settings.subheadings."+t)}}});const{Component:re}=Shopware;re.override("sw-system-config",{watch:{currentSalesChannelId(){this.$emit("sales-channel-changed",this.actualConfigData[this.currentSalesChannelId],this.currentSalesChannelId)}}});const oe=`{% block unzer_payment_settings %} {% block unzer_payment_settings_header %} {% endblock %} {% block unzer_payment_settings_actions %} {% endblock %} {% block unzer_payment_settings_content %} {% endblock %} {% endblock %}`,{Component:ce,Mixin:p,Context:le}=Shopware;ce.register("unzer-payment-settings",{template:oe,mixins:[p.getByName("notification"),p.getByName("sw-inline-snippet")],inject:["repositoryFactory","UnzerPaymentConfigurationService"],data(){return{isLoading:!0,isLoadingWebhooks:!0,isAdditionalKeysExpanded:!1,selectedKeyPairForTesting:!1,isTestSuccessful:!1,isSaveSuccessful:!1,config:{},webhooks:[],loadedWebhooksPrivateKey:!1,selectedSalesChannelId:null,keyPairSettings:[{key:"b2b-eur",group:"paylaterInvoice"},{key:"b2b-chf",group:"paylaterInvoice"},{key:"b2c-eur",group:"paylaterInvoice"},{key:"b2c-chf",group:"paylaterInvoice"},{key:"b2c-eur",group:"paylaterInstallment"},{key:"b2c-chf",group:"paylaterInstallment"},{key:"b2c-eur",group:"paylaterDirectDebitSecured"}],openModalKeyPair:null}},metaInfo(){return{title:"UnzerPayment"}},computed:{paymentMethodRepository(){return this.repositoryFactory.create("payment_method")},arrowIconName(){return le.app.config.version.match(/((\d+)\.?(\d+?)\.?(\d+)?\.?(\d*))-?([A-z]+?\d+)?/i)[3]>=5?"regular-chevron-right-xs":"small-arrow-medium-right"},defaultKeyPair(){return{privateKey:this.getConfigValue("privateKey"),publicKey:this.getConfigValue("publicKey")}}},watch:{openModalKeyPair(e){e&&e.privateKey!==this.loadedWebhooksPrivateKey&&this.loadWebhooks(e.privateKey)}},methods:{getConfigValue(e){if(!this.config||!this.$refs.systemConfig||!this.$refs.systemConfig.actualConfigData||!this.$refs.systemConfig.actualConfigData.null)return"";const t=this.$refs.systemConfig.actualConfigData.null;return this.config[`UnzerPayment6.settings.${e}`]||t[`UnzerPayment6.settings.${e}`]},onValidateCredentials(e){this.isTestSuccessful=!1,this.selectedKeyPairForTesting=e;const t=this.getArrayKeyOfKeyPairSetting(e);let n=e;t!==-1&&(n=this.keyPairSettings[t]);const a={publicKey:n.publicKey,privateKey:n.privateKey,salesChannel:this.$refs.systemConfig.currentSalesChannelId};this.UnzerPaymentConfigurationService.validateCredentials(a).then(()=>{this.createNotificationSuccess({title:this.$tc("unzer-payment-settings.form.message.success.title"),message:this.$tc("unzer-payment-settings.form.message.success.message")}),this.isTestSuccessful=!0,this.selectedKeyPairForTesting=!1}).catch(()=>{this.createNotificationError({title:this.$tc("unzer-payment-settings.form.message.error.title"),message:this.$tc("unzer-payment-settings.form.message.error.message")}),this.onTestFinished()})},onTestFinished(){this.selectedKeyPairForTesting=!1,this.isTestSuccessful=!1},getArrayKeyOfKeyPairSetting(e){return this.keyPairSettings.findIndex(t=>t.key===e.key&&t.group===e.group)},onSave(){this.isLoading=!0,["paylaterInvoice","paylaterInstallment","paylaterDirectDebitSecured"].forEach(e=>{this.config[`UnzerPayment6.settings.${e}`]=[]}),this.keyPairSettings.reduce((e,t)=>(!t||!t.privateKey||!t.publicKey||e[`UnzerPayment6.settings.${t.group}`].push(t),e),this.config),this.$refs.systemConfig.saveAll().then(()=>{this.isSaveSuccessful=!0;let e=this.$tc("sw-plugin-config.messageSaveSuccess");e==="sw-plugin-config.messageSaveSuccess"&&(e=this.$tc("sw-extension-store.component.sw-extension-config.messageSaveSuccess")),this.createNotificationSuccess({title:this.$tc("global.default.success"),message:e}),document.dispatchEvent(new CustomEvent("unzer-settings-saved",{}))}).catch(e=>{this.isSaveSuccessful=!1,this.createNotificationError({title:this.$tc("global.default.error"),message:e}),this.isLoading=!1})},onConfigChange(e){this.config=e,this.isLoading=!1,this.syncKeyPairConfig()},onLoadingChanged(e){this.isLoading=e},onSalesChannelChanged(e,t){e&&this.onConfigChange(e),this.selectedSalesChannelId=t},onWebhookRegistered(e){this.loadWebhooks(e)},loadWebhooks(e){this.isLoadingWebhooks=!0,this.UnzerPaymentConfigurationService.getWebhooks(e).then(t=>{this.webhooks=t,this.webhookSelection=null,this.webhookSelectionLength=0,this.loadedWebhooksPrivateKey=e}).catch(()=>{this.webhooks=[],this.loadedWebhooksPrivateKey=!1}).finally(()=>{this.isLoadingWebhooks=!1,this.isClearingSuccessful=!1})},getBind(e,t){let n;return t!==this.config&&(this.config=t),this.$refs.systemConfig.config.forEach(a=>{a.elements.forEach(s=>{if(s.name===e.name){n=s;return}})}),n||e},keyPairSettingTitle(e){return this.$tc(`unzer-payment.methods.${e.group}.${e.key}`)},keyPairSettingGroupTitle(e){return this.$tc(`unzer-payment.methods.${e.group}.main`)},isShowWebhooksButtonEnabled(e){return e&&e.privateKey&&e.publicKey},isRegisterWebhooksButtonEnabled(e){return!this.isLoading&&e&&e.privateKey},syncKeyPairConfig(){const e=this;["paylaterInvoice","paylaterInstallment","paylaterDirectDebitSecured"].forEach(t=>{this.config[`UnzerPayment6.settings.${t}`]&&this.config[`UnzerPayment6.settings.${t}`].forEach(n=>{e.keyPairSettings.forEach((a,s,i)=>{a.group===n.group&&a.key===n.key&&(i[s]=n)})})})},toggleAdditionalKeys(){this.isAdditionalKeysExpanded=!this.isAdditionalKeysExpanded}}});const f={"unzer-payment":{tabTitle:"Unzer Payment",paymentDetails:{history:{cardTitle:"Zahlungsverlauf",column:{type:"Typ",amount:"Betrag",date:"Datum",state:"Status"},type:{authorization:"Reservierung",charge:"Einzug",shipment:"Versandmitteilung",refund:"Rückerstattung",cancellation:"Stornierung",default:""}},actions:{reason:{placeholder:"Grund",cancel:"Abgebrochen",credit:"Gutschrift",return:"Rückgabe"},chargeButton:"Einziehen",shipButton:"Versandmitteilung",refundButton:"Rückerstatten",defaultButton:"Erledigt",cancelButton:"Stornieren",noActions:"Keine Aktionen möglich",confirmCancelModal:{text:"Möchten Sie wirklich die Reservierung über den angegebenen Betrag stornieren?",amountLabel:"Betrag:",yesButton:"Ja",noButton:"Nein"}},detail:{cardTitle:"Zahlungsdetails",shortId:"Short-ID",id:"Zahlungs-ID",state:"Status",amountRemaining:"Betrag (Rest)",amountCancelled:"Betrag (Rückerstattet)",amountCharged:"Betrag (Eingezogen)",descriptor:"Verwendungszweck"},metadata:{cardTitle:"Metadaten",column:{key:"Schlüssel",value:"Wert"}},basket:{cardTitle:"Warenkorb",column:{quantity:"Anzahl",title:"Titel",amountGross:"Betrag (brutto)",amountNet:"Betrag (netto)"}},notifications:{genericErrorMessage:"Es ist ein Fehler aufgetreten!",refundSuccessTitle:"Rückerstatten",refundSuccessMessage:"Die Rückerstattung wurde erfolgreich durchgeführt.",refundErrorTitle:"Rückerstatten",chargeSuccessTitle:"Einziehen",chargeSuccessMessage:"Das Einziehen der Zahlung wurde erfolgreich durchgeführt.",chargeErrorTitle:"Einziehen",shipSuccessTitle:"Versandmitteilung",shipSuccessMessage:"Die Versandmitteilung wurde erfolgreich gesendet.",shipErrorTitle:"Versandmitteilung",invoiceNotFoundMessage:"Zu dieser Bestellung wurde keine Rechnung gefunden",couldNotRetrieveMessage:"Die Zahlungsdetails konnten nicht abgerufen werden, bitte prüfen Sie die Logdateien für weitere Informationen.",documentDateMissingError:"Das Datum der Rechnung ist leer.",paymentMissingError:"Die Zahlung konnte nicht gefunden werden",paylaterInvoiceDocumentRequiredErrorMessage:"Bitte erstellen oder hinterlegen Sie zunächst eine Rechnung für die Bestellung.",cancelSuccessTitle:"Stornierung",cancelErrorTitle:"Stornierung",cancelSuccessMessage:"Die Stornierung wurde erfolgreich durchgeführt.",cancelErrorMessage:"Die Stornierung konnte nicht durchgeführt werden."}},"order-list":{transactionId:"Unzer Transaktions ID"},methods:{paylaterInvoice:{main:"Rechnungskauf","b2b-eur":"Rechnungskauf B2B EUR","b2b-chf":"Rechnungskauf B2B CHF","b2c-eur":"Rechnungskauf B2C EUR","b2c-chf":"Rechnungskauf B2C CHF"},paylaterInstallment:{main:"Ratenkauf","b2c-eur":"Ratenkauf B2C EUR","b2c-chf":"Ratenkauf B2C CHF"},paylaterDirectDebitSecured:{main:"Lastschrift","b2c-eur":"Lastschrift B2C EUR"}}},"unzer-payment-settings":{subheadings:{paymentSettingsBookingModes:"Buchungsmodus",paymentSettingsSaveDevices:"Zahlungsmittel speichern",paymentSettingsExpressCheckout:"Express Checkout"},module:{title:"Unzer Payment",description:"Unzer Payment"},"google-pay":{gatewayMerchantId:"Gateway Händler ID"},form:{message:{success:{title:"Test erfolgreich",message:"Die angegebenen API-Zugangsdaten sind korrekt!"},error:{title:"Test fehlgeschlagen",message:"Die angegebenen API-Zugangsdaten sind nicht korrekt! Bitte korrigieren Sie die Eingabe und versuchen Sie es erneut."}},testButton:"API Zugangsdaten testen",webhookButton:"Webhooks registrieren",privateKey:"Private Key",publicKey:"Public Key",additionalKeys:"API Keys für weitere Zahlungsarten",additionalKeysHelpText:"Wenn die Felder für zusätzliche Schlüsselpaare leer sind, werden standardmäßig die Hauptschlüsselpaare übernommen."},modal:{close:"Schließen",webhook:{title:"Webhooks",httpsInfo:"Es kann nur eine HTTPS-Domain pro Verkaufskanal registriert werden.",registered:"Webhook ist bereits registriert",placeholder:"Bitte wählen Sie eine Domain aus",submit:{register:"Webhooks registrieren",clear:"Webhooks auswählen | Ausgewählten Webhook entfernen | Entferne {count} Webhooks"}}},webhook:{messagePrefix:"Domain: ",register:{done:"Webhook registriert | Webhooks registriert",error:"Der Webhook konnte nicht registriert werden | Die Webhooks konnten nicht registriert werden"},clear:{done:"Webhook entfernt | Webhooks entfernt",error:"Der Webhook konnte nicht entfernt werden | Die Webhooks konnten nicht entfernt werden"},missing:{fields:"Nicht alle benötigten Felder sind vorhanden",context:"Der Kontext konnte nicht aktualisiert werden",selection:"Es wurden keine Domains selektiert"},notFound:{salesChannelDomain:"Die spezifizierte Domain wurde nicht gefunden"},globalError:{title:"Ein Fehler ist aufgetreten",message:"Bitte kontaktieren sie uns für mehr Informationen"},empty:"Für diesen Private Key sind keine Webhooks registriert. Bitte prüfen Sie ob dieser valide ist und ob Konfigurationen für dedizierte Verkaufskanäle vorgenommen wurden.",show:"Webhooks anzeigen"}},"sw-payment-card":{deprecated:"Veraltet"}},b={"unzer-payment":{tabTitle:"Unzer Payment",paymentDetails:{history:{cardTitle:"Payment History",column:{type:"Type",amount:"Amount",date:"Date",state:"State"},type:{authorization:"Authorization",charge:"Charging",shipment:"Shipping notification",refund:"Refund",cancellation:"Cancel",default:""}},actions:{reason:{placeholder:"Reason",cancel:"Cancel",credit:"Credit",return:"Return"},chargeButton:"Charge",shipButton:"Shipping notice",refundButton:"Refund",defaultButton:"Done",cancelButton:"Cancel",noActions:"No actions possible",confirmCancelModal:{text:"Do you really want to cancel the authorization of the selected amount?",amountLabel:"Amount:",yesButton:"Yes",noButton:"No"}},detail:{cardTitle:"Payment Details",shortId:"Short-ID",id:"Payment-ID",state:"State",amountRemaining:"Amount (Remaining)",amountCancelled:"Amount (Cancelled)",amountCharged:"Amount (Charged)",descriptor:"Descriptor"},metadata:{cardTitle:"Metadata",column:{key:"Key",value:"Value"}},basket:{cardTitle:"Basket",column:{quantity:"Quantity",title:"Title",amountGross:"Amount (gross)",amountNet:"Amount (net)"}},notifications:{genericErrorMessage:"An error has occurred!",refundSuccessTitle:"Refund",refundSuccessMessage:"The reimbursement was successfully completed.",refundErrorTitle:"Refund",chargeSuccessTitle:"Charge",chargeSuccessMessage:"The collection of the payment was carried out successfully.",chargeErrorTitle:"Charge",shipSuccessTitle:"Shipping notice",shipSuccessMessage:"The shipping notification was successfully sent.",shipErrorTitle:"Shipping notice",invoiceNotFoundMessage:"No invoice was found for this order.",couldNotRetrieveMessage:"The payment details could not be retrieved, please check the log files for more information.",documentDateMissingError:"Document date for invoice is empty.",paymentMissingError:"Payment could not be found",paylaterInvoiceDocumentRequiredErrorMessage:"Please create or upload an invoice for the order first.",cancelSuccessTitle:"Cancel",cancelErrorTitle:"Cancel",cancelSuccessMessage:"The reversal was successfully completed.",cancelErrorMessage:"The reversal could not be performed."}},"order-list":{transactionId:"Unzer transaction ID"},methods:{paylaterInvoice:{main:"Invoice","b2b-eur":"Invoice B2B EUR","b2b-chf":"Invoice B2B CHF","b2c-eur":"Invoice B2C EUR","b2c-chf":"Invoice B2C CHF"},paylaterInstallment:{main:"Installment","b2c-eur":"Installment B2C EUR","b2c-chf":"Installment B2C CHF"},paylaterDirectDebitSecured:{main:"Direct Debit","b2c-eur":"Direct Debit B2C EUR"}}},"unzer-payment-settings":{subheadings:{paymentSettingsBookingModes:"Booking Modes",paymentSettingsSaveDevices:"Save Payment Details",paymentSettingsExpressCheckout:"Express Checkout"},module:{title:"Unzer Payment",description:"Unzer Payment"},"google-pay":{gatewayMerchantId:"Gateway Merchant ID"},form:{message:{success:{title:"Test succeeded",message:"The provided credentials are valid!"},error:{title:"Test failed",message:"API Credentials are invalid, please correct them and try again!"}},testButton:"Test API credentials",webhookButton:"Register webhooks",privateKey:"Private Key",publicKey:"Public Key",additionalKeys:"API Keys for additional payment methods",additionalKeysHelpText:"If additional keypairs fields are empty, main keypairs will be inherited by default."},modal:{close:"Close",webhook:{title:"Webhooks",httpsInfo:"Only one HTTPS domain per sales channel can be registered.",registered:"Webhook is already registered",placeholder:"Please select a domain",submit:{register:"Register webhooks",clear:"Select items to clear | Clear selected webhook | Clear {count} webhooks"}}},webhook:{messagePrefix:"Domain: ",register:{done:"Webhook registered | Webhooks registered",error:"Webhook could not be registered | Webhooks could not be registered"},clear:{done:"Webhook cleared | Webhooks cleared",error:"Webhook could not be cleared | Webhooks could not be cleared"},missing:{fields:"Some mandatory fields are missing",context:"The context could not be refreshed",selection:"No domain was selected"},notFound:{salesChannelDomain:"The selected domain could not be found"},globalError:{title:"An error has occurred!",message:"Please contact us for more information"},empty:"There are no webhooks registered for this private key. Make sure the private key is valid and check for other specific sales channel configurations.",show:"Show webhooks"}},"sw-payment-card":{deprecated:"Deprecated"}},{Module:de}=Shopware,ue={type:"plugin",name:"UnzerPayment",title:"unzer-payment-settings.module.title",description:"unzer-payment-settings.module.description",version:"1.1.0",targetVersion:"1.1.0",snippets:{"de-DE":f,"en-GB":b},routes:{settings:{component:"unzer-payment-settings",path:"settings",meta:{parentPath:"sw.settings.index"}}},extensionEntryRoute:{extensionName:"UnzerPayment6",route:"unzer.payment.configuration.settings"},settingsItem:{name:"unzer-payment-configuration",to:"unzer.payment.configuration.settings",label:"unzer-payment-settings.module.title",group:"plugins",iconComponent:"unzer-payment-plugin-icon",backgroundEnabled:!1}};de.register("unzer-payment-configuration",ue);const{Application:y}=Shopware,r=Shopware.Classes.ApiService;class me extends r{constructor(t,n,a="unzer-payment"){super(t,n,a)}fetchPaymentDetails(t){const n=`_action/${this.getApiBasePath()}/transaction/${t}/details`;return this.httpClient.get(n,{headers:this.getBasicHeaders()}).then(a=>r.handleResponse(a))}chargeTransaction(t,n,a){const s=`_action/${this.getApiBasePath()}/transaction/${t}/charge/${a}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(i=>r.handleResponse(i))}refundTransaction(t,n,a,s=null){let i=`_action/${this.getApiBasePath()}/transaction/${t}/refund/${n}/${a}`;return s!==null&&(i=`${i}/${s}`),this.httpClient.get(i,{headers:this.getBasicHeaders()}).then(k=>r.handleResponse(k))}cancelTransaction(t,n,a){const s=`_action/${this.getApiBasePath()}/transaction/${t}/cancel/${n}/${a}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(i=>r.handleResponse(i))}ship(t){const n=`_action/${this.getApiBasePath()}/transaction/${t}/ship`;return this.httpClient.get(n,{headers:this.getBasicHeaders()}).then(a=>r.handleResponse(a))}}y.addServiceProvider("UnzerPaymentService",e=>{const t=y.getContainer("init");return new me(t.httpClient,e.loginService)});const{Application:g}=Shopware,o=Shopware.Classes.ApiService;class he extends o{constructor(t,n,a="unzer-payment"){super(t,n,a)}validateCredentials(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/validate-credentials`,t,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}registerWebhooks(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/register-webhooks`,t,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}clearWebhooks(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/clear-webhooks`,t,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}getWebhooks(t){return this.httpClient.post(`_action/${this.getApiBasePath()}/get-webhooks`,{privateKey:t},{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}getGooglePayGatewayMerchantId(t){return this.httpClient.get(`_action/${this.getApiBasePath()}/get-google-pay-gateway-merchant-id?salesChannelId=${t||""}`,{headers:this.getBasicHeaders()}).then(n=>o.handleResponse(n))}}g.addServiceProvider("UnzerPaymentConfigurationService",e=>{const t=g.getContainer("init");return new he(t.httpClient,e.loginService)});const pe=`{% block sw_payment_card_description %}
{{ $tc('sw-payment-card.deprecated') }}
{% endblock %}`;Shopware.Component.override("sw-payment-card",{template:pe,snippets:{"de-DE":f,"en-GB":b}}); +//# sourceMappingURL=unzer-payment6-BVnPNgB2.js.map diff --git a/src/Resources/public/administration/assets/unzer-payment6-BVnPNgB2.js.map b/src/Resources/public/administration/assets/unzer-payment6-BVnPNgB2.js.map new file mode 100644 index 00000000..1420e50a --- /dev/null +++ b/src/Resources/public/administration/assets/unzer-payment6-BVnPNgB2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unzer-payment6-BVnPNgB2.js","sources":["../../../app/administration/src/module/unzer-payment/component/unzer-payment-actions/unzer-payment-actions.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-actions/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-detail/unzer-payment-detail.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-detail/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-history/unzer-payment-history.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-history/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-metadata/unzer-payment-metadata.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-metadata/index.js","../../../app/administration/src/module/unzer-payment/component/unzer-payment-basket/unzer-payment-basket.html.twig","../../../app/administration/src/module/unzer-payment/component/unzer-payment-basket/index.js","../../../app/administration/src/module/unzer-payment/extension/sw-order-create-details-footer/sw-order-create-details-footer.html.twig","../../../app/administration/src/module/unzer-payment/extension/sw-order-create-details-footer/index.js","../../../app/administration/src/module/unzer-payment/extension/sw-order-detail/sw-order-detail.html.twig","../../../app/administration/src/module/unzer-payment/extension/sw-order-detail/index.js","../../../app/administration/src/module/unzer-payment/extension/sw-order-list/sw-order-list.html.twig","../../../app/administration/src/module/unzer-payment/extension/sw-order-list/index.js","../../../app/administration/src/module/unzer-payment/page/unzer-payment-tab/unzer-payment-tab.html.twig","../../../app/administration/src/module/unzer-payment/page/unzer-payment-tab/index.js","../../../app/administration/src/module/unzer-payment/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/register-webhook/register-webhook.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/register-webhook/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-webhooks-modal/unzer-webhooks-modal.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-webhooks-modal/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-entity-single-select-delivery-status/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-entity-multi-select-delivery-status/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-google-pay-gateway-merchant-id/unzer-google-pay-gateway-merchant-id.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-google-pay-gateway-merchant-id/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-payment-plugin-icon/unzer-payment-plugin-icon.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-payment-plugin-icon/index.js","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-settings-subheading/unzer-settings-subheading.html.twig","../../../app/administration/src/module/unzer-payment-configuration/component/unzer-settings-subheading/index.js","../../../app/administration/src/module/unzer-payment-configuration/extension/sw-system-config/index.js","../../../app/administration/src/module/unzer-payment-configuration/page/unzer-payment-settings/unzer-payment-settings.html.twig","../../../app/administration/src/module/unzer-payment-configuration/page/unzer-payment-settings/index.js","../../../app/administration/src/module/unzer-payment-configuration/index.js","../../../app/administration/src/api/unzer-payment.service.js","../../../app/administration/src/api/unzer-payment-configuration.service.js","../../../app/administration/src/extension/sw-payment-card/sw-payment-card.html.twig","../../../app/administration/src/extension/sw-payment-card/index.js"],"sourcesContent":["{% block unzer_payment_actions %}\n \n {% block unzer_payment_actions_amount_field %}\n
\n \n \n
\n {% endblock %}\n
\n \n {% block unzer_payment_actions_charge_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.chargeButton') }}\n \n {% endblock %}\n\n {% block unzer_payment_actions_cancel_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.cancelButton') }}\n \n {% endblock %}\n \n \n {% block unzer_payment_actions_reason_field %}\n \n \n {% endblock %}\n\n {% block unzer_payment_actions_refund_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.refundButton') }}\n \n {% endblock %}\n \n {% block unzer_payment_actions_button_container_inner %}{% endblock %}\n
\n \n\n
\n {{ $tc('unzer-payment.paymentDetails.actions.noActions') }}\n
\n{% endblock %}","import template from './unzer-payment-actions.html.twig';\nimport './unzer-payment-actions.scss';\n\nconst { Component, Mixin } = Shopware;\nconst reasonCodes = {\n CANCEL: 'CANCEL',\n RETURN: 'RETURN',\n CREDIT: 'CREDIT',\n};\n\nComponent.register('unzer-payment-actions', {\n template,\n\n inject: ['UnzerPaymentService'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n isLoading: false,\n isSuccessful: false,\n transactionAmount: 0.0,\n reasonCode: null,\n };\n },\n\n props: {\n transactionResource: {\n type: Object,\n required: true,\n },\n\n paymentResource: {\n type: Object,\n required: true,\n },\n\n decimalPrecision: {\n type: Number,\n required: true,\n default: 4,\n },\n },\n\n computed: {\n isChargePossible: function () {\n return (\n this.transactionResource.type === 'authorization' &&\n this.transactionResource.state !== 'error'\n );\n },\n\n isRefundPossible: function () {\n return (\n this.transactionResource.type === 'charge' &&\n this.transactionResource.state !== 'error' &&\n !(\n this.transactionResource.isFirst &&\n this.paymentResource.paymentMethodId ===\n '085b64d0028a8bd447294e03c4eb411a' &&\n this.paymentResource.state.name !== 'pending' &&\n this.paymentResource.state.name !== 'partly'\n )\n );\n },\n\n maxTransactionAmount() {\n let amount = 0;\n\n let isAmountForPrepaymentRefund =\n this.isRefundPossible &&\n this.paymentResource.paymentMethodId ===\n '085b64d0028a8bd447294e03c4eb411a';\n\n if (this.isRefundPossible) {\n amount = this.transactionResource.amount;\n }\n\n if (this.isChargePossible) {\n amount = this.paymentResource.amount.remaining;\n }\n\n if ('remainingAmount' in this.transactionResource) {\n amount = this.transactionResource.remainingAmount;\n }\n\n if (\n this.transactionResource.isFirst &&\n isAmountForPrepaymentRefund\n ) {\n amount = this.paymentResource.amount.remaining;\n }\n\n return amount / 10 ** this.paymentResource.amount.decimalPrecision;\n },\n\n reasonCodeSelection() {\n return [\n {\n label: this.$tc(\n 'unzer-payment.paymentDetails.actions.reason.cancel'\n ),\n value: reasonCodes.CANCEL,\n },\n {\n label: this.$tc(\n 'unzer-payment.paymentDetails.actions.reason.credit'\n ),\n value: reasonCodes.CREDIT,\n },\n {\n label: this.$tc(\n 'unzer-payment.paymentDetails.actions.reason.return'\n ),\n value: reasonCodes.RETURN,\n },\n ];\n },\n },\n\n created() {\n this.transactionAmount = this.maxTransactionAmount;\n },\n\n methods: {\n charge() {\n this.isLoading = true;\n\n this.UnzerPaymentService.chargeTransaction(\n this.paymentResource.orderTransactionId,\n this.transactionResource.id,\n this.transactionAmount\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.chargeSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.chargeSuccessMessage'\n ),\n });\n\n this.isSuccessful = true;\n\n this.$emit('reload');\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n );\n }\n\n if (message === 'paylater-invoice-document-required') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.paylaterInvoiceDocumentRequiredErrorMessage'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.chargeErrorTitle'\n ),\n message: message,\n });\n\n this.isLoading = false;\n });\n },\n\n refund() {\n this.isLoading = true;\n\n this.UnzerPaymentService.refundTransaction(\n this.paymentResource.orderTransactionId,\n this.transactionResource.id,\n this.transactionAmount,\n this.reasonCode\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.refundSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.refundSuccessMessage'\n ),\n });\n\n this.isSuccessful = true;\n\n this.$emit('reload');\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.refundErrorTitle'\n ),\n message: message,\n });\n\n this.isLoading = false;\n });\n },\n\n startCancel() {\n this.$emit('cancel', this.transactionAmount);\n },\n },\n});\n","{% block unzer_payment_detail %}\n \n
\n {% block unzer_payment_detail_container %}\n \n {% block unzer_payment_detail_container_left %}\n \n
\n {{ $tc('unzer-payment.paymentDetails.detail.amountRemaining') }}\n
\n
\n {{ formatCurrency(remainingAmount) }}\n
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.amountCancelled') }}\n
\n
\n {{ formatCurrency(cancelledAmount) }}\n
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.amountCharged') }}\n
\n
\n {{ formatCurrency(chargedAmount) }}\n
\n {% block unzer_payment_detail_container_left_inner %}{% endblock %}\n
\n {% endblock %}\n\n {% block unzer_payment_detail_container_right %}\n \n
\n {{ $tc('unzer-payment.paymentDetails.detail.shortId') }}\n
\n
{{ paymentResource.shortId }}
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.id') }}\n
\n
{{ paymentResource.id }}
\n
\n {{ $tc('unzer-payment.paymentDetails.detail.state') }}\n
\n
\n {{ paymentResource.state.name }}\n
\n \n
\n {{ $tc('unzer-payment.paymentDetails.detail.descriptor') }}\n
\n
\n {{ paymentResource.descriptor }}\n
\n \n {% block unzer_payment_detail_container_right_inner %}{% endblock %}\n
\n {% endblock %}\n \n {% endblock %}\n
\n {% block unzer_payment_detail_footer %}\n \n {% block unzer_payment_detail_ship_button %}\n \n {{ $tc('unzer-payment.paymentDetails.actions.shipButton') }}\n \n {% endblock %}\n \n {% endblock %}\n \n{% endblock %}","import template from './unzer-payment-detail.html.twig';\n\nconst { Component, Mixin, Module } = Shopware;\n\nComponent.register('unzer-payment-detail', {\n template,\n\n inject: ['UnzerPaymentService'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n isLoading: false,\n isSuccessful: false,\n paylaterPaymentMethods: [\n '09588ffee8064f168e909ff31889dd7f', // see \\UnzerPayment6\\Installer\\PaymentInstaller::PAYMENT_ID_PAYLATER_INVOICE\n '12fbfbce271a43a89b3783453b88e9a6', // see \\UnzerPayment6\\Installer\\PaymentInstaller::PAYMENT_ID_PAYLATER_INSTALLMENT\n '6d6adcd4b7bf40499873c294a85f32ed', // see \\UnzerPayment6\\Installer\\PaymentInstaller::PAYMENT_ID_PAYLATER_DIRECT_DEBIT_SECURED\n ],\n };\n },\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n unzerMaxDigits() {\n const unzerPaymentModule =\n Module.getModuleRegistry().get('unzer-payment');\n\n if (!unzerPaymentModule || !unzerPaymentModule.manifest) {\n return 4;\n }\n\n return unzerPaymentModule.manifest.maxDigits;\n },\n\n remainingAmount() {\n if (!this.paymentResource || !this.paymentResource.amount) {\n return 0;\n }\n\n return this.formatAmount(\n this.paymentResource.amount.remaining,\n this.paymentResource.amount.decimalPrecision\n );\n },\n\n cancelledAmount() {\n if (!this.paymentResource || !this.paymentResource.amount) {\n return 0;\n }\n\n return this.formatAmount(\n this.paymentResource.amount.cancelled,\n this.paymentResource.amount.decimalPrecision\n );\n },\n\n chargedAmount() {\n if (!this.paymentResource || !this.paymentResource.amount) {\n return 0;\n }\n\n return this.formatAmount(\n this.paymentResource.amount.charged,\n this.paymentResource.amount.decimalPrecision\n );\n },\n },\n\n methods: {\n reloadOrderDetail() {\n this.$emit('reloadOrderDetails');\n },\n\n ship() {\n this.isLoading = true;\n\n this.UnzerPaymentService.ship(\n this.paymentResource.orderTransactionId\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.shipSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.shipSuccessMessage'\n ),\n });\n\n this.isSuccessful = true;\n\n this.$emit('reload');\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n );\n } else if (message === 'invoice-missing-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.invoiceNotFoundMessage'\n );\n } else if (message === 'documentdate-missing-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.documentDateMissingError'\n );\n } else if (message === 'payment-missing-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.paymentMissingError'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.shipErrorTitle'\n ),\n message: message,\n });\n\n this.isLoading = false;\n });\n },\n\n formatAmount(cents, decimalPrecision) {\n return (\n cents / 10 ** Math.min(this.unzerMaxDigits, decimalPrecision)\n );\n },\n\n formatCurrency(value) {\n return Shopware.Utils.format.currency(\n value || 0.0,\n this.paymentResource.currency\n );\n },\n\n isPaylaterPaymentMethod(paymentMethodId) {\n return this.paylaterPaymentMethods.indexOf(paymentMethodId) >= 0;\n },\n },\n});\n","{% block unzer_payment_history %}\n \n {% block unzer_payment_history_container %}\n \n {% endblock %}\n \n{% endblock %}","import template from './unzer-payment-history.html.twig';\n\nconst { Component, Module, Mixin } = Shopware;\n\nComponent.register('unzer-payment-history', {\n template,\n\n inject: ['repositoryFactory', 'UnzerPaymentService'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n showCancelModal: false,\n isCancelLoading: false,\n cancelAmount: 0,\n };\n },\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n unzerMaxDigits() {\n const unzerPaymentModule =\n Module.getModuleRegistry().get('unzer-payment');\n\n if (!unzerPaymentModule || !unzerPaymentModule.manifest) {\n return 4;\n }\n\n return unzerPaymentModule.manifest.maxDigits;\n },\n\n orderTransactionRepository: function () {\n return this.repositoryFactory.create('order_transaction');\n },\n\n decimalPrecision() {\n if (\n !this.paymentResource ||\n !this.paymentResource.amount ||\n !this.paymentResource.amount.decimalPrecision\n ) {\n return this.unzerMaxDigits;\n }\n\n return Math.min(\n this.unzerMaxDigits,\n this.paymentResource.amount.decimalPrecision\n );\n },\n\n data: function () {\n const data = [];\n\n Object.values(this.paymentResource.transactions).forEach(\n (transaction) => {\n // const amount = this.$options.filters.currency(\n // this.formatAmount(parseFloat(transaction.amount), this.decimalPrecision),\n // this.paymentResource.currency\n // );\n const amount = this.formatCurrency(\n this.formatAmount(\n parseFloat(transaction.amount),\n this.decimalPrecision\n )\n );\n const date = Shopware.Filter.getByName('date')(\n transaction.date,\n {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n }\n );\n\n data.push({\n type: this.transactionTypeRenderer(transaction.type),\n amount: amount,\n date: date,\n state: transaction.state || '',\n resource: transaction,\n });\n }\n );\n\n return data;\n },\n\n columns: function () {\n return [\n {\n property: 'type',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.type'\n ),\n rawData: true,\n },\n {\n property: 'amount',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.amount'\n ),\n rawData: true,\n },\n {\n property: 'date',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.date'\n ),\n rawData: true,\n },\n {\n property: 'state',\n label: this.$tc(\n 'unzer-payment.paymentDetails.history.column.state'\n ),\n rawData: true,\n },\n ];\n },\n },\n\n methods: {\n transactionTypeRenderer: function (value) {\n switch (value) {\n case 'authorization':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.authorization'\n );\n case 'charge':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.charge'\n );\n case 'shipment':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.shipment'\n );\n case 'refund':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.refund'\n );\n case 'cancellation':\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.cancellation'\n );\n default:\n return this.$tc(\n 'unzer-payment.paymentDetails.history.type.default'\n );\n }\n },\n\n reload: function () {\n this.$emit('reload');\n this.$emit('reloadOrderDetails');\n },\n\n formatAmount(cents, decimalPrecision) {\n return cents / 10 ** decimalPrecision;\n },\n\n openCancelModal(item, cancelAmount) {\n this.showCancelModal = item.resource.id;\n this.cancelAmount = cancelAmount;\n },\n\n closeCancelModal() {\n this.showCancelModal = false;\n this.cancelAmount = 0;\n },\n\n cancel() {\n this.isCancelLoading = true;\n\n this.UnzerPaymentService.cancelTransaction(\n this.paymentResource.orderTransactionId,\n this.paymentResource.id,\n this.cancelAmount\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelSuccessTitle'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelSuccessMessage'\n ),\n });\n\n this.reload();\n })\n .catch((errorResponse) => {\n let message = errorResponse.response.data.errors[0];\n\n if (message === 'generic-error') {\n message = this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelErrorMessage'\n );\n }\n\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.cancelErrorTitle'\n ),\n message: message,\n });\n\n this.isCancelLoading = false;\n this.reload();\n });\n },\n formatCurrency(value) {\n return Shopware.Utils.format.currency(\n value || 0.0,\n this.paymentResource.currency\n );\n },\n },\n});\n","{% block unzer_payment_metadata %}\n \n \n \n{% endblock %}","import template from './unzer-payment-metadata.html.twig';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-payment-metadata', {\n template,\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n data: function () {\n const data = [];\n\n this.paymentResource.metadata.forEach((meta) => {\n data.push({\n key: meta.key,\n value: meta.value,\n });\n });\n\n return data;\n },\n\n columns: function () {\n return [\n {\n property: 'key',\n label: this.$tc(\n 'unzer-payment.paymentDetails.metadata.column.key'\n ),\n rawData: true,\n },\n {\n property: 'value',\n label: this.$tc(\n 'unzer-payment.paymentDetails.metadata.column.value'\n ),\n rawData: true,\n },\n ];\n },\n },\n});\n","{% block unzer_payment_basket %}\n \n \n \n{% endblock %}","import template from './unzer-payment-basket.html.twig';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-payment-basket', {\n template,\n\n props: {\n paymentResource: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n data: function () {\n const data = [];\n\n this.paymentResource.basket.basketItems.forEach((basketItem) => {\n let amountGross = this.formatCurrency(\n parseFloat(basketItem.amountGross.toFixed(2))\n );\n let amountNet = this.formatCurrency(\n parseFloat(basketItem.amountNet.toFixed(2))\n );\n\n if (basketItem.amountDiscount > 0) {\n amountGross = this.formatCurrency(\n parseFloat(basketItem.amountDiscount.toFixed(2)) * -1\n );\n\n amountNet = this.formatCurrency(\n parseFloat(\n (\n basketItem.amountDiscount - basketItem.amountVat\n ).toFixed(2)\n ) * -1\n );\n }\n\n data.push({\n quantity: basketItem.quantity,\n title: basketItem.title,\n amountGross: amountGross,\n amountNet: amountNet,\n });\n });\n\n return data;\n },\n\n columns: function () {\n return [\n {\n property: 'quantity',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.quantity'\n ),\n rawData: true,\n },\n {\n property: 'title',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.title'\n ),\n rawData: true,\n },\n {\n property: 'amountGross',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.amountGross'\n ),\n rawData: true,\n },\n {\n property: 'amountNet',\n label: this.$tc(\n 'unzer-payment.paymentDetails.basket.column.amountNet'\n ),\n rawData: true,\n },\n ];\n },\n },\n methods: {\n formatCurrency(value) {\n return Shopware.Utils.format.currency(\n value || 0.0,\n this.paymentResource.currency\n );\n },\n },\n});\n","{% block sw_order_create_details_footer_payment_method %}\n \n{% endblock %}","import template from './sw-order-create-details-footer.html.twig';\n\nconst { Criteria } = Shopware.Data;\nconst unzerPaymentIds = [\n 'bc4c2cbfb5fda0bf549e4807440d0a54', //PAYMENT_ID_ALIPAY\n '4673044aff79424a938d42e9847693c3', //PAYMENT_ID_CREDIT_CARD\n '713c7a332b432dcd4092701eda522a7e', //PAYMENT_ID_DIRECT_DEBIT\n '5123af5ce94a4a286641973e8de7eb60', //PAYMENT_ID_DIRECT_DEBIT_SECURED\n '17830aa7e6a00b99eab27f0e45ac5e0d', //PAYMENT_ID_EPS\n '4ebb99451f36ba01f13d5871a30bce2c', //PAYMENT_ID_FLEXIPAY\n 'd4b90a17af62c1bb2f6c3b1fed339425', //PAYMENT_ID_GIROPAY\n '4b9f8d08b46a83839fd0eb14fe00efe6', //PAYMENT_ID_INSTALLMENT_SECURED\n '08fb8d9a72ab4ca62b811e74f2eca79f', //PAYMENT_ID_INVOICE\n '6cc3b56ce9b0f80bd44039c047282a41', //PAYMENT_ID_INVOICE_SECURED\n '614ad722a03ee96baa2446793143215b', //PAYMENT_ID_IDEAL\n '409fe641d6d62a4416edd6307d758791', //PAYMENT_ID_PAYPAL\n '085b64d0028a8bd447294e03c4eb411a', //PAYMENT_ID_PRE_PAYMENT\n 'cd6f59d572e6c90dff77a48ce16b44db', //PAYMENT_ID_PRZELEWY24\n 'fd96d03535a46d197f5adac17c9f8bac', //PAYMENT_ID_WE_CHAT\n '09588ffee8064f168e909ff31889dd7f', //PAYMENT_ID_PAYLATER_INVOICE\n];\n\nShopware.Component.override('sw-order-create-details-footer', {\n template,\n\n computed: {\n paymentMethodCriteria() {\n /** @var {Criteria} paymentCriteria */\n const criteria = new Criteria();\n\n if (this.salesChannelId) {\n criteria.addFilter(\n Criteria.equals('salesChannels.id', this.salesChannelId)\n );\n }\n\n criteria.addFilter(\n Criteria.not('AND', [Criteria.equalsAny('id', unzerPaymentIds)])\n );\n\n return criteria;\n },\n },\n});\n","{% block sw_order_detail_content_tabs_general %}\n {% parent() %}\n\n {% block unzer_payment_payment_tab %}\n \n {{ $tc('unzer-payment.tabTitle') }}\n \n {% endblock %}\n{% endblock %}","import template from './sw-order-detail.html.twig';\n\nconst { Component, Context } = Shopware;\nconst { Criteria } = Shopware.Data;\n\nComponent.override('sw-order-detail', {\n template,\n\n data() {\n return {\n isUnzerPayment: false,\n };\n },\n\n computed: {\n showTabs() {\n return true; // TODO remove with PT-10455\n },\n },\n\n watch: {\n orderId: {\n deep: true,\n handler() {\n if (!this.orderId) {\n this.isUnzerPayment = false;\n\n return;\n }\n\n const orderRepository = this.repositoryFactory.create('order');\n const orderCriteria = new Criteria(1, 1);\n orderCriteria.addAssociation('transactions');\n\n orderRepository\n .get(this.orderId, Context.api, orderCriteria)\n .then((order) => {\n order.transactions.forEach((orderTransaction) => {\n if (!orderTransaction.customFields) {\n return;\n }\n\n if (\n !orderTransaction.customFields\n .unzer_payment_is_transaction &&\n !orderTransaction.customFields\n .heidelpay_is_transaction\n ) {\n return;\n }\n\n this.isUnzerPayment = true;\n });\n });\n },\n immediate: true,\n },\n },\n});\n","{% block sw_order_list_grid_columns %}\n {% parent() %}\n\n {% block unzer_payment_column_transaction %}\n \n {% endblock %}\n{% endblock %}","import template from './sw-order-list.html.twig';\n\nShopware.Component.override('sw-order-list', {\n template,\n\n methods: {\n getOrderColumns() {\n const baseColumns = this.$super('getOrderColumns');\n\n baseColumns.splice(1, 0, {\n property: 'unzerPaymentTransactionId',\n label: 'unzer-payment.order-list.transactionId',\n allowResize: true,\n });\n\n return baseColumns;\n },\n },\n});\n","{% block unzer_payment_payment_details %}\n
\n
\n {% block unzer_payment_payment_details_content %}\n \n {% endblock %}\n
\n \n
\n{% endblock %}","import template from './unzer-payment-tab.html.twig';\n\nconst { Component, Context, Mixin } = Shopware;\nconst { Criteria } = Shopware.Data;\n\nComponent.register('unzer-payment-tab', {\n template,\n\n inject: ['UnzerPaymentService', 'repositoryFactory'],\n\n mixins: [Mixin.getByName('notification')],\n\n data() {\n return {\n paymentResources: [],\n loadedResources: 0,\n isLoading: true,\n order: null,\n };\n },\n\n created() {\n this.createdComponent();\n },\n\n computed: {\n orderRepository() {\n return this.repositoryFactory.create('order');\n },\n },\n\n watch: {\n $route() {\n this.resetDataAttributes();\n this.createdComponent();\n },\n },\n\n methods: {\n createdComponent() {\n this.loadData();\n },\n\n resetDataAttributes() {\n this.paymentResources = [];\n this.loadedResources = 0;\n this.isLoading = true;\n },\n\n reloadPaymentDetails() {\n this.resetDataAttributes();\n this.loadData();\n },\n\n loadData() {\n const orderId = this.$route.params.id;\n const criteria = new Criteria();\n criteria\n .addAssociation('currency')\n .addAssociation('lineItems.promotion')\n .getAssociation('transactions')\n .addSorting(Criteria.sort('createdAt', 'DESC'));\n\n this.orderRepository\n .get(orderId, Context.api, criteria)\n .then((order) => {\n this.order = order;\n\n if (!order.transactions) {\n return;\n }\n\n order.transactions.forEach((orderTransaction, index) => {\n if (!orderTransaction.customFields) {\n this.loadedResources++;\n\n return;\n }\n\n if (\n !orderTransaction.customFields\n .unzer_payment_is_transaction &&\n !orderTransaction.customFields\n .heidelpay_is_transaction\n ) {\n this.loadedResources++;\n\n return;\n }\n\n this.UnzerPaymentService.fetchPaymentDetails(\n orderTransaction.id\n )\n .then((response) => {\n this.paymentResources[index] = response;\n this.paymentResources[\n index\n ].orderTransactionId = orderTransaction.id;\n this.loadedResources++;\n\n this.isLoading =\n this.order.transactions.length !==\n this.loadedResources;\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment.paymentDetails.notifications.genericErrorMessage'\n ),\n message: this.$tc(\n 'unzer-payment.paymentDetails.notifications.couldNotRetrieveMessage'\n ),\n });\n\n this.isLoading = false;\n });\n });\n });\n },\n\n reloadOrderDetails() {\n //we cannot know, when the webhook is called, but 5 seconds should be enough to wait for most cases\n setTimeout(() => {\n this.findOrderDetailComponentAndReInit();\n }, 5000);\n },\n\n async findOrderDetailComponentAndReInit(base = this) {\n const componentName = 'sw-order-detail';\n const parent = base.$parent;\n\n if (parent === undefined) {\n return null;\n }\n\n if (parent.$options.name !== componentName) {\n return this.findOrderDetailComponentAndReInit(parent);\n }\n\n if (parent.isOrderEditing) {\n return null;\n }\n\n // we reinitialize the orderDetail component, because there is no other way to update it is not updating the order state\n parent.createdComponent();\n },\n },\n});\n","import './component/unzer-payment-actions';\nimport './component/unzer-payment-detail';\nimport './component/unzer-payment-history';\nimport './component/unzer-payment-metadata';\nimport './component/unzer-payment-basket';\nimport './extension/sw-order-create-details-footer';\nimport './extension/sw-order-detail';\nimport './extension/sw-order-list';\nimport './page/unzer-payment-tab';\n\nconst { Module } = Shopware;\n\nModule.register('unzer-payment', {\n type: 'plugin',\n name: 'UnzerPayment',\n title: 'unzer-payment.general.title',\n description: 'unzer-payment.general.descriptionTextModule',\n version: '0.0.1',\n targetVersion: '0.0.1',\n maxDigits: 4,\n\n routeMiddleware(next, currentRoute) {\n if (currentRoute.name === 'sw.order.detail') {\n currentRoute.children.push({\n component: 'unzer-payment-tab',\n name: 'unzer-payment.payment.detail',\n path: '/sw/order/detail/:id/unzer-payment',\n isChildren: true,\n meta: {\n parentPath: 'sw.order.index',\n },\n });\n }\n\n next(currentRoute);\n },\n});\n","{% block unzer_payment_payment_register_webhook %}\n
\n {% block unzer_payment_payment_register_webhook_button %}\n \n {{ $tc('unzer-payment-settings.form.webhookButton') }}\n \n {% endblock %}\n\n {% block unzer_payment_payment_register_webhook_modal %}\n \n \n\n \n \n {% endblock %}\n
\n{% endblock %}","import template from './register-webhook.html.twig';\nimport './style.scss';\n\nconst Criteria = Shopware.Data.Criteria;\n\nShopware.Component.register('unzer-payment-register-webhook', {\n template,\n\n mixins: [Shopware.Mixin.getByName('notification')],\n\n inject: ['repositoryFactory', 'UnzerPaymentConfigurationService'],\n\n props: {\n webhooks: {\n type: Array,\n required: true,\n },\n isLoading: {\n type: Boolean,\n required: false,\n },\n selectedSalesChannelId: {\n type: String,\n required: false,\n },\n privateKey: {\n type: String,\n required: true,\n },\n isDisabled: {\n type: Boolean,\n required: false,\n },\n },\n\n computed: {\n salesChannelRepository() {\n return this.repositoryFactory.create('sales_channel');\n },\n },\n\n data() {\n return {\n isModalActive: false,\n isRegistering: false,\n isRegistrationSuccessful: false,\n isDataLoading: false,\n selection: {},\n selectedDomain: null,\n entitySelection: {},\n salesChannels: {},\n };\n },\n\n created() {\n this.createdComponent();\n },\n\n methods: {\n createdComponent() {\n this.loadData();\n },\n\n loadData(page, limit) {\n let me = this;\n\n this.isDataLoading = true;\n\n let criteria = new Criteria(page, limit);\n criteria.addAssociation('domains');\n\n this.salesChannelRepository\n .search(criteria, Shopware.Context.api)\n .then((result) => {\n me.salesChannels = result;\n me.isDataLoading = false;\n });\n },\n\n onPageChange(args) {\n this.loadData(args.page, args.limit);\n },\n\n openModal() {\n this.$emit('modal-open');\n this.isModalActive = true;\n },\n\n closeModal() {\n this.isModalActive = false;\n },\n\n registerWebhooks() {\n const me = this;\n this.isRegistrationSuccessful = false;\n this.isRegistering = true;\n\n this.UnzerPaymentConfigurationService.registerWebhooks({\n selection: this.entitySelection,\n })\n .then((response) => {\n me.isRegistrationSuccessful = true;\n\n if (undefined !== response) {\n me.messageGeneration(response);\n }\n\n this.$emit('webhook-registered', response);\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment-settings.webhook.globalError.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.webhook.globalError.message'\n ),\n });\n })\n .finally(() => {\n me.isRegistering = false;\n });\n },\n\n onRegistrationFinished() {\n this.isRegistrationSuccessful = false;\n this.selection = {};\n },\n\n onSelectItem(domainId, domain) {\n if (!domain) {\n return;\n }\n\n domain['privateKey'] = this.privateKey;\n\n this.entitySelection[domain.salesChannelId] = domain;\n },\n\n messageGeneration(data) {\n const domainAmount = data.length;\n\n Object.keys(data).forEach((domain) => {\n if (data[domain].success) {\n this.createNotificationSuccess({\n title: this.$tc(data[domain].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + domain,\n });\n } else {\n this.createNotificationError({\n title: this.$tc(data[domain].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + domain,\n });\n }\n });\n },\n\n isWebhookRegisteredForSalesChannel(salesChannelId) {\n let result = false;\n\n const salesChannel = this.getSalesChannelById(salesChannelId);\n\n if (!this.webhooks.length) {\n return false;\n }\n\n salesChannel.domains.forEach((domain) => {\n this.webhooks.forEach((webhook) => {\n if (webhook.url.indexOf(domain.url) > -1) {\n result = true;\n return true;\n }\n });\n });\n\n return result;\n },\n\n getSalesChannelById(salesChannelId) {\n let result = null;\n\n this.salesChannels.forEach((salesChannel) => {\n if (salesChannel.id === salesChannelId) {\n result = salesChannel;\n return true;\n }\n });\n\n return result;\n },\n\n getSalesChannelDomainCriteria(salesChannelId) {\n let criteria = new Criteria();\n\n criteria.addFilter(Criteria.prefix('url', 'https://'));\n criteria.addFilter(\n Criteria.equals('salesChannelId', salesChannelId)\n );\n\n return criteria;\n },\n },\n});\n","\n \n {{ $tc('unzer-payment-settings.webhook.empty') }}\n \n
\n \n \n \n {{ $tc('unzer-payment-settings.modal.webhook.submit.clear', webhookSelectionLength, {count: webhookSelectionLength}) }}\n \n
\n","import template from './unzer-webhooks-modal.html.twig';\n\nconst { Component, Mixin, Context } = Shopware;\n\nComponent.register('unzer-webhooks-modal', {\n template,\n\n mixins: [Mixin.getByName('notification')],\n\n inject: ['UnzerPaymentConfigurationService'],\n\n props: {\n keyPair: {\n type: Array,\n required: true,\n },\n webhooks: {\n type: Array,\n required: true,\n },\n isLoadingWebhooks: {\n type: Boolean,\n },\n },\n\n data() {\n return {\n isClearing: false,\n isClearingSuccessful: false,\n webhookSelection: null,\n webhookSelectionLength: 0,\n };\n },\n\n computed: {\n webhookColumns() {\n return [\n {\n property: 'event',\n dataIndex: 'event',\n label: 'Event',\n },\n {\n property: 'url',\n dataIndex: 'url',\n label: 'URL',\n },\n ];\n },\n },\n\n methods: {\n clearWebhooks(privateKey) {\n const me = this;\n this.isClearingSuccessful = false;\n this.isClearing = true;\n this.isLoading = true;\n\n this.UnzerPaymentConfigurationService.clearWebhooks({\n privateKey: privateKey,\n selection: this.webhookSelection,\n })\n .then((response) => {\n me.isClearingSuccessful = true;\n me.webhookSelection = [];\n me.webhookSelectionLength = 0;\n\n me.$refs.webhookDataGrid.resetSelection();\n\n me.$emit('load-webhooks', privateKey);\n\n if (undefined !== response) {\n me.messageGeneration(response);\n }\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment-settings.webhook.globalError.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.webhook.globalError.message'\n ),\n });\n })\n .finally(() => {\n me.isLoading = false;\n me.isClearing = false;\n });\n },\n\n onClearingFinished() {\n this.isClearingSuccessful = false;\n this.isClearing = false;\n },\n\n onSelectWebhook(selectedItems) {\n this.webhookSelectionLength = Object.keys(selectedItems).length;\n this.webhookSelection = selectedItems;\n },\n\n messageGeneration(data) {\n const domainAmount = data.length;\n\n Object.keys(data).forEach((url) => {\n if (data[url].success) {\n this.createNotificationSuccess({\n title: this.$tc(data[url].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + url,\n });\n } else {\n this.createNotificationError({\n title: this.$tc(data[url].message, domainAmount),\n message:\n this.$tc(\n 'unzer-payment-settings.webhook.messagePrefix',\n domainAmount\n ) + url,\n });\n }\n });\n },\n },\n});\n","const { Component } = Shopware;\nconst { Criteria } = Shopware.Data;\n\n// extend the existing component `sw-entity-single-select` by\n// overwriting the default criteria\nComponent.extend(\n 'unzer-entity-single-select-delivery-status',\n 'sw-entity-single-select',\n {\n props: {\n criteria: {\n type: Object,\n required: false,\n default() {\n const criteria = new Criteria(1, 100);\n\n criteria.addFilter(\n Criteria.equals(\n 'stateMachine.technicalName',\n 'order_delivery.state'\n )\n );\n\n return criteria;\n },\n },\n },\n }\n);\n","const { Component, Service } = Shopware;\nconst { Criteria, EntityCollection } = Shopware.Data;\n\nComponent.extend(\n 'unzer-entity-multi-select-delivery-status',\n 'sw-entity-multi-id-select',\n {\n props: {\n repository: {\n type: Object,\n required: true,\n default() {\n return Service('repositoryFactory').create(\n 'state_machine_state'\n );\n },\n },\n criteria: {\n type: Object,\n required: false,\n default() {\n const criteria = new Criteria(1, 100);\n\n criteria.addFilter(\n Criteria.equals(\n 'stateMachine.technicalName',\n 'order_delivery.state'\n )\n );\n\n return criteria;\n },\n },\n },\n }\n);\n","\n","const { Component } = Shopware;\n\nimport template from './unzer-google-pay-gateway-merchant-id.html.twig';\n\nComponent.register('unzer-google-pay-gateway-merchant-id', {\n template,\n inject: ['UnzerPaymentConfigurationService'],\n data() {\n return {\n readOnlyUnzerGooglePayGatewayMerchantId: '',\n };\n },\n props: {\n currentSalesChannelId: {\n type: String,\n required: true,\n },\n },\n watch: {\n currentSalesChannelId() {\n this.getUnzerGooglePayGatewayMerchantId();\n },\n },\n created() {\n this.getUnzerGooglePayGatewayMerchantId();\n document.addEventListener(\n 'unzer-settings-saved',\n this.getUnzerGooglePayGatewayMerchantId\n );\n },\n methods: {\n getUnzerGooglePayGatewayMerchantId() {\n console.log('get', this.currentSalesChannelId);\n this.UnzerPaymentConfigurationService.getGooglePayGatewayMerchantId(\n this.currentSalesChannelId\n )\n .then((response) => {\n this.readOnlyUnzerGooglePayGatewayMerchantId =\n response.gatewayMerchantId;\n })\n .catch(() => {});\n },\n },\n});\n","{% block unzer_plugin_icon %}\n \n{% endblock %}","import template from './unzer-payment-plugin-icon.html.twig';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-payment-plugin-icon', {\n template,\n computed: {\n assetFilter() {\n return Shopware.Filter.getByName('asset');\n },\n },\n});\n","{% block unzer_settings_subheading %}\n
{{ label }}
\n{% endblock %}","import template from './unzer-settings-subheading.html.twig';\nimport './style.scss';\n\nconst { Component } = Shopware;\n\nComponent.register('unzer-settings-subheading', {\n template,\n computed: {\n label() {\n // get part after last dot\n const parts = this.$attrs.name.split('.');\n const key = parts[parts.length - 1];\n return this.$tc('unzer-payment-settings.subheadings.' + key);\n },\n },\n});\n","const { Component } = Shopware;\n\nComponent.override('sw-system-config', {\n watch: {\n currentSalesChannelId() {\n this.$emit(\n 'sales-channel-changed',\n this.actualConfigData[this.currentSalesChannelId],\n this.currentSalesChannelId\n );\n },\n },\n});\n","{% block unzer_payment_settings %}\n \n {% block unzer_payment_settings_header %}\n \n {% endblock %}\n\n {% block unzer_payment_settings_actions %}\n \n {% endblock %}\n\n {% block unzer_payment_settings_content %}\n \n \n \n \n \n {% endblock %}\n \n{% endblock %}","import template from './unzer-payment-settings.html.twig';\nimport './unzer-payment-settings.scss';\n\nconst { Component, Mixin, Context } = Shopware;\n\nComponent.register('unzer-payment-settings', {\n template,\n\n mixins: [\n Mixin.getByName('notification'),\n Mixin.getByName('sw-inline-snippet'),\n ],\n\n inject: ['repositoryFactory', 'UnzerPaymentConfigurationService'],\n\n data() {\n return {\n isLoading: true,\n isLoadingWebhooks: true,\n isAdditionalKeysExpanded: false,\n selectedKeyPairForTesting: false,\n isTestSuccessful: false,\n isSaveSuccessful: false,\n config: {},\n webhooks: [],\n loadedWebhooksPrivateKey: false,\n selectedSalesChannelId: null,\n keyPairSettings: [\n {\n key: 'b2b-eur',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2b-chf',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2c-eur',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2c-chf',\n group: 'paylaterInvoice',\n },\n {\n key: 'b2c-eur',\n group: 'paylaterInstallment',\n },\n {\n key: 'b2c-chf',\n group: 'paylaterInstallment',\n },\n {\n key: 'b2c-eur',\n group: 'paylaterDirectDebitSecured',\n },\n ],\n openModalKeyPair: null,\n };\n },\n\n metaInfo() {\n return {\n title: 'UnzerPayment',\n };\n },\n\n computed: {\n paymentMethodRepository() {\n return this.repositoryFactory.create('payment_method');\n },\n\n arrowIconName() {\n const match = Context.app.config.version.match(\n /((\\d+)\\.?(\\d+?)\\.?(\\d+)?\\.?(\\d*))-?([A-z]+?\\d+)?/i\n );\n\n if (match[3] >= 5) {\n return 'regular-chevron-right-xs';\n }\n\n return 'small-arrow-medium-right';\n },\n\n defaultKeyPair() {\n return {\n privateKey: this.getConfigValue('privateKey'),\n publicKey: this.getConfigValue('publicKey'),\n };\n },\n },\n\n watch: {\n openModalKeyPair(val) {\n if (val && val.privateKey !== this.loadedWebhooksPrivateKey) {\n this.loadWebhooks(val.privateKey);\n }\n },\n },\n\n methods: {\n getConfigValue(field) {\n if (\n !this.config ||\n !this.$refs.systemConfig ||\n !this.$refs.systemConfig.actualConfigData ||\n !this.$refs.systemConfig.actualConfigData.null\n ) {\n return '';\n }\n\n const defaultConfig = this.$refs.systemConfig.actualConfigData.null;\n\n return (\n this.config[`UnzerPayment6.settings.${field}`] ||\n defaultConfig[`UnzerPayment6.settings.${field}`]\n );\n },\n\n onValidateCredentials(keyPairSetting) {\n this.isTestSuccessful = false;\n this.selectedKeyPairForTesting = keyPairSetting;\n const keyPairIndex =\n this.getArrayKeyOfKeyPairSetting(keyPairSetting);\n let keyPairValues = keyPairSetting;\n if (keyPairIndex !== -1) {\n keyPairValues = this.keyPairSettings[keyPairIndex];\n }\n\n const credentials = {\n publicKey: keyPairValues.publicKey,\n privateKey: keyPairValues.privateKey,\n salesChannel: this.$refs.systemConfig.currentSalesChannelId,\n };\n\n this.UnzerPaymentConfigurationService.validateCredentials(\n credentials\n )\n .then(() => {\n this.createNotificationSuccess({\n title: this.$tc(\n 'unzer-payment-settings.form.message.success.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.form.message.success.message'\n ),\n });\n\n this.isTestSuccessful = true;\n this.selectedKeyPairForTesting = false;\n })\n .catch(() => {\n this.createNotificationError({\n title: this.$tc(\n 'unzer-payment-settings.form.message.error.title'\n ),\n message: this.$tc(\n 'unzer-payment-settings.form.message.error.message'\n ),\n });\n\n this.onTestFinished();\n });\n },\n\n onTestFinished() {\n this.selectedKeyPairForTesting = false;\n this.isTestSuccessful = false;\n },\n\n getArrayKeyOfKeyPairSetting(keyPairSetting) {\n return this.keyPairSettings.findIndex((keyPairSettingItem) => {\n return (\n keyPairSettingItem.key === keyPairSetting.key &&\n keyPairSettingItem.group === keyPairSetting.group\n );\n });\n },\n\n onSave() {\n this.isLoading = true;\n\n [\n 'paylaterInvoice',\n 'paylaterInstallment',\n 'paylaterDirectDebitSecured',\n ].forEach((group) => {\n this.config[`UnzerPayment6.settings.${group}`] = [];\n });\n this.keyPairSettings.reduce((config, keyPairSetting) => {\n if (\n !keyPairSetting ||\n !keyPairSetting.privateKey ||\n !keyPairSetting.publicKey\n ) {\n return config;\n }\n\n config[`UnzerPayment6.settings.${keyPairSetting.group}`].push(\n keyPairSetting\n );\n\n return config;\n }, this.config);\n\n this.$refs.systemConfig\n .saveAll()\n .then(() => {\n this.isSaveSuccessful = true;\n\n let messageSaveSuccess = this.$tc(\n 'sw-plugin-config.messageSaveSuccess'\n );\n\n if (\n messageSaveSuccess ===\n 'sw-plugin-config.messageSaveSuccess'\n ) {\n messageSaveSuccess = this.$tc(\n 'sw-extension-store.component.sw-extension-config.messageSaveSuccess'\n );\n }\n\n this.createNotificationSuccess({\n title: this.$tc('global.default.success'),\n message: messageSaveSuccess,\n });\n\n document.dispatchEvent(\n new CustomEvent('unzer-settings-saved', {})\n );\n })\n .catch((err) => {\n this.isSaveSuccessful = false;\n\n this.createNotificationError({\n title: this.$tc('global.default.error'),\n message: err,\n });\n\n this.isLoading = false;\n });\n },\n\n onConfigChange(config) {\n this.config = config;\n this.isLoading = false;\n this.syncKeyPairConfig();\n },\n\n onLoadingChanged(value) {\n this.isLoading = value;\n },\n\n onSalesChannelChanged(config, salesChannelId) {\n if (config) {\n this.onConfigChange(config);\n }\n\n this.selectedSalesChannelId = salesChannelId;\n },\n\n onWebhookRegistered(privateKey) {\n this.loadWebhooks(privateKey);\n },\n\n loadWebhooks(privateKey) {\n this.isLoadingWebhooks = true;\n\n this.UnzerPaymentConfigurationService.getWebhooks(privateKey)\n .then((response) => {\n this.webhooks = response;\n this.webhookSelection = null;\n this.webhookSelectionLength = 0;\n this.loadedWebhooksPrivateKey = privateKey;\n })\n .catch(() => {\n this.webhooks = [];\n this.loadedWebhooksPrivateKey = false;\n })\n .finally(() => {\n this.isLoadingWebhooks = false;\n this.isClearingSuccessful = false;\n });\n },\n\n getBind(element, config) {\n let originalElement;\n\n if (config !== this.config) {\n this.config = config;\n }\n\n this.$refs.systemConfig.config.forEach((configElement) => {\n configElement.elements.forEach((child) => {\n if (child.name === element.name) {\n originalElement = child;\n return;\n }\n });\n });\n\n return originalElement || element;\n },\n\n keyPairSettingTitle(keyPairSetting) {\n return this.$tc(\n `unzer-payment.methods.${keyPairSetting.group}.${keyPairSetting.key}`\n );\n },\n\n keyPairSettingGroupTitle(keyPairSetting) {\n return this.$tc(\n `unzer-payment.methods.${keyPairSetting.group}.main`\n );\n },\n\n isShowWebhooksButtonEnabled(keyPairSetting) {\n return (\n keyPairSetting &&\n keyPairSetting.privateKey &&\n keyPairSetting.publicKey\n );\n },\n\n isRegisterWebhooksButtonEnabled(keyPairSetting) {\n return (\n !this.isLoading && keyPairSetting && keyPairSetting.privateKey\n );\n },\n\n syncKeyPairConfig() {\n const me = this;\n [\n 'paylaterInvoice',\n 'paylaterInstallment',\n 'paylaterDirectDebitSecured',\n ].forEach((group) => {\n if (!this.config[`UnzerPayment6.settings.${group}`]) {\n return;\n }\n this.config[`UnzerPayment6.settings.${group}`].forEach(\n (configKeyPairSetting) => {\n me.keyPairSettings.forEach(\n (keyPairSetting, index, collection) => {\n if (\n keyPairSetting.group ===\n configKeyPairSetting.group &&\n keyPairSetting.key ===\n configKeyPairSetting.key\n ) {\n collection[index] = configKeyPairSetting;\n }\n }\n );\n }\n );\n });\n },\n\n toggleAdditionalKeys() {\n this.isAdditionalKeysExpanded = !this.isAdditionalKeysExpanded;\n },\n },\n});\n","import './component/register-webhook';\nimport './component/unzer-webhooks-modal';\nimport './component/unzer-entity-single-select-delivery-status';\nimport './component/unzer-entity-multi-select-delivery-status';\nimport './component/unzer-google-pay-gateway-merchant-id';\nimport './component/unzer-payment-plugin-icon';\nimport './component/unzer-settings-subheading';\nimport './extension/sw-system-config';\n\nimport './page/unzer-payment-settings';\n\nimport deDE from '../../snippets/de-DE.json';\nimport enGB from '../../snippets/en-GB.json';\n\nconst { Module } = Shopware;\n\nconst configuration = {\n type: 'plugin',\n name: 'UnzerPayment',\n title: 'unzer-payment-settings.module.title',\n description: 'unzer-payment-settings.module.description',\n version: '1.1.0',\n targetVersion: '1.1.0',\n\n snippets: {\n 'de-DE': deDE,\n 'en-GB': enGB,\n },\n\n routes: {\n settings: {\n component: 'unzer-payment-settings',\n path: 'settings',\n meta: {\n parentPath: 'sw.settings.index',\n },\n },\n },\n\n extensionEntryRoute: {\n extensionName: 'UnzerPayment6',\n route: 'unzer.payment.configuration.settings',\n },\n\n settingsItem: {\n name: 'unzer-payment-configuration',\n to: 'unzer.payment.configuration.settings',\n label: 'unzer-payment-settings.module.title',\n group: 'plugins',\n iconComponent: 'unzer-payment-plugin-icon',\n backgroundEnabled: false,\n },\n};\n\nModule.register('unzer-payment-configuration', configuration);\n","const { Application } = Shopware;\nconst ApiService = Shopware.Classes.ApiService;\n\nclass UnzerPaymentService extends ApiService {\n constructor(httpClient, loginService, apiEndpoint = 'unzer-payment') {\n super(httpClient, loginService, apiEndpoint);\n }\n\n fetchPaymentDetails(transaction) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/details`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n chargeTransaction(transaction, payment, amount) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/charge/${amount}`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n refundTransaction(transaction, charge, amount, reasonCode = null) {\n let apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/refund/${charge}/${amount}`;\n\n if (reasonCode !== null) {\n apiRoute = `${apiRoute}/${reasonCode}`;\n }\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n cancelTransaction(transaction, authorize, amount) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/cancel/${authorize}/${amount}`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n ship(transaction) {\n const apiRoute = `_action/${this.getApiBasePath()}/transaction/${transaction}/ship`;\n\n return this.httpClient\n .get(apiRoute, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n}\n\nApplication.addServiceProvider('UnzerPaymentService', (container) => {\n const initContainer = Application.getContainer('init');\n\n return new UnzerPaymentService(\n initContainer.httpClient,\n container.loginService\n );\n});\n","const { Application } = Shopware;\nconst ApiService = Shopware.Classes.ApiService;\n\nclass UnzerPaymentConfigurationService extends ApiService {\n constructor(httpClient, loginService, apiEndpoint = 'unzer-payment') {\n super(httpClient, loginService, apiEndpoint);\n }\n\n validateCredentials(credentials) {\n return this.httpClient\n .post(\n `_action/${this.getApiBasePath()}/validate-credentials`,\n credentials,\n {\n headers: this.getBasicHeaders(),\n }\n )\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n registerWebhooks(data) {\n return this.httpClient\n .post(`_action/${this.getApiBasePath()}/register-webhooks`, data, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n clearWebhooks(data) {\n return this.httpClient\n .post(`_action/${this.getApiBasePath()}/clear-webhooks`, data, {\n headers: this.getBasicHeaders(),\n })\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n getWebhooks(privateKey) {\n return this.httpClient\n .post(\n `_action/${this.getApiBasePath()}/get-webhooks`,\n { privateKey: privateKey },\n {\n headers: this.getBasicHeaders(),\n }\n )\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n\n getGooglePayGatewayMerchantId(salesChannelId) {\n return this.httpClient\n .get(\n `_action/${this.getApiBasePath()}/get-google-pay-gateway-merchant-id?salesChannelId=${salesChannelId || ''}`,\n {\n headers: this.getBasicHeaders(),\n }\n )\n .then((response) => {\n return ApiService.handleResponse(response);\n });\n }\n}\n\nApplication.addServiceProvider(\n 'UnzerPaymentConfigurationService',\n (container) => {\n const initContainer = Application.getContainer('init');\n\n return new UnzerPaymentConfigurationService(\n initContainer.httpClient,\n container.loginService\n );\n }\n);\n","{% block sw_payment_card_description %}\n
\n \n \n {{ $tc('sw-payment-card.deprecated') }}\n \n
\n
\n \n{% endblock %}","import template from './sw-payment-card.html.twig';\nimport deDE from '../../snippets/de-DE.json';\nimport enGB from '../../snippets/en-GB.json';\n\nShopware.Component.override('sw-payment-card', {\n template,\n snippets: {\n 'de-DE': deDE,\n 'en-GB': enGB,\n },\n});\n"],"names":["template$f","Component","Mixin","reasonCodes","template","amount","isAmountForPrepaymentRefund","errorResponse","message","template$e","Module","unzerPaymentModule","cents","decimalPrecision","value","paymentMethodId","template$d","data","transaction","date","item","cancelAmount","template$c","meta","template$b","basketItem","amountGross","amountNet","template$a","Criteria","unzerPaymentIds","criteria","template$9","Context","orderRepository","orderCriteria","order","orderTransaction","template$8","baseColumns","template$7","orderId","index","response","base","componentName","parent","next","currentRoute","template$6","page","limit","me","result","args","domainId","domain","domainAmount","salesChannelId","salesChannel","webhook","template$5","privateKey","selectedItems","url","Service","EntityCollection","template$4","template$3","template$2","parts","key","template$1","val","field","defaultConfig","keyPairSetting","keyPairIndex","keyPairValues","credentials","keyPairSettingItem","group","config","messageSaveSuccess","err","element","originalElement","configElement","child","configKeyPairSetting","collection","configuration","deDE","enGB","Application","ApiService","UnzerPaymentService","httpClient","loginService","apiEndpoint","apiRoute","payment","charge","reasonCode","authorize","container","initContainer","UnzerPaymentConfigurationService"],"mappings":"AAAA,MAAeA,EAAA,ijECGT,WAAEC,EAAS,MAAEC,CAAK,EAAK,SACvBC,EAAc,CAChB,OAAQ,SACR,OAAQ,SACR,OAAQ,QACZ,EAEAF,EAAU,SAAS,wBAAyB,CAC5C,SAAIG,EAEA,OAAQ,CAAC,qBAAqB,EAE9B,OAAQ,CAACF,EAAM,UAAU,cAAc,CAAC,EAExC,MAAO,CACH,MAAO,CACH,UAAW,GACX,aAAc,GACd,kBAAmB,EACnB,WAAY,IACf,CACJ,EAED,MAAO,CACH,oBAAqB,CACjB,KAAM,OACN,SAAU,EACb,EAED,gBAAiB,CACb,KAAM,OACN,SAAU,EACb,EAED,iBAAkB,CACd,KAAM,OACN,SAAU,GACV,QAAS,CACZ,CACJ,EAED,SAAU,CACN,iBAAkB,UAAY,CAC1B,OACI,KAAK,oBAAoB,OAAS,iBAClC,KAAK,oBAAoB,QAAU,OAE1C,EAED,iBAAkB,UAAY,CAC1B,OACI,KAAK,oBAAoB,OAAS,UAClC,KAAK,oBAAoB,QAAU,SACnC,EACI,KAAK,oBAAoB,SACzB,KAAK,gBAAgB,kBACjB,oCACJ,KAAK,gBAAgB,MAAM,OAAS,WACpC,KAAK,gBAAgB,MAAM,OAAS,SAG/C,EAED,sBAAuB,CACnB,IAAIG,EAAS,EAETC,EACA,KAAK,kBACL,KAAK,gBAAgB,kBACjB,mCAER,OAAI,KAAK,mBACLD,EAAS,KAAK,oBAAoB,QAGlC,KAAK,mBACLA,EAAS,KAAK,gBAAgB,OAAO,WAGrC,oBAAqB,KAAK,sBAC1BA,EAAS,KAAK,oBAAoB,iBAIlC,KAAK,oBAAoB,SACzBC,IAEAD,EAAS,KAAK,gBAAgB,OAAO,WAGlCA,E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AAK,WACP,KAAK,WAAW,KAAK,eAAc,CAAE,qBAAsBA,EAAM,CAC9D,QAAS,KAAK,gBAAiB,CAClC,CAAA,EACA,KAAM0B,GACIoD,EAAW,eAAepD,CAAQ,CAC5C,CACb,CAEI,cAAc1B,EAAM,CAChB,OAAO,KAAK,WACP,KAAK,WAAW,KAAK,eAAc,CAAE,kBAAmBA,EAAM,CAC3D,QAAS,KAAK,gBAAiB,CAClC,CAAA,EACA,KAAM0B,GACIoD,EAAW,eAAepD,CAAQ,CAC5C,CACb,CAEI,YAAYmB,EAAY,CACpB,OAAO,KAAK,WACP,KACG,WAAW,KAAK,eAAc,CAAE,gBAChC,CAAE,WAAYA,CAAY,EAC1B,CACI,QAAS,KAAK,gBAAiB,CACnD,CACA,EACa,KAAMnB,GACIoD,EAAW,eAAepD,CAAQ,CAC5C,CACb,CAEI,8BAA8Be,EAAgB,CAC1C,OAAO,KAAK,WACP,IACG,WAAW,KAAK,eAAc,CAAE,sDAAsDA,GAAkB,EAAE,GAC1G,CACI,QAAS,KAAK,gBAAiB,CACnD,CACA,EACa,KAAMf,GACIoD,EAAW,eAAepD,CAAQ,CAC5C,CACb,CACA,CAEAmD,EAAY,mBACR,mCACCW,GAAc,CACX,MAAMC,EAAgBZ,EAAY,aAAa,MAAM,EAErD,OAAO,IAAIa,GACPD,EAAc,WACdD,EAAU,YACb,CACT,CACA,EChFA,MAAerG,GAAA,+VCIf,SAAS,UAAU,SAAS,kBAAmB,CAC3C,SAAAA,GACA,SAAU,CACN,QAASwF,EACT,QAASC,CACZ,CACL,CAAC"} \ No newline at end of file diff --git a/src/Resources/views/storefront/page/checkout/confirm/index.html.twig b/src/Resources/views/storefront/page/checkout/confirm/index.html.twig index d9b24de8..7b9b72a5 100755 --- a/src/Resources/views/storefront/page/checkout/confirm/index.html.twig +++ b/src/Resources/views/storefront/page/checkout/confirm/index.html.twig @@ -68,7 +68,6 @@ {% endif %} {% endblock %} - {% block page_checkout_confirm_form_submit %} {% if page.extensions.unzerPaymentData and page.extensions.unzerPaymentData.blockButtonOnLoad and page.extensions.unzerPaymentFrame and page.extensions.unzerPaymentFrame.paymentFrame %} {% block page_checkout_confirm_form_submit_unzer_block_message %}