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

IsCaptureSuccessPlugin::check()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 4
c 1
b 0
f 0
rs 10
cc 1
nc 1
nop 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