Conditions | 2 |
Paths | 2 |
Total Lines | 33 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | protected function populateConfig(ArrayObject $config): void |
||
22 | { |
||
23 | $config->defaults([ |
||
24 | 'payum.factory_name' => 'przelewy24', |
||
25 | 'payum.factory_title' => 'Przelewy24', |
||
26 | ]); |
||
27 | |||
28 | if (false === (bool) $config['payum.api']) { |
||
29 | $config['payum.default_options'] = [ |
||
30 | 'crc_key' => null, |
||
31 | 'merchant_id' => null, |
||
32 | 'environment' => Przelewy24BridgeInterface::SANDBOX_ENVIRONMENT, |
||
33 | ]; |
||
34 | |||
35 | $config->defaults($config['payum.default_options']); |
||
36 | |||
37 | $config['payum.required_options'] = [ |
||
38 | 'crc_key', |
||
39 | 'merchant_id', |
||
40 | ]; |
||
41 | |||
42 | $config['payum.api'] = function (ArrayObject $config) { |
||
43 | $config->validateNotEmpty($config['payum.required_options']); |
||
44 | |||
45 | return [ |
||
46 | 'crc_key' => $config['crc_key'], |
||
47 | 'merchant_id' => $config['merchant_id'], |
||
48 | 'environment' => $config['environment'], |
||
49 | 'payum.http_client' => $config['payum.http_client'], |
||
50 | ]; |
||
51 | }; |
||
52 | } |
||
53 | } |
||
54 | } |
||
55 |