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;
|
2024-04-10 14:18:58 +02:00
|
|
|
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" )(),
|
2024-05-29 15:59:56 +02:00
|
|
|
( 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" )(),
|
2023-10-17 16:29:56 +02:00
|
|
|
( 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" )(),
|
2023-07-03 17:17:45 +03:00
|
|
|
( require "$modules_dir/ppcp-blocks/module.php" )(),
|
2023-10-18 17:03:15 +02:00
|
|
|
( require "$modules_dir/ppcp-paypal-subscriptions/module.php" )(),
|
2024-08-22 15:47:38 +02:00
|
|
|
( 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
|
|
|
|
|
2023-07-17 14:17:50 +02:00
|
|
|
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'
|
2023-07-17 14:17:50 +02:00
|
|
|
) ) {
|
|
|
|
$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(
|
2023-09-06 11:55:26 +01:00
|
|
|
'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'
|
|
|
|
) ) {
|
2023-09-19 15:16:22 +02:00
|
|
|
$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" )();
|
|
|
|
}
|
|
|
|
|
2023-10-17 15:11:48 +02:00
|
|
|
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'
|
2023-10-17 15:11:48 +02:00
|
|
|
) ) {
|
|
|
|
$modules[] = ( require "$modules_dir/ppcp-save-payment-methods/module.php" )();
|
|
|
|
}
|
|
|
|
|
2024-03-05 17:08:10 +04:00
|
|
|
if ( PayLaterBlockModule::is_module_loading_required() ) {
|
2023-12-20 08:28:39 +02:00
|
|
|
$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" )();
|
2024-06-07 23:04:57 +02:00
|
|
|
|
|
|
|
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',
|
2024-09-26 16:58:15 +02:00
|
|
|
getenv( 'PCP_AXO_ENABLED' ) !== '0'
|
2024-02-08 14:37:56 +00:00
|
|
|
) ) {
|
|
|
|
$modules[] = ( require "$modules_dir/ppcp-axo/module.php" )();
|
2024-09-16 17:16:29 +02:00
|
|
|
$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;
|
|
|
|
};
|