Completed
Pull Request — dev (#9)
by Andrey
07:42 queued 03:37
created

CloseOrderTransaction   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A allowPartialProcessing() 0 3 1
A execute() 0 14 2
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\Transaction;
9
10
use Generated\Shared\Transfer\AmazonpayCallTransfer;
1 ignored issue
show
Bug introduced by
The type Generated\Shared\Transfer\AmazonpayCallTransfer 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...
11
use SprykerEco\Shared\AmazonPay\AmazonPayConfig;
12
13
class CloseOrderTransaction extends AbstractAmazonpayTransaction
14
{
15
    /**
16
     * @param \Generated\Shared\Transfer\AmazonpayCallTransfer $amazonPayCallTransfer
17
     *
18
     * @return \Generated\Shared\Transfer\AmazonpayCallTransfer
19
     */
20
    public function execute(AmazonpayCallTransfer $amazonPayCallTransfer)
21
    {
22
        $amazonPayCallTransfer = parent::execute($amazonPayCallTransfer);
23
24
        if (!$this->apiResponse->getResponseHeader()->getIsSuccess()) {
25
            return $amazonPayCallTransfer;
26
        }
27
28
        $this->paymentProcessor->updateStatus(
29
            $amazonPayCallTransfer->getAmazonpayPayment()->getOrderReferenceId(),
30
            AmazonPayConfig::STATUS_CLOSED
31
        );
32
33
        return $amazonPayCallTransfer;
34
    }
35
36
    /**
37
     * @return bool
38
     */
39
    protected function allowPartialProcessing()
40
    {
41
        return false;
42
    }
43
}
44