Completed
Push — feature/eco-3656/eco-3658-enab... ( ab05e4...16d9cc )
by
unknown
06:10
created

ComputopPayPalExpressCompleteHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A handle() 0 7 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\Computop\Handler\ExpressCheckout;
9
10
use Generated\Shared\Transfer\QuoteTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\QuoteTransfer 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\Client\Computop\ComputopClientInterface;
12
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToComputopApiClientInterface;
13
14
class ComputopPayPalExpressCompleteHandler implements ComputopPayPalExpressCompleteHandlerInterface
15
{
16
    /**
17
     * @var ComputopToComputopApiClientInterface
18
     */
19
    protected $computopApiClient;
20
21
    /**
22
     * @var \SprykerEco\Client\Computop\ComputopClientInterface
23
     */
24
    protected $computopClient;
25
26
27
    /**
28
     * @param ComputopToComputopApiClientInterface $computopApiClient
29
     * @param ComputopClientInterface $computopClient
30
     */
31
    public function __construct(
32
        ComputopToComputopApiClientInterface $computopApiClient,
33
        ComputopClientInterface $computopClient
34
    ) {
35
        $this->computopApiClient = $computopApiClient;
36
        $this->computopClient = $computopClient;
37
    }
38
39
    /**
40
     * @inheritDoc
41
     */
42
    public function handle(QuoteTransfer $quoteTransfer): QuoteTransfer
43
    {
44
        $quoteTransfer = $this->computopApiClient->sendPayPalExpressCompleteRequest($quoteTransfer);
45
        $quoteTransfer = $this->computopClient->savePayPalExpressInitResponse($quoteTransfer);
46
        $quoteTransfer = $this->computopClient->savePayPalExpressCompleteResponse($quoteTransfer);
47
48
        return $quoteTransfer;
49
    }
50
}
51