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\Payone\Form\DataProvider; |
9
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\PaymentTransfer; |
|
|
|
|
11
|
|
|
use Generated\Shared\Transfer\PayonePaymentTransfer; |
|
|
|
|
12
|
|
|
use Spryker\Shared\Kernel\Transfer\AbstractTransfer; |
13
|
|
|
use Spryker\Yves\StepEngine\Dependency\Form\StepEngineFormDataProviderInterface; |
14
|
|
|
use SprykerEco\Yves\Payone\Dependency\Client\PayoneToStoreClientInterface; |
15
|
|
|
use SprykerEco\Yves\Payone\Form\InstantOnlineTransferSubForm; |
16
|
|
|
|
17
|
|
|
class InstantOnlineTransferDataProvider implements StepEngineFormDataProviderInterface |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* @var \SprykerEco\Yves\Payone\Dependency\Client\PayoneToStoreClientInterface |
21
|
|
|
*/ |
22
|
|
|
protected $storeClient; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @param \SprykerEco\Yves\Payone\Dependency\Client\PayoneToStoreClientInterface $storeClient |
26
|
|
|
*/ |
27
|
|
|
public function __construct(PayoneToStoreClientInterface $storeClient) |
28
|
|
|
{ |
29
|
|
|
$this->storeClient = $storeClient; |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer|\Generated\Shared\Transfer\QuoteTransfer $quoteTransfer |
|
|
|
|
34
|
|
|
* |
35
|
|
|
* @return \Spryker\Shared\Kernel\Transfer\AbstractTransfer |
36
|
|
|
*/ |
37
|
|
|
public function getData(AbstractTransfer $quoteTransfer) |
38
|
|
|
{ |
39
|
|
|
/** @var \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer */ |
40
|
|
|
if ($quoteTransfer->getPayment() === null) { |
41
|
|
|
$paymentTransfer = new PaymentTransfer(); |
42
|
|
|
$paymentTransfer->setPayone(new PayonePaymentTransfer()); |
43
|
|
|
$quoteTransfer->setPayment($paymentTransfer); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
return $quoteTransfer; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @param \Spryker\Shared\Kernel\Transfer\AbstractTransfer $quoteTransfer |
51
|
|
|
* |
52
|
|
|
* @return array |
53
|
|
|
*/ |
54
|
|
|
public function getOptions(AbstractTransfer $quoteTransfer) |
55
|
|
|
{ |
56
|
|
|
return [ |
57
|
|
|
InstantOnlineTransferSubForm::OPTION_BANK_COUNTRIES => $this->getBankCountries(), |
58
|
|
|
]; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @return array<string, string> |
63
|
|
|
*/ |
64
|
|
|
protected function getBankCountries(): array |
65
|
|
|
{ |
66
|
|
|
$countries = $this->storeClient->getCurrentStore()->getCountries(); |
67
|
|
|
|
68
|
|
|
return array_combine($countries, $countries); |
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
|
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