| 1 |
<?php |
| 2 |
|
| 3 |
namespace IvyForms\Services\Payment; |
| 4 |
|
| 5 |
/** |
| 6 |
* Release gate for Stripe and PayPal. |
| 7 |
* |
| 8 |
* Square stays "Coming soon" on the Integrations page regardless of this flag. |
| 9 |
* While disabled, Stripe and PayPal cards stay "Coming soon" and nothing else can be |
| 10 |
* managed: no Payments admin page, no payment settings pages and no Payment Method field. |
| 11 |
*/ |
| 12 |
class PaymentsFeature |
| 13 |
{ |
| 14 |
public static function isEnabled(): bool |
| 15 |
{ |
| 16 |
/** @var mixed $enabled Can be overridden in wp-config.php, so not a compile-time value */ |
| 17 |
$enabled = defined('IVYFORMS_PAYMENTS_ENABLED') ? constant('IVYFORMS_PAYMENTS_ENABLED') : true; |
| 18 |
|
| 19 |
/** |
| 20 |
* Filter whether the payments feature is exposed in the admin UI. |
| 21 |
* |
| 22 |
* @param bool $enabled |
| 23 |
*/ |
| 24 |
return (bool) apply_filters('ivyforms/payments/enabled', (bool) $enabled); |
| 25 |
} |
| 26 |
} |
| 27 |
|