| Conditions | 4 |
| Paths | 8 |
| Total Lines | 23 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 8 | public static function init (): void { |
||
| 9 | if (isset(settings::$pay['crypto'])) { |
||
| 10 | $settings = [ |
||
| 11 | 'api_key' => settings::$pay['crypto']['api_key'] ?? null, |
||
| 12 | 'ipn_secret' => settings::$pay['crypto']['ipn_secret'] ?? null, |
||
| 13 | 'round_decimal' => settings::$pay['crypto']['round_decimal'] ?? null, |
||
| 14 | ]; |
||
| 15 | crypto::init(...array_filter($settings)); |
||
|
|
|||
| 16 | } |
||
| 17 | if (isset(settings::$pay['idpay'])) { |
||
| 18 | $settings = [ |
||
| 19 | 'api_key' => settings::$pay['idpay']['api_key'] ?? null, |
||
| 20 | 'sandbox' => settings::$pay['idpay']['sandbox'] ?? null, |
||
| 21 | ]; |
||
| 22 | idpay::init(...array_filter($settings)); |
||
| 23 | } |
||
| 24 | if (isset(settings::$pay['zarinpal'])) { |
||
| 25 | $settings = [ |
||
| 26 | 'merchant_id' => settings::$pay['zarinpal']['sandbox'] ?? null, |
||
| 27 | 'sandbox' => settings::$pay['zarinpal']['zarin_gate'] ?? settings::$pay['zarinpal']['zaringate'] ?? null, |
||
| 28 | 'zarin_gate' => settings::$pay['zarinpal']['merchant_id'] ?? null, |
||
| 29 | ]; |
||
| 30 | zarinpal::init(...array_filter($settings)); |
||
| 31 | } |
||
| 33 | } |