Passed
Pull Request — dev (#9)
by Andrey
07:26 queued 03:28
created

CaptureOrderAdapter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A call() 0 15 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\Api\Adapter;
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
12
class CaptureOrderAdapter extends AbstractAdapter
13
{
14
    const CAPTURE_REFERENCE_ID = 'capture_reference_id';
15
    const CAPTURE_AMOUNT = 'capture_amount';
16
17
    /**
18
     * @param \Generated\Shared\Transfer\AmazonpayCallTransfer $amazonpayCallTransfer
19
     *
20
     * @return \Generated\Shared\Transfer\AmazonpayResponseTransfer
1 ignored issue
show
Bug introduced by
The type Generated\Shared\Transfe...azonpayResponseTransfer 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...
21
     */
22
    public function call(AmazonpayCallTransfer $amazonpayCallTransfer)
23
    {
24
        $result = $this->client->capture([
25
            static::AMAZON_AUTHORIZATION_ID =>
26
                $amazonpayCallTransfer->getAmazonpayPayment()
27
                    ->getAuthorizationDetails()
28
                    ->getAmazonAuthorizationId(),
29
            static::CAPTURE_REFERENCE_ID =>
30
                $amazonpayCallTransfer->getAmazonpayPayment()
31
                    ->getCaptureDetails()
32
                    ->getCaptureReferenceId(),
33
            static::CAPTURE_AMOUNT => $this->getAmount($amazonpayCallTransfer),
34
        ]);
35
36
        return $this->converter->convert($result);
37
    }
38
}
39