| Conditions | 2 |
| Paths | 2 |
| Total Lines | 30 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | protected function populateConfig(ArrayObject $config): void |
||
| 16 | { |
||
| 17 | $config->defaults([ |
||
| 18 | 'payum.factory_name' => self::FACTORY_NAME, |
||
| 19 | 'payum.factory_title' => 'Iyzico' |
||
| 20 | ]); |
||
| 21 | |||
| 22 | if (false === (bool)$config['payum.api']) { |
||
| 23 | $config['payum.default_options'] = [ |
||
| 24 | 'api_key' => null, |
||
| 25 | 'secret_key' => null, |
||
| 26 | 'environment' => IyzicoBridgeInterface::SANDBOX_ENVIRONMENT, |
||
| 27 | 'threeds' => false, |
||
| 28 | ]; |
||
| 29 | |||
| 30 | $config->defaults($config['payum.default_options']); |
||
| 31 | |||
| 32 | $config['payum.required_options'] = [ |
||
| 33 | 'api_key', |
||
| 34 | 'secret_key', |
||
| 35 | ]; |
||
| 36 | |||
| 37 | $config['payum.api'] = static function (ArrayObject $config): array { |
||
| 38 | $config->validateNotEmpty($config['payum.required_options']); |
||
| 39 | |||
| 40 | return [ |
||
| 41 | 'api_key' => $config['api_key'], |
||
| 42 | 'secret_key' => $config['secret_key'], |
||
| 43 | 'environment' => $config['environment'], |
||
| 44 | 'threeds' => $config['threeds'], |
||
| 45 | ]; |
||
| 50 |