Passed
Push — bugfix/supesc-213-is-capture-a... ( b2b98a )
by Roman
08:15
created

IsCaptureSuccessPlugin   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A check() 0 4 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\HeidelpayConfig getConfig()
17
 * @method \SprykerEco\Zed\Heidelpay\Communication\HeidelpayCommunicationFactory getFactory()
18
 * @method \SprykerEco\Zed\Heidelpay\Persistence\HeidelpayQueryContainerInterface getQueryContainer()
19
 */
20
class IsCaptureSuccessPlugin extends AbstractPlugin implements ConditionInterface
21
{
22
    /**
23
     * {@inheritDoc}
24
     * - Checks if Capture 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->getFacade()
35
            ->isCaptureSuccessful($orderItem);
36
    }
37
}
38