From 021b3c17fdff0976577c2e1deb1b54cc6231857f Mon Sep 17 00:00:00 2001 From: Kostiantyn Kichehlov Date: Sat, 2 Dec 2023 12:13:24 +0100 Subject: [PATCH] SUPESC-755 Fixed factory. --- .github/workflows/ci.yml | 4 ++-- .../OmsStateResolver/UnzerOmsStateResolver.php | 2 +- .../Zed/Unzer/Business/UnzerBusinessFactory.php | 13 +++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 051f012..3ec69f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ on: jobs: setup: name: Setup Database MariaDB - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 @@ -44,7 +44,7 @@ jobs: ci: name: Unzer (PHP ${{ matrix.php-versions }}) needs: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false diff --git a/src/SprykerEco/Zed/Unzer/Business/Payment/OmsStateResolver/UnzerOmsStateResolver.php b/src/SprykerEco/Zed/Unzer/Business/Payment/OmsStateResolver/UnzerOmsStateResolver.php index 2197096..0845a54 100644 --- a/src/SprykerEco/Zed/Unzer/Business/Payment/OmsStateResolver/UnzerOmsStateResolver.php +++ b/src/SprykerEco/Zed/Unzer/Business/Payment/OmsStateResolver/UnzerOmsStateResolver.php @@ -39,7 +39,7 @@ public function getUnzerPaymentOmsStatus(UnzerPaymentTransfer $unzerPaymentTrans continue; } - if ($unzerTransactionTransfer->getTypeOrFail() === UnzerConstants::TRANSACTION_TYPE_CHARGE) { + if ($unzerTransactionTransfer->getTypeOrFail() === UnzerConstants::TRANSACTION_TYPE_AUTHORIZE) { $authorizeUnzerTransactionTransfer = $unzerTransactionTransfer; } } diff --git a/src/SprykerEco/Zed/Unzer/Business/UnzerBusinessFactory.php b/src/SprykerEco/Zed/Unzer/Business/UnzerBusinessFactory.php index 0cc3c54..4ae5f76 100644 --- a/src/SprykerEco/Zed/Unzer/Business/UnzerBusinessFactory.php +++ b/src/SprykerEco/Zed/Unzer/Business/UnzerBusinessFactory.php @@ -100,6 +100,8 @@ use SprykerEco\Zed\Unzer\Business\Payment\Filter\UnzerPaymentMethodFilterInterface; use SprykerEco\Zed\Unzer\Business\Payment\Mapper\UnzerPaymentMapper; use SprykerEco\Zed\Unzer\Business\Payment\Mapper\UnzerPaymentMapperInterface; +use SprykerEco\Zed\Unzer\Business\Payment\OmsStateResolver\UnzerOmsStateResolver; +use SprykerEco\Zed\Unzer\Business\Payment\OmsStateResolver\UnzerOmsStateResolverInterface; use SprykerEco\Zed\Unzer\Business\Payment\Processor\Charge\UnzerChargeProcessorInterface; use SprykerEco\Zed\Unzer\Business\Payment\Processor\Charge\UnzerCreditCardChargeProcessor; use SprykerEco\Zed\Unzer\Business\Payment\Processor\Charge\UnzerMarketplaceCreditCardChargeProcessor; @@ -403,6 +405,17 @@ public function createUnzerNotificationProcessor(): UnzerNotificationProcessorIn $this->createUnzerPaymentMapper(), $this->createUnzerPaymentUpdater(), $this->createUnzerCredentialsResolver(), + $this->createUnzerOmsStateResolver(), + ); + } + + /** + * @return \SprykerEco\Zed\Unzer\Business\Payment\OmsStateResolver\UnzerOmsStateResolverInterface + */ + public function createUnzerOmsStateResolver(): UnzerOmsStateResolverInterface + { + return new UnzerOmsStateResolver( + $this->getConfig(), ); }