From ecd06ff49f1c52786f1b0c47acd903b09b735aed Mon Sep 17 00:00:00 2001 From: Carsten Schmitz <64227129+schmitzcarsten@users.noreply.github.com> Date: Thu, 5 Aug 2021 17:01:57 +0200 Subject: [PATCH] prepare release 1.5.2 (#175) --- composer.json | 2 +- src/Facade/MollieOrderPaymentFlow.php | 3 +-- src/Facade/MolliePaymentFinalize.php | 2 +- src/Factory/MollieApiFactory.php | 2 +- src/Handler/PaymentHandler.php | 6 +++++- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index b4877e4fd..25906a378 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "kiener/mollie-payments-plugin", "description": "Mollie Payments", - "version": "v1.5.1", + "version": "v1.5.2", "type": "shopware-platform-plugin", "license": "MIT", "authors": [ diff --git a/src/Facade/MollieOrderPaymentFlow.php b/src/Facade/MollieOrderPaymentFlow.php index a0e1f42d1..ae613d5b7 100644 --- a/src/Facade/MollieOrderPaymentFlow.php +++ b/src/Facade/MollieOrderPaymentFlow.php @@ -57,8 +57,7 @@ public function __construct( public function process(OrderTransactionEntity $transaction, OrderEntity $order, Order $mollieOrder, SalesChannelContext $salesChannelContext): bool { $paymentStatus = $this->orderStatusConverter->getMollieStatus($mollieOrder); - $settings = $this->settingsService->getSettings($salesChannelContext->getSalesChannelId()); - + $settings = $this->settingsService->getSettings($salesChannelContext->getSalesChannel()->getId()); // this is only mollie payment flow here we are doing failed management here $this->orderStatusUpdater->updatePaymentStatus($transaction, $paymentStatus, $salesChannelContext->getContext()); $this->orderStatusUpdater->updateOrderStatus($order, $paymentStatus, $settings, $salesChannelContext->getContext()); diff --git a/src/Facade/MolliePaymentFinalize.php b/src/Facade/MolliePaymentFinalize.php index b70bcd6f6..6ceb5a3b9 100644 --- a/src/Facade/MolliePaymentFinalize.php +++ b/src/Facade/MolliePaymentFinalize.php @@ -78,7 +78,7 @@ public function finalize(AsyncPaymentTransactionStruct $transactionStruct, Sales $paymentStatus = $this->orderStatusConverter->getMollieStatus($mollieOrder); $this->orderStatusUpdater->updatePaymentStatus($transactionStruct->getOrderTransaction(), $paymentStatus, $salesChannelContext->getContext()); - $settings = $this->settingsService->getSettings($salesChannelContext->getSalesChannelId()); + $settings = $this->settingsService->getSettings($salesChannelContext->getSalesChannel()->getId()); $this->orderStatusUpdater->updateOrderStatus($order, $paymentStatus, $settings, $salesChannelContext->getContext()); if (MolliePaymentStatus::isFailedStatus($paymentStatus)) { diff --git a/src/Factory/MollieApiFactory.php b/src/Factory/MollieApiFactory.php index 79c14cf22..bfd7a0755 100644 --- a/src/Factory/MollieApiFactory.php +++ b/src/Factory/MollieApiFactory.php @@ -83,7 +83,7 @@ public function getClient(?string $salesChannelId = null): MollieApiClient // @todo Add plugin version variable $this->apiClient->addVersionString( - 'MollieShopware6/1.5.1' + 'MollieShopware6/1.5.2' ); } catch (Exception $e) { $this->logger->error($e->getMessage(), [$e]); diff --git a/src/Handler/PaymentHandler.php b/src/Handler/PaymentHandler.php index 7dad05215..7de54db23 100644 --- a/src/Handler/PaymentHandler.php +++ b/src/Handler/PaymentHandler.php @@ -180,10 +180,14 @@ public function finalize(AsyncPaymentTransactionStruct $transaction, Request $re } catch (CustomerCanceledAsyncPaymentException $exception) { throw $exception; } catch (Throwable $exception) { + $e=null; + if ($exception instanceof \Exception) { + $e=$exception; + } $this->logger->addEntry( $exception->getMessage(), $salesChannelContext->getContext(), - $exception, + $e, null, Logger::ERROR );