Passed
Pull Request — feature/eco-3656/dev-paypal-ex... (#40)
by
unknown
10:49 queued 05:39
created

ComputopPayPalExpressCompleteHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

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

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 \SprykerEco\Yves\Computop\Dependency\Client\ComputopToComputopApiClientInterface
18
     */
19
    protected $computopApiClient;
20
21
    /**
22
     * @var \SprykerEco\Client\Computop\ComputopClientInterface
23
     */
24
    protected $computopClient;
25
26
    /**
27
     * @param \SprykerEco\Yves\Computop\Dependency\Client\ComputopToComputopApiClientInterface $computopApiClient
28
     * @param \SprykerEco\Client\Computop\ComputopClientInterface $computopClient
29
     */
30
    public function __construct(
31
        ComputopToComputopApiClientInterface $computopApiClient,
32
        ComputopClientInterface $computopClient
33
    ) {
34
        $this->computopApiClient = $computopApiClient;
35
        $this->computopClient = $computopClient;
36
    }
37
38
    /**
39
     * {@inheritDoc}
40
     *
41
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
42
     *
43
     * @return \Generated\Shared\Transfer\QuoteTransfer
44
     */
45
    public function handle(QuoteTransfer $quoteTransfer): QuoteTransfer
46
    {
47
        $quoteTransfer = $this->computopApiClient->sendPayPalExpressCompleteRequest($quoteTransfer);
48
        $quoteTransfer = $this->computopClient->savePayPalExpressInitResponse($quoteTransfer);
49
        $quoteTransfer = $this->computopClient->savePayPalExpressCompleteResponse($quoteTransfer);
50
51
        return $quoteTransfer;
52
    }
53
}
54