woocommerce-paypal-payments/modules.php

75 lines
2.8 KiB
PHP
Raw Normal View History

2021-08-27 20:40:09 +03:00
<?php
/**
* The list of modules.
*
* @package WooCommerce\PayPalCommerce
*/
use WooCommerce\PayPalCommerce\PluginModule;
return function ( string $root_dir ): iterable {
$modules_dir = "$root_dir/modules";
$modules = array(
new PluginModule(),
( require "$modules_dir/woocommerce-logging/module.php" )(),
( require "$modules_dir/ppcp-admin-notices/module.php" )(),
( require "$modules_dir/ppcp-api-client/module.php" )(),
( require "$modules_dir/ppcp-button/module.php" )(),
( require "$modules_dir/ppcp-compat/module.php" )(),
( require "$modules_dir/ppcp-onboarding/module.php" )(),
( require "$modules_dir/ppcp-session/module.php" )(),
( require "$modules_dir/ppcp-status-report/module.php" )(),
( require "$modules_dir/ppcp-wc-subscriptions/module.php" )(),
2021-08-27 20:40:09 +03:00
( require "$modules_dir/ppcp-wc-gateway/module.php" )(),
( require "$modules_dir/ppcp-webhooks/module.php" )(),
2021-09-16 10:21:31 +02:00
( require "$modules_dir/ppcp-vaulting/module.php" )(),
2022-08-11 14:22:16 +04:00
( require "$modules_dir/ppcp-order-tracking/module.php" )(),
2022-12-07 16:52:30 +04:00
( require "$modules_dir/ppcp-uninstall/module.php" )(),
( require "$modules_dir/ppcp-blocks/module.php" )(),
( require "$modules_dir/ppcp-paypal-subscriptions/module.php" )(),
2023-12-05 21:32:32 +02:00
( require "$modules_dir/ppcp-paylater-block/module.php" )(),
2021-08-27 20:40:09 +03:00
);
if ( apply_filters(
2023-09-12 14:07:09 +02:00
// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
2023-09-11 13:19:40 +02:00
'woocommerce.feature-flags.woocommerce_paypal_payments.applepay_enabled',
2023-10-17 14:38:50 +02:00
getenv( 'PCP_APPLEPAY_ENABLED' ) !== '0'
) ) {
$modules[] = ( require "$modules_dir/ppcp-applepay/module.php" )();
}
2021-08-27 20:40:09 +03:00
2023-08-22 08:44:32 +01:00
if ( apply_filters(
//phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
'woocommerce.feature-flags.woocommerce_paypal_payments.googlepay_enabled',
2023-10-11 18:55:42 +01:00
getenv( 'PCP_GOOGLEPAY_ENABLED' ) !== '0'
2023-08-22 08:44:32 +01:00
) ) {
$modules[] = ( require "$modules_dir/ppcp-googlepay/module.php" )();
}
2021-08-27 20:40:09 +03:00
2023-09-19 11:39:35 +02:00
if ( apply_filters(
//phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
2023-09-21 11:24:50 +02:00
'woocommerce.deprecated_flags.woocommerce_paypal_payments.saved_payment_checker_enabled',
2023-09-19 11:39:35 +02:00
getenv( 'PCP_SAVED_PAYMENT_CHECKER_ENABLED' ) === '1'
) ) {
$modules[] = ( require "$modules_dir/ppcp-saved-payment-checker/module.php" )();
2023-09-19 11:39:35 +02:00
}
2023-11-08 12:46:01 +01:00
if ( apply_filters(
//phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
'woocommerce.feature-flags.woocommerce_paypal_payments.card_fields_enabled',
getenv( 'PCP_CARD_FIELDS_ENABLED' ) === '1'
) ) {
$modules[] = ( require "$modules_dir/ppcp-card-fields/module.php" )();
}
if ( apply_filters(
//phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
'woocommerce.feature-flags.woocommerce_paypal_payments.save_payment_methods_enabled',
getenv( 'PCP_SAVE_PAYMENT_METHODS' ) === '1'
) ) {
$modules[] = ( require "$modules_dir/ppcp-save-payment-methods/module.php" )();
}
2021-08-27 20:40:09 +03:00
return $modules;
};