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\QuoteTransfer; |
|
|
|
|
11
|
|
|
use Spryker\Shared\Kernel\Transfer\TransferInterface; |
12
|
|
|
use SprykerEco\Shared\Computop\ComputopConfig; |
13
|
|
|
use SprykerEco\Shared\Computop\Config\ComputopApiConfig; |
14
|
|
|
|
15
|
|
|
class InitIdealMapper extends AbstractMapper |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* @return string |
19
|
|
|
*/ |
20
|
|
|
public function getMethodName() |
21
|
|
|
{ |
22
|
|
|
return ComputopConfig::PAYMENT_METHOD_IDEAL; |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer |
27
|
|
|
* @param \Spryker\Shared\Kernel\Transfer\TransferInterface $computopPaymentTransfer |
28
|
|
|
* |
29
|
|
|
* @return \Spryker\Shared\Kernel\Transfer\TransferInterface |
30
|
|
|
*/ |
31
|
|
|
public function updateComputopPaymentTransfer(QuoteTransfer $quoteTransfer, TransferInterface $computopPaymentTransfer) |
32
|
|
|
{ |
33
|
|
|
/** @var \Generated\Shared\Transfer\ComputopIdealPaymentTransfer $computopPaymentTransfer */ |
34
|
|
|
$computopPaymentTransfer = parent::updateComputopPaymentTransfer($quoteTransfer, $computopPaymentTransfer); |
35
|
|
|
$computopPaymentTransfer->setMerchantId($this->config->getMerchantId()); |
36
|
|
|
$computopPaymentTransfer->setAmount($quoteTransfer->getTotals()->getGrandTotal()); |
37
|
|
|
$computopPaymentTransfer->setMac( |
38
|
|
|
$this->computopApiService->generateEncryptedMac( |
39
|
|
|
$this->createRequestTransfer($computopPaymentTransfer) |
40
|
|
|
) |
41
|
|
|
); |
42
|
|
|
|
43
|
|
|
$decryptedValues = $this->computopApiService->getEncryptedArray( |
44
|
|
|
$this->getDataSubArray($computopPaymentTransfer), |
45
|
|
|
$this->config->getBlowfishPass() |
46
|
|
|
); |
47
|
|
|
|
48
|
|
|
$length = $decryptedValues[ComputopApiConfig::LENGTH]; |
49
|
|
|
$data = $decryptedValues[ComputopApiConfig::DATA]; |
50
|
|
|
|
51
|
|
|
$computopPaymentTransfer->setData($data); |
52
|
|
|
$computopPaymentTransfer->setLen($length); |
53
|
|
|
$computopPaymentTransfer->setUrl($this->getUrlToComputop($computopPaymentTransfer->getMerchantId(), $data, $length)); |
54
|
|
|
|
55
|
|
|
return $computopPaymentTransfer; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @param \Generated\Shared\Transfer\ComputopIdealPaymentTransfer $computopIdealPaymentTransfer |
|
|
|
|
60
|
|
|
* |
61
|
|
|
* @return array |
62
|
|
|
*/ |
63
|
|
|
protected function getDataSubArray(TransferInterface $computopIdealPaymentTransfer) |
64
|
|
|
{ |
65
|
|
|
/** @var \Generated\Shared\Transfer\ComputopIdealPaymentTransfer $computopIdealPaymentTransfer */ |
66
|
|
|
$dataSubArray[ComputopApiConfig::TRANS_ID] = $computopIdealPaymentTransfer->getTransId(); |
|
|
|
|
67
|
|
|
$dataSubArray[ComputopApiConfig::AMOUNT] = $computopIdealPaymentTransfer->getAmount(); |
68
|
|
|
$dataSubArray[ComputopApiConfig::CURRENCY] = $computopIdealPaymentTransfer->getCurrency(); |
69
|
|
|
$dataSubArray[ComputopApiConfig::URL_SUCCESS] = $computopIdealPaymentTransfer->getUrlSuccess(); |
70
|
|
|
$dataSubArray[ComputopApiConfig::URL_NOTIFY] = $computopIdealPaymentTransfer->getUrlNotify(); |
71
|
|
|
$dataSubArray[ComputopApiConfig::URL_FAILURE] = $computopIdealPaymentTransfer->getUrlFailure(); |
72
|
|
|
$dataSubArray[ComputopApiConfig::RESPONSE] = $computopIdealPaymentTransfer->getResponse(); |
73
|
|
|
$dataSubArray[ComputopApiConfig::MAC] = $computopIdealPaymentTransfer->getMac(); |
74
|
|
|
$dataSubArray[ComputopApiConfig::ORDER_DESC] = $computopIdealPaymentTransfer->getOrderDesc(); |
75
|
|
|
$dataSubArray[ComputopApiConfig::ETI_ID] = $this->config->getEtiId(); |
76
|
|
|
$dataSubArray[ComputopApiConfig::IP_ADDRESS] = $computopIdealPaymentTransfer->getClientIp(); |
77
|
|
|
$dataSubArray[ComputopApiConfig::SHIPPING_ZIP] = $computopIdealPaymentTransfer->getShippingZip(); |
78
|
|
|
$dataSubArray[ComputopApiConfig::ISSUER_ID] = $this->config->getIdealIssuerId(); |
79
|
|
|
|
80
|
|
|
return $dataSubArray; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @return string |
85
|
|
|
*/ |
86
|
|
|
protected function getActionUrl() |
87
|
|
|
{ |
88
|
|
|
return $this->config->getIdealInitAction(); |
89
|
|
|
} |
90
|
|
|
} |
91
|
|
|
|
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