|
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\Payone\Business\RiskManager\Mapper; |
|
9
|
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\PayoneStandardParameterTransfer; |
|
|
|
|
|
|
11
|
|
|
use Generated\Shared\Transfer\QuoteTransfer; |
|
|
|
|
|
|
12
|
|
|
use SprykerEco\Shared\Payone\Dependency\ModeDetectorInterface; |
|
13
|
|
|
use SprykerEco\Shared\Payone\PayoneApiConstants; |
|
14
|
|
|
use SprykerEco\Zed\Payone\Business\Api\Request\Container\ContainerInterface; |
|
15
|
|
|
use SprykerEco\Zed\Payone\Business\RiskManager\Factory\RiskCheckFactoryInterface; |
|
16
|
|
|
use SprykerEco\Zed\Payone\PayoneConfig; |
|
17
|
|
|
|
|
18
|
|
|
class RiskCheckMapper implements RiskCheckMapperInterface |
|
19
|
|
|
{ |
|
20
|
|
|
/** |
|
21
|
|
|
* @var \SprykerEco\Zed\Payone\Business\RiskManager\Factory\RiskCheckFactoryInterface |
|
22
|
|
|
*/ |
|
23
|
|
|
protected $riskCheckFactory; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @var \Generated\Shared\Transfer\PayoneStandardParameterTransfer |
|
27
|
|
|
*/ |
|
28
|
|
|
protected $standardParameters; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @var \SprykerEco\Shared\Payone\Dependency\ModeDetectorInterface |
|
32
|
|
|
*/ |
|
33
|
|
|
protected $modeDetector; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @var \SprykerEco\Zed\Payone\PayoneConfig |
|
37
|
|
|
*/ |
|
38
|
|
|
protected $payoneConfig; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @param \SprykerEco\Zed\Payone\Business\RiskManager\Factory\RiskCheckFactoryInterface $riskCheckFactory |
|
42
|
|
|
* @param \Generated\Shared\Transfer\PayoneStandardParameterTransfer $standardParameters |
|
43
|
|
|
* @param \SprykerEco\Shared\Payone\Dependency\ModeDetectorInterface $modeDetector |
|
44
|
|
|
* @param \SprykerEco\Zed\Payone\PayoneConfig $payoneConfig |
|
45
|
|
|
*/ |
|
46
|
|
|
public function __construct( |
|
47
|
|
|
RiskCheckFactoryInterface $riskCheckFactory, |
|
48
|
|
|
PayoneStandardParameterTransfer $standardParameters, |
|
49
|
|
|
ModeDetectorInterface $modeDetector, |
|
50
|
|
|
PayoneConfig $payoneConfig |
|
51
|
|
|
) { |
|
52
|
|
|
$this->riskCheckFactory = $riskCheckFactory; |
|
53
|
|
|
$this->standardParameters = $standardParameters; |
|
54
|
|
|
$this->modeDetector = $modeDetector; |
|
55
|
|
|
$this->payoneConfig = $payoneConfig; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer |
|
60
|
|
|
* |
|
61
|
|
|
* @return \SprykerEco\Zed\Payone\Business\Api\Request\Container\ContainerInterface |
|
62
|
|
|
*/ |
|
63
|
|
|
public function mapAddressCheck(QuoteTransfer $quoteTransfer): ContainerInterface |
|
64
|
|
|
{ |
|
65
|
|
|
/** @var \SprykerEco\Zed\Payone\Business\Api\Request\Container\AddressCheckContainer $container */ |
|
66
|
|
|
$container = $this->riskCheckFactory->createAddressCheckContainer(); |
|
67
|
|
|
$container = $this->mapDefaultContainerParams($container); |
|
68
|
|
|
|
|
69
|
|
|
$container->setFirstName($quoteTransfer->getBillingAddress()->getFirstName()); |
|
|
|
|
|
|
70
|
|
|
$container->setLastName($quoteTransfer->getBillingAddress()->getLastName()); |
|
|
|
|
|
|
71
|
|
|
$container->setCompany($quoteTransfer->getBillingAddress()->getCompany()); |
|
|
|
|
|
|
72
|
|
|
$container->setCountry($quoteTransfer->getBillingAddress()->getIso2Code()); |
|
|
|
|
|
|
73
|
|
|
$container->setStreetName($quoteTransfer->getBillingAddress()->getAddress1()); |
|
|
|
|
|
|
74
|
|
|
$container->setStreetNumber($quoteTransfer->getBillingAddress()->getAddress2()); |
|
|
|
|
|
|
75
|
|
|
$container->setZip($quoteTransfer->getBillingAddress()->getZipCode()); |
|
|
|
|
|
|
76
|
|
|
$container->setCity($quoteTransfer->getBillingAddress()->getCity()); |
|
|
|
|
|
|
77
|
|
|
$container->setAddressCheckType($this->payoneConfig->getAddressCheckType()); |
|
|
|
|
|
|
78
|
|
|
|
|
79
|
|
|
return $container; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer |
|
84
|
|
|
* |
|
85
|
|
|
* @return \SprykerEco\Zed\Payone\Business\Api\Request\Container\ContainerInterface |
|
86
|
|
|
*/ |
|
87
|
|
|
public function mapConsumerScoreCheck(QuoteTransfer $quoteTransfer): ContainerInterface |
|
88
|
|
|
{ |
|
89
|
|
|
/** @var \SprykerEco\Zed\Payone\Business\Api\Request\Container\ConsumerScoreContainer $container */ |
|
90
|
|
|
$container = $this->riskCheckFactory->createConsumerScoreContainer(); |
|
91
|
|
|
$container = $this->mapDefaultContainerParams($container); |
|
92
|
|
|
|
|
93
|
|
|
$container->setFirstName($quoteTransfer->getBillingAddress()->getFirstName()); |
|
94
|
|
|
$container->setLastName($quoteTransfer->getBillingAddress()->getLastName()); |
|
95
|
|
|
$container->setCompany($quoteTransfer->getBillingAddress()->getCompany()); |
|
96
|
|
|
$container->setCountry($quoteTransfer->getBillingAddress()->getIso2Code()); |
|
97
|
|
|
$container->setStreetName($quoteTransfer->getBillingAddress()->getAddress1()); |
|
98
|
|
|
$container->setStreetNumber($quoteTransfer->getBillingAddress()->getAddress2()); |
|
99
|
|
|
$container->setZip($quoteTransfer->getBillingAddress()->getZipCode()); |
|
100
|
|
|
$container->setCity($quoteTransfer->getBillingAddress()->getCity()); |
|
101
|
|
|
$container->setAddressCheckType($this->payoneConfig->getAddressCheckType()); |
|
102
|
|
|
$container->setConsumerScoreType($this->payoneConfig->getConsumerScoreType()); |
|
|
|
|
|
|
103
|
|
|
|
|
104
|
|
|
return $container; |
|
105
|
|
|
} |
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* @param \SprykerEco\Zed\Payone\Business\Api\Request\Container\ContainerInterface $container |
|
109
|
|
|
* |
|
110
|
|
|
* @return \SprykerEco\Zed\Payone\Business\Api\Request\Container\ContainerInterface |
|
111
|
|
|
*/ |
|
112
|
|
|
protected function mapDefaultContainerParams(ContainerInterface $container): ContainerInterface |
|
113
|
|
|
{ |
|
114
|
|
|
/** @var \SprykerEco\Zed\Payone\Business\Api\Request\Container\AbstractRequestContainer $container */ |
|
115
|
|
|
$container->setMid($this->standardParameters->getMid()); |
|
116
|
|
|
$container->setAid($this->standardParameters->getAid()); |
|
117
|
|
|
$container->setPortalid($this->standardParameters->getPortalId()); |
|
118
|
|
|
$container->setKey(md5($this->standardParameters->getKey())); |
|
119
|
|
|
$container->setMode($this->modeDetector->getMode()); |
|
120
|
|
|
$container->setIntegratorName(PayoneApiConstants::INTEGRATOR_NAME_SPRYKER); |
|
121
|
|
|
$container->setIntegratorVersion(PayoneApiConstants::INTEGRATOR_VERSION_3_0_0); |
|
122
|
|
|
$container->setSolutionName(PayoneApiConstants::SOLUTION_NAME_SPRYKER); |
|
123
|
|
|
$container->setSolutionVersion(PayoneApiConstants::SOLUTION_VERSION_3_0_0); |
|
124
|
|
|
|
|
125
|
|
|
return $container; |
|
126
|
|
|
} |
|
127
|
|
|
} |
|
128
|
|
|
|
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