Passed
Push — feature/eco-2635-amazon-psd2-a... ( 746ddc...fe7dcb )
by Volodymyr
07:10 queued 03:07
created

ConfirmQuoteReferenceAdapter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A call() 0 10 1
A __construct() 0 9 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 AmazonPay\ClientInterface;
11
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...
12
use SprykerEco\Shared\AmazonPay\AmazonPayConfig;
13
use SprykerEco\Zed\AmazonPay\Business\Api\Converter\ResponseParserConverterInterface;
14
use SprykerEco\Zed\AmazonPay\Dependency\Facade\AmazonPayToMoneyInterface;
15
16
class ConfirmQuoteReferenceAdapter extends AbstractAdapter
17
{
18
    /**
19
     * @var AmazonPayConfig
20
     */
21
    protected $config;
22
23
    public function __construct(
24
        ClientInterface $client,
25
        ResponseParserConverterInterface $converter,
26
        AmazonPayToMoneyInterface $moneyFacade,
27
        AmazonPayConfig $config
28
    ) {
29
        $this->config = $config;
30
31
        parent::__construct($client, $converter, $moneyFacade);
32
    }
33
34
    /**
35
     * @param \Generated\Shared\Transfer\AmazonpayCallTransfer $amazonpayCallTransfer
36
     *
37
     * @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...
38
     */
39
    public function call(AmazonpayCallTransfer $amazonpayCallTransfer)
40
    {
41
        $result = $this->client->confirmOrderReference([
42
            AbstractAdapter::AMAZON_ORDER_REFERENCE_ID => $amazonpayCallTransfer->getAmazonpayPayment()->getOrderReferenceId(),
43
            AbstractAdapter::AMAZON_AMOUNT => $this->getAmount($amazonpayCallTransfer),
44
            AbstractAdapter::AMAZON_SUCCESS_URL => $this->config->getSuccessPaymentUrl(),
45
            AbstractAdapter::AMAZON_FAILURE_URL => $this->config->getFailurePaymentUrl(),
46
        ]);
47
48
        return $this->converter->convert($result);
49
    }
50
}
51