IsDebitOnRegistrationCompletedPlugin   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
dl 0
loc 17
c 1
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A check() 0 5 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\Heidelpay\Communication\Plugin\Checkout\Oms\Condition;
9
10
use Orm\Zed\Sales\Persistence\SpySalesOrderItem;
11
use Spryker\Zed\Kernel\Communication\AbstractPlugin;
12
use Spryker\Zed\Oms\Dependency\Plugin\Condition\ConditionInterface;
13
14
/**
15
 * @method \SprykerEco\Zed\Heidelpay\Business\HeidelpayFacadeInterface getFacade()
16
 * @method \SprykerEco\Zed\Heidelpay\Persistence\HeidelpayQueryContainerInterface getQueryContainer()
17
 * @method \SprykerEco\Zed\Heidelpay\Communication\HeidelpayCommunicationFactory getFactory()
18
 * @method \SprykerEco\Zed\Heidelpay\HeidelpayConfig getConfig()
19
 */
20
class IsDebitOnRegistrationCompletedPlugin extends AbstractPlugin implements ConditionInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     * - Checks if DebitOnRegistration transaction was successful.
25
     *
26
     * @api
27
     *
28
     * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $orderItem
29
     *
30
     * @return bool
31
     */
32
    public function check(SpySalesOrderItem $orderItem): bool
33
    {
34
        return $this->getFactory()
35
            ->createIsDebitOnRegistrationCompletedOmsCondition()
36
            ->check($orderItem);
37
    }
38
}
39