| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 33 | public static function paymentProviderFactory( |
||
| 34 | string $paymentMethod, |
||
| 35 | array $config |
||
| 36 | ): PaymentProvider { |
||
| 37 | |||
| 38 | switch ($paymentMethod) { |
||
| 39 | case self::PAYWAY_KH: |
||
| 40 | return new PaymentProviderPaywayKh($config); |
||
| 41 | |||
| 42 | case self::PIPAY_KH: |
||
| 43 | return new PaymentProviderPipayKh($config); |
||
| 44 | |||
| 45 | case self::IPAY88_KH: |
||
| 46 | return new PaymentProviderIpay88Kh($config); |
||
| 47 | |||
| 48 | default: |
||
| 49 | throw new Exception('Unsupported payment method ' . $paymentMethod); |
||
| 50 | } |
||
| 53 |