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\Zed\Computop\Business\Hook\Mapper\Init; |
9
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\ComputopApiRequestTransfer; |
|
|
|
|
11
|
|
|
use Generated\Shared\Transfer\QuoteTransfer; |
|
|
|
|
12
|
|
|
use Spryker\Shared\Kernel\Transfer\TransferInterface; |
13
|
|
|
use SprykerEco\Service\ComputopApi\ComputopApiServiceInterface; |
14
|
|
|
use SprykerEco\Shared\Computop\Config\ComputopApiConfig; |
15
|
|
|
use SprykerEco\Zed\Computop\ComputopConfig; |
16
|
|
|
|
17
|
|
|
abstract class AbstractMapper implements InitMapperInterface |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* @var \SprykerEco\Zed\Computop\ComputopConfig |
21
|
|
|
*/ |
22
|
|
|
protected $config; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var \SprykerEco\Service\ComputopApi\ComputopApiServiceInterface |
26
|
|
|
*/ |
27
|
|
|
protected $computopApiService; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @param \SprykerEco\Zed\Computop\ComputopConfig $config |
31
|
|
|
* @param \SprykerEco\Service\ComputopApi\ComputopApiServiceInterface $computopApiService |
32
|
|
|
*/ |
33
|
|
|
public function __construct( |
34
|
|
|
ComputopConfig $config, |
35
|
|
|
ComputopApiServiceInterface $computopApiService |
36
|
|
|
) { |
37
|
|
|
$this->config = $config; |
38
|
|
|
$this->computopApiService = $computopApiService; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer |
43
|
|
|
* @param \Spryker\Shared\Kernel\Transfer\TransferInterface $computopPaymentTransfer |
44
|
|
|
* |
45
|
|
|
* @return \Spryker\Shared\Kernel\Transfer\TransferInterface |
46
|
|
|
*/ |
47
|
|
|
public function updateComputopPaymentTransfer(QuoteTransfer $quoteTransfer, TransferInterface $computopPaymentTransfer) |
48
|
|
|
{ |
49
|
|
|
$computopPaymentTransfer->setRefNr($quoteTransfer->getOrderReference()); |
|
|
|
|
50
|
|
|
|
51
|
|
|
return $computopPaymentTransfer; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @param string $actionUrl |
56
|
|
|
* @param string $merchantId |
57
|
|
|
* @param string $data |
58
|
|
|
* @param int $length |
59
|
|
|
* |
60
|
|
|
* @return string |
61
|
|
|
*/ |
62
|
|
|
protected function getUrlToComputop(string $actionUrl, string $merchantId, string $data, int $length) |
63
|
|
|
{ |
64
|
|
|
return $actionUrl . '?' . http_build_query([ |
65
|
|
|
ComputopApiConfig::MERCHANT_ID => $merchantId, |
66
|
|
|
ComputopApiConfig::DATA => $data, |
67
|
|
|
ComputopApiConfig::LENGTH => $length, |
68
|
|
|
]); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @param \Spryker\Shared\Kernel\Transfer\TransferInterface $computopPaymentTransfer |
73
|
|
|
* |
74
|
|
|
* @return \Generated\Shared\Transfer\ComputopApiRequestTransfer |
75
|
|
|
*/ |
76
|
|
|
protected function createRequestTransfer(TransferInterface $computopPaymentTransfer) |
77
|
|
|
{ |
78
|
|
|
return (new ComputopApiRequestTransfer()) |
79
|
|
|
->fromArray($computopPaymentTransfer->toArray(), true); |
80
|
|
|
} |
81
|
|
|
} |
82
|
|
|
|
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