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\ComputopApiPayPalExpressPrepareResponseTransfer; |
|
|
|
|
11
|
|
|
use Generated\Shared\Transfer\QuoteTransfer; |
|
|
|
|
12
|
|
|
use Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface; |
13
|
|
|
use SprykerEco\Service\ComputopApi\ComputopApiServiceInterface; |
14
|
|
|
use SprykerEco\Yves\Computop\ComputopConfigInterface; |
15
|
|
|
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToComputopApiClientInterface; |
16
|
|
|
use SprykerEco\Yves\Computop\Dependency\Client\ComputopToQuoteClientInterface; |
17
|
|
|
|
18
|
|
|
class ComputopPayPalExpressPrepareHandler implements ComputopPayPalExpressPrepareHandlerInterface |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @var \Spryker\Client\Quote\QuoteClientInterface |
22
|
|
|
*/ |
23
|
|
|
protected $quoteClient; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var \Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface |
27
|
|
|
*/ |
28
|
|
|
protected $stepEngineFormDataProvider; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var \SprykerEco\Yves\Computop\Dependency\Client\ComputopToComputopApiClientInterface |
32
|
|
|
*/ |
33
|
|
|
protected $computopApiClient; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var \SprykerEco\Service\ComputopApi\ComputopApiServiceInterface |
37
|
|
|
*/ |
38
|
|
|
protected $computopApiService; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var \SprykerEco\Yves\Computop\ComputopConfigInterface |
42
|
|
|
*/ |
43
|
|
|
protected $computopConfig; |
44
|
|
|
|
45
|
|
|
public function __construct( |
46
|
|
|
ComputopToQuoteClientInterface $quoteClient, |
47
|
|
|
StepEngineFormDataProviderInterface $stepEngineFormDataProvider, |
48
|
|
|
ComputopToComputopApiClientInterface $computopApiClient, |
49
|
|
|
ComputopApiServiceInterface $computopApiService, |
50
|
|
|
ComputopConfigInterface $computopConfig |
51
|
|
|
) { |
52
|
|
|
$this->quoteClient = $quoteClient; |
|
|
|
|
53
|
|
|
$this->stepEngineFormDataProvider = $stepEngineFormDataProvider; |
54
|
|
|
$this->computopApiClient = $computopApiClient; |
55
|
|
|
$this->computopApiService = $computopApiService; |
56
|
|
|
$this->computopConfig = $computopConfig; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @param QuoteTransfer $quoteTransfer |
62
|
|
|
* |
63
|
|
|
* @return \Generated\Shared\Transfer\ComputopApiPayPalExpressPrepareResponseTransfer |
64
|
|
|
*/ |
65
|
|
|
public function handle(QuoteTransfer $quoteTransfer): ComputopApiPayPalExpressPrepareResponseTransfer |
66
|
|
|
{ |
67
|
|
|
$quoteTransfer = $this->stepEngineFormDataProvider->getData($quoteTransfer); |
68
|
|
|
$quoteTransfer = $this->computopApiClient->sendPayPalExpressPrepareRequest($quoteTransfer); |
69
|
|
|
|
70
|
|
|
$this->quoteClient->setQuote($quoteTransfer); |
71
|
|
|
|
72
|
|
|
return $quoteTransfer->getPayment()->getComputopPayPalExpress()->getPayPalExpressPrepareResponse(); |
73
|
|
|
} |
74
|
|
|
} |
75
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths