| Total Complexity | 8 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 2 | Features | 1 |
| 1 | <?php |
||
| 5 | class Environment |
||
| 6 | { |
||
| 7 | public const SANDBOX = 'sandbox'; |
||
| 8 | public const LIVE = 'live'; |
||
| 9 | private const API_CONF = 'paypal.api'; |
||
| 10 | |||
| 11 | public static function isSandbox(): bool |
||
| 12 | { |
||
| 13 | return self::getCurrentEnvironment() === self::SANDBOX; |
||
| 14 | } |
||
| 15 | |||
| 16 | public static function isLive(): bool |
||
| 17 | { |
||
| 18 | return self::getCurrentEnvironment() === self::LIVE; |
||
| 19 | } |
||
| 20 | |||
| 21 | public static function getClientId() |
||
| 22 | { |
||
| 23 | return config(self::API_CONF . '.' . self::getCurrentEnvironment() . '.credentials.client_id'); |
||
| 24 | } |
||
| 25 | |||
| 26 | public static function getSecret() |
||
| 27 | { |
||
| 28 | return config(self::API_CONF . '.' . self::getCurrentEnvironment() . '.credentials.secret'); |
||
| 29 | } |
||
| 30 | |||
| 31 | public static function getEndpoint() |
||
| 34 | } |
||
| 35 | |||
| 36 | public static function isCheckoutActivated(): bool |
||
| 39 | } |
||
| 40 | |||
| 41 | public static function areSubscriptionsActivated(): bool |
||
| 42 | { |
||
| 43 | return config('paypal.subscription.activated'); |
||
| 44 | } |
||
| 45 | |||
| 46 | private static function getCurrentEnvironment() |
||
| 49 | } |
||
| 50 | } |
||
| 51 |