diff --git a/CHANGELOG.md b/CHANGELOG.md index 73c9b548..bfb89fb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +# Version 7.1.3 - Released on 2024-10-17 + +This release is only for Shopware 6.5 and contains all changes from version 7.1.2 + +## Version 7.1.2 - Released on 2024-10-17 + +* RATESWSX-318: fix reloading profile-config if legacy payment-methods are available + ## Version 7.1.1 - Released on 2024-09-19 This release is only for Shopware 6.5 and contains all changes from version 7.1.0 diff --git a/composer.json b/composer.json index e98b3566..a313b3fc 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "ratepay/shopware6-module", "description": "Ratepay payment methods for Shopware 6", - "version": "7.1.1", + "version": "7.1.3", "license": "MIT", "authors": [ { diff --git a/src/Components/ProfileConfig/Service/ProfileConfigResponseConverter.php b/src/Components/ProfileConfig/Service/ProfileConfigResponseConverter.php index 88c4ec0a..33872838 100644 --- a/src/Components/ProfileConfig/Service/ProfileConfigResponseConverter.php +++ b/src/Components/ProfileConfig/Service/ProfileConfigResponseConverter.php @@ -14,6 +14,7 @@ use RatePAY\Model\Response\ProfileRequest; use Ratepay\RpayPayments\Components\PaymentHandler\InstallmentPaymentHandler; use Ratepay\RpayPayments\Components\PaymentHandler\InstallmentZeroPercentPaymentHandler; +use Ratepay\RpayPayments\Components\PaymentHandler\LegacyPaymentHandler; use Ratepay\RpayPayments\Components\ProfileConfig\Model\ProfileConfigEntity; use Ratepay\RpayPayments\Components\ProfileConfig\Model\ProfileConfigMethodEntity; use Ratepay\RpayPayments\Components\ProfileConfig\Model\ProfileConfigMethodInstallmentEntity; @@ -24,6 +25,7 @@ use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository; use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\NotFilter; use Shopware\Core\Framework\Uuid\Uuid; class ProfileConfigResponseConverter @@ -65,7 +67,12 @@ public function convert(ProfileRequest $response, string $profileId): array /** @var PaymentMethodEntity $paymentMethod */ foreach ($paymentMethods as $paymentMethod) { - $arrayKey = strtolower((string) constant($paymentMethod->getHandlerIdentifier() . '::RATEPAY_METHOD')); + $constantName = $paymentMethod->getHandlerIdentifier() . '::RATEPAY_METHOD'; + if (!defined($constantName)) { + continue; + } + + $arrayKey = strtolower((string) constant($constantName)); if (!isset($responseData['merchantConfig']['activation-status-' . $arrayKey]) || (((int) $responseData['merchantConfig']['activation-status-' . $arrayKey]) === 1)) { @@ -131,6 +138,7 @@ private function getPaymentMethods(): array $criteria = new Criteria(); $criteria->addAssociation('plugin'); $criteria->addFilter(new EqualsFilter('plugin.baseClass', RpayPayments::class)); + $criteria->addFilter(new NotFilter(NotFilter::CONNECTION_AND, [new EqualsFilter('handlerIdentifier', LegacyPaymentHandler::class)])); /** @var PaymentMethodEntity[] $paymentMethods */ $paymentMethods = $this->paymentMethodRepository->search($criteria, Context::createDefaultContext())->getElements(); $this->paymentMethods = $paymentMethods;