woocommerce-paypal-payments/modules.php

97 lines
3.5 KiB
PHP
Raw Normal View History

2021-08-27 20:40:09 +03:00
<?php
/**
* The list of modules.
*
* @package WooCommerce\PayPalCommerce
*/
2025-01-15 18:13:07 +04:00
namespace WooCommerce\PayPalCommerce;
2023-12-20 08:56:23 +02:00
use WooCommerce\PayPalCommerce\PayLaterBlock\PayLaterBlockModule;
use WooCommerce\PayPalCommerce\PayLaterWCBlocks\PayLaterWCBlocksModule;
2023-12-21 09:55:57 +02:00
use WooCommerce\PayPalCommerce\PayLaterConfigurator\PayLaterConfiguratorModule;
2021-08-27 20:40:09 +03:00
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-compat/module.php" )(),
( require "$modules_dir/ppcp-button/module.php" )(),
2021-08-27 20:40:09 +03:00
( 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" )(),
( require "$modules_dir/ppcp-local-alternative-payment-methods/module.php" )(),
2025-07-11 16:42:48 +04:00
( require "$modules_dir/ppcp-settings/module.php" )(),
2021-08-27 20:40:09 +03:00
);
2023-12-20 08:29:33 +02:00
// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
if ( apply_filters(
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(
'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(
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(
'woocommerce.feature-flags.woocommerce_paypal_payments.card_fields_enabled',
2024-01-17 12:40:49 +01:00
getenv( 'PCP_CARD_FIELDS_ENABLED' ) !== '0'
2023-11-08 12:46:01 +01:00
) ) {
$modules[] = ( require "$modules_dir/ppcp-card-fields/module.php" )();
}
if ( apply_filters(
'woocommerce.feature-flags.woocommerce_paypal_payments.save_payment_methods_enabled',
2024-01-17 12:40:49 +01:00
getenv( 'PCP_SAVE_PAYMENT_METHODS' ) !== '0'
) ) {
$modules[] = ( require "$modules_dir/ppcp-save-payment-methods/module.php" )();
}
if ( PayLaterBlockModule::is_module_loading_required() ) {
$modules[] = ( require "$modules_dir/ppcp-paylater-block/module.php" )();
}
2023-12-21 09:55:57 +02:00
if ( PayLaterConfiguratorModule::is_enabled() ) {
$modules[] = ( require "$modules_dir/ppcp-paylater-configurator/module.php" )();
if ( PayLaterWCBlocksModule::is_module_loading_required() ) {
$modules[] = ( require "$modules_dir/ppcp-paylater-wc-blocks/module.php" )();
}
2023-12-21 09:55:57 +02:00
}
2024-02-08 14:37:56 +00:00
if ( apply_filters(
'woocommerce.feature-flags.woocommerce_paypal_payments.axo_enabled',
getenv( 'PCP_AXO_ENABLED' ) !== '0'
2024-02-08 14:37:56 +00:00
) ) {
$modules[] = ( require "$modules_dir/ppcp-axo/module.php" )();
$modules[] = ( require "$modules_dir/ppcp-axo-block/module.php" )();
2024-02-08 14:37:56 +00:00
}
2021-08-27 20:40:09 +03:00
return $modules;
};