Completed
Pull Request — master (#4)
by Andrey
11:13 queued 07:59
created

IpnAbstractPaymentCaptureHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getOmsEventId() 0 3 1
A retrievePaymentEntity() 0 6 1
1
<?php
2
3
/**
4
 * Apache OSL-2
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Amazonpay\Business\Payment\Handler\Ipn;
9
10
use Spryker\Shared\Kernel\Transfer\AbstractTransfer;
11
use SprykerEco\Shared\Amazonpay\AmazonpayConstants;
12
13
abstract class IpnAbstractPaymentCaptureHandler extends IpnAbstractTransferRequestHandler
14
{
15
16
    /**
17
     * @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer|\Generated\Shared\Transfer\AmazonpayIpnPaymentCaptureRequestTransfer $amazonpayIpnPaymentAuthorizeRequestTransfer
18
     *
19
     * @return \Orm\Zed\Amazonpay\Persistence\SpyPaymentAmazonpay
1 ignored issue
show
Bug introduced by
The type Orm\Zed\Amazonpay\Persistence\SpyPaymentAmazonpay was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
     */
21
    protected function retrievePaymentEntity(AbstractTransfer $amazonpayIpnPaymentAuthorizeRequestTransfer)
22
    {
23
        return $this->amazonpayQueryContainer->queryPaymentByCaptureReferenceId(
24
            $amazonpayIpnPaymentAuthorizeRequestTransfer->getCaptureDetails()->getCaptureReferenceId()
0 ignored issues
show
Bug introduced by
The method getCaptureDetails() does not exist on Spryker\Shared\Kernel\Transfer\AbstractTransfer. It seems like you code against a sub-type of Spryker\Shared\Kernel\Transfer\AbstractTransfer such as Generated\Shared\Transfe...azonpayResponseTransfer or Generated\Shared\Transfer\AmazonpayPaymentTransfer or Generated\Shared\Transfe...tCaptureRequestTransfer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
            $amazonpayIpnPaymentAuthorizeRequestTransfer->/** @scrutinizer ignore-call */ getCaptureDetails()->getCaptureReferenceId()
Loading history...
25
        )
26
            ->findOne();
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    protected function getOmsEventId()
33
    {
34
        return AmazonpayConstants::OMS_EVENT_UPDATE_CAPTURE_STATUS;
35
    }
36
37
}
38