From e2f8aa81bfde65c8c61d22bf775fdf517b7948da Mon Sep 17 00:00:00 2001 From: Narek Zakarian Date: Thu, 6 Feb 2025 15:17:07 +0400 Subject: [PATCH] Move the mapping to new settings module --- modules/ppcp-compat/services.php | 42 -------------------------------- 1 file changed, 42 deletions(-) diff --git a/modules/ppcp-compat/services.php b/modules/ppcp-compat/services.php index 65ee1e3d8..b6abcea56 100644 --- a/modules/ppcp-compat/services.php +++ b/modules/ppcp-compat/services.php @@ -115,46 +115,4 @@ return array( $container->get( 'api.bearer' ) ); }, - - /** - * Configuration for the new/old settings map. - * - * @returns SettingsMap[] - */ - 'compat.setting.new-to-old-map' => static function( ContainerInterface $container ) : array { - $are_new_settings_enabled = $container->get( 'wcgateway.settings.admin-settings-enabled' ); - if ( ! $are_new_settings_enabled ) { - return array(); - } - - return array( - new SettingsMap( - $container->get( 'settings.data.general' ), - /** - * The new GeneralSettings class stores the current connection - * details, without adding an environment-suffix (no `_sandbox` - * or `_production` in the field name) - * Only the `sandbox_merchant` flag indicates, which environment - * the credentials are used for. - */ - array( - 'merchant_id' => 'merchant_id', - 'client_id' => 'client_id', - 'client_secret' => 'client_secret', - 'sandbox_on' => 'sandbox_merchant', - 'live_client_id' => 'client_id', - 'live_client_secret' => 'client_secret', - 'live_merchant_id' => 'merchant_id', - 'live_merchant_email' => 'merchant_email', - 'sandbox_client_id' => 'client_id', - 'sandbox_client_secret' => 'client_secret', - 'sandbox_merchant_id' => 'merchant_id', - 'sandbox_merchant_email' => 'merchant_email', - ) - ), - ); - }, - 'compat.settings.settings_map_helper' => static function( ContainerInterface $container ) : SettingsMapHelper { - return new SettingsMapHelper( $container->get( 'compat.setting.new-to-old-map' ) ); - }, );