diff --git a/CHANGELOG.md b/CHANGELOG.md index 93b57f8..a1b64a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.8.5 +- Fix for cronjob cancellation + # 1.8.4 - Redirect token diff --git a/composer.json b/composer.json index 6e0c550..51c21fc 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "mediaopt/worldline", "description": "Worldline Online Payments", - "version": "1.8.4", + "version": "1.8.5", "type": "shopware-platform-plugin", "license": "proprietary", "config": { diff --git a/src/MoptWorldline.php b/src/MoptWorldline.php index d945853..e837756 100644 --- a/src/MoptWorldline.php +++ b/src/MoptWorldline.php @@ -23,7 +23,7 @@ class MoptWorldline extends Plugin { const PLUGIN_NAME = 'MoptWorldline'; - const PLUGIN_VERSION = '1.8.4'; + const PLUGIN_VERSION = '1.8.5'; /** * @param InstallContext $installContext diff --git a/src/Service/CronTaskHandler.php b/src/Service/CronTaskHandler.php index 4c4793e..91a634a 100644 --- a/src/Service/CronTaskHandler.php +++ b/src/Service/CronTaskHandler.php @@ -5,12 +5,12 @@ use MoptWorldline\Adapter\WorldlineSDKAdapter; use MoptWorldline\Bootstrap\Form; use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStateHandler; +use Shopware\Core\Checkout\Order\OrderStates; use Shopware\Core\Framework\Context; use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface; use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; use Shopware\Core\Framework\MessageQueue\ScheduledTask\ScheduledTaskHandler; use Shopware\Core\Kernel; -use Shopware\Core\System\StateMachine\Aggregation\StateMachineTransition\StateMachineTransitionActions; use Shopware\Core\System\SystemConfig\SystemConfigService; use Symfony\Bridge\Monolog\Logger; use Symfony\Contracts\Translation\TranslatorInterface; @@ -126,7 +126,7 @@ private function getOrderList(string $salesChannelId, string $mode): array ) ) ->andWhere("sms.technical_name != :technicalName") - ->setParameter('technicalName', StateMachineTransitionActions::ACTION_CANCEL) + ->setParameter('technicalName', OrderStates::STATE_CANCELLED) ; $timeInterval = $this->getTimeInterval($cancellationConfig) * 60 * 60; diff --git a/src/Service/PaymentHandler.php b/src/Service/PaymentHandler.php index 24a9aaf..d4627f9 100644 --- a/src/Service/PaymentHandler.php +++ b/src/Service/PaymentHandler.php @@ -880,7 +880,10 @@ private function saveCustomerCustomFields( $customFields = $customer->first()->getCustomFields(); // Token already exist - if (array_key_exists($token, $customFields[Form::CUSTOM_FIELD_WORLDLINE_CUSTOMER_SAVED_PAYMENT_CARD_TOKEN])) { + $savedCardKey = Form::CUSTOM_FIELD_WORLDLINE_CUSTOMER_SAVED_PAYMENT_CARD_TOKEN; + if (!is_null($customFields) + && array_key_exists($savedCardKey, $customFields) + && array_key_exists($token, $customFields[$savedCardKey])) { return; }