diff --git a/changelog/fix-8423-klarna-cant-undo-manual-refunds-and-process-refunds-again-via-woopayments b/changelog/fix-8423-klarna-cant-undo-manual-refunds-and-process-refunds-again-via-woopayments
new file mode 100644
index 00000000000..8cd309f823c
--- /dev/null
+++ b/changelog/fix-8423-klarna-cant-undo-manual-refunds-and-process-refunds-again-via-woopayments
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Include missing scripts that handle refunds for non credit card payments in the order details page.
diff --git a/changelog/fix-9676-multi-currency-autoload b/changelog/fix-9676-multi-currency-autoload
new file mode 100644
index 00000000000..04e7fcfbc58
--- /dev/null
+++ b/changelog/fix-9676-multi-currency-autoload
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Keep multi-currency module in the same path to avoid autoload errors.
+
+
diff --git a/changelog/update-payment-method-test-mode-label b/changelog/update-payment-method-test-mode-label
new file mode 100644
index 00000000000..1c3874ebf5f
--- /dev/null
+++ b/changelog/update-payment-method-test-mode-label
@@ -0,0 +1,4 @@
+Significance: patch
+Type: update
+
+update: payment method "test mode" label at checkout to be displayed only when payment method is selected
diff --git a/client/checkout/blocks/index.js b/client/checkout/blocks/index.js
index 924afccde1f..68593bababd 100644
--- a/client/checkout/blocks/index.js
+++ b/client/checkout/blocks/index.js
@@ -110,7 +110,10 @@ Object.entries( enabledPaymentMethodsConfig )
label: (
gateway->get_description() ); ?>
- + is_test() ) : ?> + if ( WC_Payments::mode()->is_test() && false !== $this->gateway->get_payment_method()->get_testing_instructions() ) : + ?>- gateway->get_payment_method()->get_testing_instructions(); - if ( false !== $testing_instructions ) { + '', - 'strong' => '', - 'number' => '
- - - gateway->tokenization_script(); diff --git a/multi-currency/src/AdminNotices.php b/includes/multi-currency/AdminNotices.php similarity index 100% rename from multi-currency/src/AdminNotices.php rename to includes/multi-currency/AdminNotices.php diff --git a/multi-currency/src/Analytics.php b/includes/multi-currency/Analytics.php similarity index 100% rename from multi-currency/src/Analytics.php rename to includes/multi-currency/Analytics.php diff --git a/multi-currency/src/BackendCurrencies.php b/includes/multi-currency/BackendCurrencies.php similarity index 100% rename from multi-currency/src/BackendCurrencies.php rename to includes/multi-currency/BackendCurrencies.php diff --git a/multi-currency/src/Compatibility.php b/includes/multi-currency/Compatibility.php similarity index 100% rename from multi-currency/src/Compatibility.php rename to includes/multi-currency/Compatibility.php diff --git a/multi-currency/src/Compatibility/BaseCompatibility.php b/includes/multi-currency/Compatibility/BaseCompatibility.php similarity index 100% rename from multi-currency/src/Compatibility/BaseCompatibility.php rename to includes/multi-currency/Compatibility/BaseCompatibility.php diff --git a/multi-currency/src/Compatibility/WooCommerceBookings.php b/includes/multi-currency/Compatibility/WooCommerceBookings.php similarity index 100% rename from multi-currency/src/Compatibility/WooCommerceBookings.php rename to includes/multi-currency/Compatibility/WooCommerceBookings.php diff --git a/multi-currency/src/Compatibility/WooCommerceDeposits.php b/includes/multi-currency/Compatibility/WooCommerceDeposits.php similarity index 100% rename from multi-currency/src/Compatibility/WooCommerceDeposits.php rename to includes/multi-currency/Compatibility/WooCommerceDeposits.php diff --git a/multi-currency/src/Compatibility/WooCommerceFedEx.php b/includes/multi-currency/Compatibility/WooCommerceFedEx.php similarity index 100% rename from multi-currency/src/Compatibility/WooCommerceFedEx.php rename to includes/multi-currency/Compatibility/WooCommerceFedEx.php diff --git a/multi-currency/src/Compatibility/WooCommerceNameYourPrice.php b/includes/multi-currency/Compatibility/WooCommerceNameYourPrice.php similarity index 100% rename from multi-currency/src/Compatibility/WooCommerceNameYourPrice.php rename to includes/multi-currency/Compatibility/WooCommerceNameYourPrice.php diff --git a/multi-currency/src/Compatibility/WooCommercePointsAndRewards.php b/includes/multi-currency/Compatibility/WooCommercePointsAndRewards.php similarity index 100% rename from multi-currency/src/Compatibility/WooCommercePointsAndRewards.php rename to includes/multi-currency/Compatibility/WooCommercePointsAndRewards.php diff --git a/multi-currency/src/Compatibility/WooCommercePreOrders.php b/includes/multi-currency/Compatibility/WooCommercePreOrders.php similarity index 100% rename from multi-currency/src/Compatibility/WooCommercePreOrders.php rename to includes/multi-currency/Compatibility/WooCommercePreOrders.php diff --git a/multi-currency/src/Compatibility/WooCommerceProductAddOns.php b/includes/multi-currency/Compatibility/WooCommerceProductAddOns.php similarity index 100% rename from multi-currency/src/Compatibility/WooCommerceProductAddOns.php rename to includes/multi-currency/Compatibility/WooCommerceProductAddOns.php diff --git a/multi-currency/src/Compatibility/WooCommerceSubscriptions.php b/includes/multi-currency/Compatibility/WooCommerceSubscriptions.php similarity index 100% rename from multi-currency/src/Compatibility/WooCommerceSubscriptions.php rename to includes/multi-currency/Compatibility/WooCommerceSubscriptions.php diff --git a/multi-currency/src/Compatibility/WooCommerceUPS.php b/includes/multi-currency/Compatibility/WooCommerceUPS.php similarity index 100% rename from multi-currency/src/Compatibility/WooCommerceUPS.php rename to includes/multi-currency/Compatibility/WooCommerceUPS.php diff --git a/multi-currency/src/CountryFlags.php b/includes/multi-currency/CountryFlags.php similarity index 100% rename from multi-currency/src/CountryFlags.php rename to includes/multi-currency/CountryFlags.php diff --git a/multi-currency/src/Currency.php b/includes/multi-currency/Currency.php similarity index 100% rename from multi-currency/src/Currency.php rename to includes/multi-currency/Currency.php diff --git a/multi-currency/src/CurrencySwitcherBlock.php b/includes/multi-currency/CurrencySwitcherBlock.php similarity index 100% rename from multi-currency/src/CurrencySwitcherBlock.php rename to includes/multi-currency/CurrencySwitcherBlock.php diff --git a/multi-currency/src/CurrencySwitcherWidget.php b/includes/multi-currency/CurrencySwitcherWidget.php similarity index 100% rename from multi-currency/src/CurrencySwitcherWidget.php rename to includes/multi-currency/CurrencySwitcherWidget.php diff --git a/multi-currency/src/Exceptions/InvalidCurrencyException.php b/includes/multi-currency/Exceptions/InvalidCurrencyException.php similarity index 100% rename from multi-currency/src/Exceptions/InvalidCurrencyException.php rename to includes/multi-currency/Exceptions/InvalidCurrencyException.php diff --git a/multi-currency/src/Exceptions/InvalidCurrencyRateException.php b/includes/multi-currency/Exceptions/InvalidCurrencyRateException.php similarity index 100% rename from multi-currency/src/Exceptions/InvalidCurrencyRateException.php rename to includes/multi-currency/Exceptions/InvalidCurrencyRateException.php diff --git a/multi-currency/src/FrontendCurrencies.php b/includes/multi-currency/FrontendCurrencies.php similarity index 100% rename from multi-currency/src/FrontendCurrencies.php rename to includes/multi-currency/FrontendCurrencies.php diff --git a/multi-currency/src/FrontendPrices.php b/includes/multi-currency/FrontendPrices.php similarity index 100% rename from multi-currency/src/FrontendPrices.php rename to includes/multi-currency/FrontendPrices.php diff --git a/multi-currency/src/Geolocation.php b/includes/multi-currency/Geolocation.php similarity index 100% rename from multi-currency/src/Geolocation.php rename to includes/multi-currency/Geolocation.php diff --git a/multi-currency/src/Interfaces/MultiCurrencyAccountInterface.php b/includes/multi-currency/Interfaces/MultiCurrencyAccountInterface.php similarity index 100% rename from multi-currency/src/Interfaces/MultiCurrencyAccountInterface.php rename to includes/multi-currency/Interfaces/MultiCurrencyAccountInterface.php diff --git a/multi-currency/src/Interfaces/MultiCurrencyApiClientInterface.php b/includes/multi-currency/Interfaces/MultiCurrencyApiClientInterface.php similarity index 100% rename from multi-currency/src/Interfaces/MultiCurrencyApiClientInterface.php rename to includes/multi-currency/Interfaces/MultiCurrencyApiClientInterface.php diff --git a/multi-currency/src/Interfaces/MultiCurrencyCacheInterface.php b/includes/multi-currency/Interfaces/MultiCurrencyCacheInterface.php similarity index 100% rename from multi-currency/src/Interfaces/MultiCurrencyCacheInterface.php rename to includes/multi-currency/Interfaces/MultiCurrencyCacheInterface.php diff --git a/multi-currency/src/Interfaces/MultiCurrencyLocalizationInterface.php b/includes/multi-currency/Interfaces/MultiCurrencyLocalizationInterface.php similarity index 100% rename from multi-currency/src/Interfaces/MultiCurrencyLocalizationInterface.php rename to includes/multi-currency/Interfaces/MultiCurrencyLocalizationInterface.php diff --git a/multi-currency/src/Interfaces/MultiCurrencySettingsInterface.php b/includes/multi-currency/Interfaces/MultiCurrencySettingsInterface.php similarity index 100% rename from multi-currency/src/Interfaces/MultiCurrencySettingsInterface.php rename to includes/multi-currency/Interfaces/MultiCurrencySettingsInterface.php diff --git a/multi-currency/src/Logger.php b/includes/multi-currency/Logger.php similarity index 100% rename from multi-currency/src/Logger.php rename to includes/multi-currency/Logger.php diff --git a/multi-currency/src/MultiCurrency.php b/includes/multi-currency/MultiCurrency.php similarity index 99% rename from multi-currency/src/MultiCurrency.php rename to includes/multi-currency/MultiCurrency.php index 56e2b5815b4..9313a987dc9 100644 --- a/multi-currency/src/MultiCurrency.php +++ b/includes/multi-currency/MultiCurrency.php @@ -364,6 +364,12 @@ public function init_settings_pages( $settings_pages ): array { return $settings_pages; } + // Due to autoloader limitations, we shouldn't initiate MCCY settings if the plugin was just upgraded: + // https://github.com/Automattic/woocommerce-payments/issues/9676. + if ( did_action( 'upgrader_process_complete' ) ) { + return $settings_pages; + } + if ( $this->payments_account->is_provider_connected() ) { $settings = new Settings( $this ); $settings->init_hooks(); diff --git a/multi-currency/src/Notes/NoteMultiCurrencyAvailable.php b/includes/multi-currency/Notes/NoteMultiCurrencyAvailable.php similarity index 100% rename from multi-currency/src/Notes/NoteMultiCurrencyAvailable.php rename to includes/multi-currency/Notes/NoteMultiCurrencyAvailable.php diff --git a/includes/multi-currency/README.md b/includes/multi-currency/README.md new file mode 100644 index 00000000000..96d828ce2d1 --- /dev/null +++ b/includes/multi-currency/README.md @@ -0,0 +1,5 @@ +# WooPayments multi-currency directory + +This directory contains the multi-currency module, which has been decoupled and extracted from the gateway code. + +The module is responsible for handling all multi-currency functionality, both back-end and front-end. diff --git a/multi-currency/src/RestController.php b/includes/multi-currency/RestController.php similarity index 100% rename from multi-currency/src/RestController.php rename to includes/multi-currency/RestController.php diff --git a/multi-currency/src/Settings.php b/includes/multi-currency/Settings.php similarity index 100% rename from multi-currency/src/Settings.php rename to includes/multi-currency/Settings.php diff --git a/multi-currency/src/SettingsOnboardCta.php b/includes/multi-currency/SettingsOnboardCta.php similarity index 100% rename from multi-currency/src/SettingsOnboardCta.php rename to includes/multi-currency/SettingsOnboardCta.php diff --git a/multi-currency/src/StorefrontIntegration.php b/includes/multi-currency/StorefrontIntegration.php similarity index 100% rename from multi-currency/src/StorefrontIntegration.php rename to includes/multi-currency/StorefrontIntegration.php diff --git a/multi-currency/src/Tracking.php b/includes/multi-currency/Tracking.php similarity index 100% rename from multi-currency/src/Tracking.php rename to includes/multi-currency/Tracking.php diff --git a/multi-currency/src/UserSettings.php b/includes/multi-currency/UserSettings.php similarity index 100% rename from multi-currency/src/UserSettings.php rename to includes/multi-currency/UserSettings.php diff --git a/multi-currency/src/Utils.php b/includes/multi-currency/Utils.php similarity index 100% rename from multi-currency/src/Utils.php rename to includes/multi-currency/Utils.php diff --git a/multi-currency/client/analytics/index.js b/includes/multi-currency/client/analytics/index.js similarity index 100% rename from multi-currency/client/analytics/index.js rename to includes/multi-currency/client/analytics/index.js diff --git a/multi-currency/client/blocks/currency-switcher.js b/includes/multi-currency/client/blocks/currency-switcher.js similarity index 100% rename from multi-currency/client/blocks/currency-switcher.js rename to includes/multi-currency/client/blocks/currency-switcher.js diff --git a/multi-currency/client/components/currency-delete-illustration/index.js b/includes/multi-currency/client/components/currency-delete-illustration/index.js similarity index 100% rename from multi-currency/client/components/currency-delete-illustration/index.js rename to includes/multi-currency/client/components/currency-delete-illustration/index.js diff --git a/multi-currency/client/components/currency-delete-illustration/styles.scss b/includes/multi-currency/client/components/currency-delete-illustration/styles.scss similarity index 100% rename from multi-currency/client/components/currency-delete-illustration/styles.scss rename to includes/multi-currency/client/components/currency-delete-illustration/styles.scss diff --git a/multi-currency/client/components/preview-modal/index.js b/includes/multi-currency/client/components/preview-modal/index.js similarity index 100% rename from multi-currency/client/components/preview-modal/index.js rename to includes/multi-currency/client/components/preview-modal/index.js diff --git a/multi-currency/client/components/preview-modal/index.scss b/includes/multi-currency/client/components/preview-modal/index.scss similarity index 100% rename from multi-currency/client/components/preview-modal/index.scss rename to includes/multi-currency/client/components/preview-modal/index.scss diff --git a/multi-currency/client/components/search/index.js b/includes/multi-currency/client/components/search/index.js similarity index 100% rename from multi-currency/client/components/search/index.js rename to includes/multi-currency/client/components/search/index.js diff --git a/multi-currency/client/components/search/style.scss b/includes/multi-currency/client/components/search/style.scss similarity index 100% rename from multi-currency/client/components/search/style.scss rename to includes/multi-currency/client/components/search/style.scss diff --git a/multi-currency/client/components/search/test/__snapshots__/index.js.snap b/includes/multi-currency/client/components/search/test/__snapshots__/index.js.snap similarity index 100% rename from multi-currency/client/components/search/test/__snapshots__/index.js.snap rename to includes/multi-currency/client/components/search/test/__snapshots__/index.js.snap diff --git a/multi-currency/client/components/search/test/index.js b/includes/multi-currency/client/components/search/test/index.js similarity index 100% rename from multi-currency/client/components/search/test/index.js rename to includes/multi-currency/client/components/search/test/index.js diff --git a/multi-currency/client/context.js b/includes/multi-currency/client/context.js similarity index 100% rename from multi-currency/client/context.js rename to includes/multi-currency/client/context.js diff --git a/multi-currency/client/data/action-types.js b/includes/multi-currency/client/data/action-types.js similarity index 100% rename from multi-currency/client/data/action-types.js rename to includes/multi-currency/client/data/action-types.js diff --git a/multi-currency/client/data/actions.js b/includes/multi-currency/client/data/actions.js similarity index 100% rename from multi-currency/client/data/actions.js rename to includes/multi-currency/client/data/actions.js diff --git a/multi-currency/client/data/constants.js b/includes/multi-currency/client/data/constants.js similarity index 100% rename from multi-currency/client/data/constants.js rename to includes/multi-currency/client/data/constants.js diff --git a/multi-currency/client/data/hooks.js b/includes/multi-currency/client/data/hooks.js similarity index 100% rename from multi-currency/client/data/hooks.js rename to includes/multi-currency/client/data/hooks.js diff --git a/multi-currency/client/data/index.ts b/includes/multi-currency/client/data/index.ts similarity index 100% rename from multi-currency/client/data/index.ts rename to includes/multi-currency/client/data/index.ts diff --git a/multi-currency/client/data/reducer.js b/includes/multi-currency/client/data/reducer.js similarity index 100% rename from multi-currency/client/data/reducer.js rename to includes/multi-currency/client/data/reducer.js diff --git a/multi-currency/client/data/resolvers.js b/includes/multi-currency/client/data/resolvers.js similarity index 100% rename from multi-currency/client/data/resolvers.js rename to includes/multi-currency/client/data/resolvers.js diff --git a/multi-currency/client/data/selectors.js b/includes/multi-currency/client/data/selectors.js similarity index 100% rename from multi-currency/client/data/selectors.js rename to includes/multi-currency/client/data/selectors.js diff --git a/multi-currency/client/data/store.js b/includes/multi-currency/client/data/store.js similarity index 100% rename from multi-currency/client/data/store.js rename to includes/multi-currency/client/data/store.js diff --git a/multi-currency/client/index.js b/includes/multi-currency/client/index.js similarity index 100% rename from multi-currency/client/index.js rename to includes/multi-currency/client/index.js diff --git a/multi-currency/client/interface/assets.js b/includes/multi-currency/client/interface/assets.js similarity index 100% rename from multi-currency/client/interface/assets.js rename to includes/multi-currency/client/interface/assets.js diff --git a/multi-currency/client/interface/components.js b/includes/multi-currency/client/interface/components.js similarity index 100% rename from multi-currency/client/interface/components.js rename to includes/multi-currency/client/interface/components.js diff --git a/multi-currency/client/interface/data.js b/includes/multi-currency/client/interface/data.js similarity index 100% rename from multi-currency/client/interface/data.js rename to includes/multi-currency/client/interface/data.js diff --git a/multi-currency/client/interface/functions.js b/includes/multi-currency/client/interface/functions.js similarity index 100% rename from multi-currency/client/interface/functions.js rename to includes/multi-currency/client/interface/functions.js diff --git a/multi-currency/client/settings/multi-currency/enabled-currencies-list/delete-button.js b/includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/delete-button.js similarity index 100% rename from multi-currency/client/settings/multi-currency/enabled-currencies-list/delete-button.js rename to includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/delete-button.js diff --git a/multi-currency/client/settings/multi-currency/enabled-currencies-list/index.js b/includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/index.js similarity index 100% rename from multi-currency/client/settings/multi-currency/enabled-currencies-list/index.js rename to includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/index.js diff --git a/multi-currency/client/settings/multi-currency/enabled-currencies-list/list-item-placeholder.js b/includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/list-item-placeholder.js similarity index 100% rename from multi-currency/client/settings/multi-currency/enabled-currencies-list/list-item-placeholder.js rename to includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/list-item-placeholder.js diff --git a/multi-currency/client/settings/multi-currency/enabled-currencies-list/list-item.js b/includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/list-item.js similarity index 100% rename from multi-currency/client/settings/multi-currency/enabled-currencies-list/list-item.js rename to includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/list-item.js diff --git a/multi-currency/client/settings/multi-currency/enabled-currencies-list/list.js b/includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/list.js similarity index 100% rename from multi-currency/client/settings/multi-currency/enabled-currencies-list/list.js rename to includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/list.js diff --git a/multi-currency/client/settings/multi-currency/enabled-currencies-list/modal-checkbox-list.js b/includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/modal-checkbox-list.js similarity index 100% rename from multi-currency/client/settings/multi-currency/enabled-currencies-list/modal-checkbox-list.js rename to includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/modal-checkbox-list.js diff --git a/multi-currency/client/settings/multi-currency/enabled-currencies-list/modal-checkbox.js b/includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/modal-checkbox.js similarity index 100% rename from multi-currency/client/settings/multi-currency/enabled-currencies-list/modal-checkbox.js rename to includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/modal-checkbox.js diff --git a/multi-currency/client/settings/multi-currency/enabled-currencies-list/modal.js b/includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/modal.js similarity index 100% rename from multi-currency/client/settings/multi-currency/enabled-currencies-list/modal.js rename to includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/modal.js diff --git a/multi-currency/client/settings/multi-currency/enabled-currencies-list/style.scss b/includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/style.scss similarity index 100% rename from multi-currency/client/settings/multi-currency/enabled-currencies-list/style.scss rename to includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/style.scss diff --git a/multi-currency/client/settings/multi-currency/enabled-currencies-list/test/__snapshots__/index.js.snap b/includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/test/__snapshots__/index.js.snap similarity index 100% rename from multi-currency/client/settings/multi-currency/enabled-currencies-list/test/__snapshots__/index.js.snap rename to includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/test/__snapshots__/index.js.snap diff --git a/multi-currency/client/settings/multi-currency/enabled-currencies-list/test/index.js b/includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/test/index.js similarity index 100% rename from multi-currency/client/settings/multi-currency/enabled-currencies-list/test/index.js rename to includes/multi-currency/client/settings/multi-currency/enabled-currencies-list/test/index.js diff --git a/multi-currency/client/settings/multi-currency/index.js b/includes/multi-currency/client/settings/multi-currency/index.js similarity index 100% rename from multi-currency/client/settings/multi-currency/index.js rename to includes/multi-currency/client/settings/multi-currency/index.js diff --git a/multi-currency/client/settings/multi-currency/store-settings/index.js b/includes/multi-currency/client/settings/multi-currency/store-settings/index.js similarity index 100% rename from multi-currency/client/settings/multi-currency/store-settings/index.js rename to includes/multi-currency/client/settings/multi-currency/store-settings/index.js diff --git a/multi-currency/client/settings/multi-currency/store-settings/style.scss b/includes/multi-currency/client/settings/multi-currency/store-settings/style.scss similarity index 100% rename from multi-currency/client/settings/multi-currency/store-settings/style.scss rename to includes/multi-currency/client/settings/multi-currency/store-settings/style.scss diff --git a/multi-currency/client/settings/multi-currency/store-settings/test/__snapshots__/index.test.js.snap b/includes/multi-currency/client/settings/multi-currency/store-settings/test/__snapshots__/index.test.js.snap similarity index 100% rename from multi-currency/client/settings/multi-currency/store-settings/test/__snapshots__/index.test.js.snap rename to includes/multi-currency/client/settings/multi-currency/store-settings/test/__snapshots__/index.test.js.snap diff --git a/multi-currency/client/settings/multi-currency/store-settings/test/index.test.js b/includes/multi-currency/client/settings/multi-currency/store-settings/test/index.test.js similarity index 100% rename from multi-currency/client/settings/multi-currency/store-settings/test/index.test.js rename to includes/multi-currency/client/settings/multi-currency/store-settings/test/index.test.js diff --git a/multi-currency/client/settings/multi-currency/style.scss b/includes/multi-currency/client/settings/multi-currency/style.scss similarity index 100% rename from multi-currency/client/settings/multi-currency/style.scss rename to includes/multi-currency/client/settings/multi-currency/style.scss diff --git a/multi-currency/client/settings/multi-currency/test/__snapshots__/index.test.js.snap b/includes/multi-currency/client/settings/multi-currency/test/__snapshots__/index.test.js.snap similarity index 100% rename from multi-currency/client/settings/multi-currency/test/__snapshots__/index.test.js.snap rename to includes/multi-currency/client/settings/multi-currency/test/__snapshots__/index.test.js.snap diff --git a/multi-currency/client/settings/multi-currency/test/index.test.js b/includes/multi-currency/client/settings/multi-currency/test/index.test.js similarity index 100% rename from multi-currency/client/settings/multi-currency/test/index.test.js rename to includes/multi-currency/client/settings/multi-currency/test/index.test.js diff --git a/multi-currency/client/settings/single-currency/constants.js b/includes/multi-currency/client/settings/single-currency/constants.js similarity index 100% rename from multi-currency/client/settings/single-currency/constants.js rename to includes/multi-currency/client/settings/single-currency/constants.js diff --git a/multi-currency/client/settings/single-currency/currency-preview.js b/includes/multi-currency/client/settings/single-currency/currency-preview.js similarity index 100% rename from multi-currency/client/settings/single-currency/currency-preview.js rename to includes/multi-currency/client/settings/single-currency/currency-preview.js diff --git a/multi-currency/client/settings/single-currency/index.js b/includes/multi-currency/client/settings/single-currency/index.js similarity index 100% rename from multi-currency/client/settings/single-currency/index.js rename to includes/multi-currency/client/settings/single-currency/index.js diff --git a/multi-currency/client/settings/single-currency/style.scss b/includes/multi-currency/client/settings/single-currency/style.scss similarity index 100% rename from multi-currency/client/settings/single-currency/style.scss rename to includes/multi-currency/client/settings/single-currency/style.scss diff --git a/multi-currency/client/settings/single-currency/test/__snapshots__/index.test.js.snap b/includes/multi-currency/client/settings/single-currency/test/__snapshots__/index.test.js.snap similarity index 100% rename from multi-currency/client/settings/single-currency/test/__snapshots__/index.test.js.snap rename to includes/multi-currency/client/settings/single-currency/test/__snapshots__/index.test.js.snap diff --git a/multi-currency/client/settings/single-currency/test/index.test.js b/includes/multi-currency/client/settings/single-currency/test/index.test.js similarity index 100% rename from multi-currency/client/settings/single-currency/test/index.test.js rename to includes/multi-currency/client/settings/single-currency/test/index.test.js diff --git a/multi-currency/client/setup/index.js b/includes/multi-currency/client/setup/index.js similarity index 100% rename from multi-currency/client/setup/index.js rename to includes/multi-currency/client/setup/index.js diff --git a/multi-currency/client/setup/tasks/add-currencies-task/constants.js b/includes/multi-currency/client/setup/tasks/add-currencies-task/constants.js similarity index 100% rename from multi-currency/client/setup/tasks/add-currencies-task/constants.js rename to includes/multi-currency/client/setup/tasks/add-currencies-task/constants.js diff --git a/multi-currency/client/setup/tasks/add-currencies-task/index.js b/includes/multi-currency/client/setup/tasks/add-currencies-task/index.js similarity index 100% rename from multi-currency/client/setup/tasks/add-currencies-task/index.js rename to includes/multi-currency/client/setup/tasks/add-currencies-task/index.js diff --git a/multi-currency/client/setup/tasks/add-currencies-task/index.scss b/includes/multi-currency/client/setup/tasks/add-currencies-task/index.scss similarity index 100% rename from multi-currency/client/setup/tasks/add-currencies-task/index.scss rename to includes/multi-currency/client/setup/tasks/add-currencies-task/index.scss diff --git a/multi-currency/client/setup/tasks/add-currencies-task/test/__snapshots__/index.test.js.snap b/includes/multi-currency/client/setup/tasks/add-currencies-task/test/__snapshots__/index.test.js.snap similarity index 100% rename from multi-currency/client/setup/tasks/add-currencies-task/test/__snapshots__/index.test.js.snap rename to includes/multi-currency/client/setup/tasks/add-currencies-task/test/__snapshots__/index.test.js.snap diff --git a/multi-currency/client/setup/tasks/add-currencies-task/test/index.test.js b/includes/multi-currency/client/setup/tasks/add-currencies-task/test/index.test.js similarity index 100% rename from multi-currency/client/setup/tasks/add-currencies-task/test/index.test.js rename to includes/multi-currency/client/setup/tasks/add-currencies-task/test/index.test.js diff --git a/multi-currency/client/setup/tasks/add-currencies-task/test/utils.test.js b/includes/multi-currency/client/setup/tasks/add-currencies-task/test/utils.test.js similarity index 100% rename from multi-currency/client/setup/tasks/add-currencies-task/test/utils.test.js rename to includes/multi-currency/client/setup/tasks/add-currencies-task/test/utils.test.js diff --git a/multi-currency/client/setup/tasks/add-currencies-task/utils.js b/includes/multi-currency/client/setup/tasks/add-currencies-task/utils.js similarity index 100% rename from multi-currency/client/setup/tasks/add-currencies-task/utils.js rename to includes/multi-currency/client/setup/tasks/add-currencies-task/utils.js diff --git a/multi-currency/client/setup/tasks/multi-currency-setup.js b/includes/multi-currency/client/setup/tasks/multi-currency-setup.js similarity index 100% rename from multi-currency/client/setup/tasks/multi-currency-setup.js rename to includes/multi-currency/client/setup/tasks/multi-currency-setup.js diff --git a/multi-currency/client/setup/tasks/multi-currency-setup.scss b/includes/multi-currency/client/setup/tasks/multi-currency-setup.scss similarity index 100% rename from multi-currency/client/setup/tasks/multi-currency-setup.scss rename to includes/multi-currency/client/setup/tasks/multi-currency-setup.scss diff --git a/multi-currency/client/setup/tasks/setup-complete-task/index.js b/includes/multi-currency/client/setup/tasks/setup-complete-task/index.js similarity index 100% rename from multi-currency/client/setup/tasks/setup-complete-task/index.js rename to includes/multi-currency/client/setup/tasks/setup-complete-task/index.js diff --git a/multi-currency/client/setup/tasks/setup-complete-task/index.scss b/includes/multi-currency/client/setup/tasks/setup-complete-task/index.scss similarity index 100% rename from multi-currency/client/setup/tasks/setup-complete-task/index.scss rename to includes/multi-currency/client/setup/tasks/setup-complete-task/index.scss diff --git a/multi-currency/client/setup/tasks/setup-complete-task/test/index.test.js b/includes/multi-currency/client/setup/tasks/setup-complete-task/test/index.test.js similarity index 100% rename from multi-currency/client/setup/tasks/setup-complete-task/test/index.test.js rename to includes/multi-currency/client/setup/tasks/setup-complete-task/test/index.test.js diff --git a/multi-currency/client/setup/tasks/store-settings-task/index.js b/includes/multi-currency/client/setup/tasks/store-settings-task/index.js similarity index 100% rename from multi-currency/client/setup/tasks/store-settings-task/index.js rename to includes/multi-currency/client/setup/tasks/store-settings-task/index.js diff --git a/multi-currency/client/setup/tasks/store-settings-task/index.scss b/includes/multi-currency/client/setup/tasks/store-settings-task/index.scss similarity index 100% rename from multi-currency/client/setup/tasks/store-settings-task/index.scss rename to includes/multi-currency/client/setup/tasks/store-settings-task/index.scss diff --git a/multi-currency/client/setup/tasks/store-settings-task/test/__snapshots__/index.test.js.snap b/includes/multi-currency/client/setup/tasks/store-settings-task/test/__snapshots__/index.test.js.snap similarity index 100% rename from multi-currency/client/setup/tasks/store-settings-task/test/__snapshots__/index.test.js.snap rename to includes/multi-currency/client/setup/tasks/store-settings-task/test/__snapshots__/index.test.js.snap diff --git a/multi-currency/client/setup/tasks/store-settings-task/test/index.test.js b/includes/multi-currency/client/setup/tasks/store-settings-task/test/index.test.js similarity index 100% rename from multi-currency/client/setup/tasks/store-settings-task/test/index.test.js rename to includes/multi-currency/client/setup/tasks/store-settings-task/test/index.test.js diff --git a/multi-currency/client/setup/tasks/test/__snapshots__/multi-currency-setup.test.js.snap b/includes/multi-currency/client/setup/tasks/test/__snapshots__/multi-currency-setup.test.js.snap similarity index 100% rename from multi-currency/client/setup/tasks/test/__snapshots__/multi-currency-setup.test.js.snap rename to includes/multi-currency/client/setup/tasks/test/__snapshots__/multi-currency-setup.test.js.snap diff --git a/multi-currency/client/setup/tasks/test/multi-currency-setup.test.js b/includes/multi-currency/client/setup/tasks/test/multi-currency-setup.test.js similarity index 100% rename from multi-currency/client/setup/tasks/test/multi-currency-setup.test.js rename to includes/multi-currency/client/setup/tasks/test/multi-currency-setup.test.js diff --git a/multi-currency/client/setup/test/index.js b/includes/multi-currency/client/setup/test/index.js similarity index 100% rename from multi-currency/client/setup/test/index.js rename to includes/multi-currency/client/setup/test/index.js diff --git a/multi-currency/client/utils/currency/index.js b/includes/multi-currency/client/utils/currency/index.js similarity index 100% rename from multi-currency/client/utils/currency/index.js rename to includes/multi-currency/client/utils/currency/index.js diff --git a/multi-currency/client/utils/currency/test/index.js b/includes/multi-currency/client/utils/currency/test/index.js similarity index 100% rename from multi-currency/client/utils/currency/test/index.js rename to includes/multi-currency/client/utils/currency/test/index.js diff --git a/multi-currency/client/utils/missing-currencies-message/__tests__/index.test.js b/includes/multi-currency/client/utils/missing-currencies-message/__tests__/index.test.js similarity index 100% rename from multi-currency/client/utils/missing-currencies-message/__tests__/index.test.js rename to includes/multi-currency/client/utils/missing-currencies-message/__tests__/index.test.js diff --git a/multi-currency/client/utils/missing-currencies-message/index.ts b/includes/multi-currency/client/utils/missing-currencies-message/index.ts similarity index 100% rename from multi-currency/client/utils/missing-currencies-message/index.ts rename to includes/multi-currency/client/utils/missing-currencies-message/index.ts diff --git a/phpcs.xml.dist b/phpcs.xml.dist index a0bf916f7a9..e997f0fa2fd 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -102,7 +102,7 @@WC_Subscriptions_Product
- \WC_Product_Addons_Helper
\WC_Product_Addons_Helper
\WC_Name_Your_Price_Helpers
\WC_Name_Your_Price_Helpers
diff --git a/tasks/release.js b/tasks/release.js
index 72c3eccdef7..92b8c2986de 100644
--- a/tasks/release.js
+++ b/tasks/release.js
@@ -43,9 +43,9 @@ rm( 'dist/*.map' );
// copy the directories to the release folder
cp( '-Rf', filesToCopy, targetFolder );
-// copy the multi-currency files
-mkdir( '-p', targetFolder + '/multi-currency' );
-cp( '-R', 'multi-currency/src', targetFolder + '/multi-currency/src' );
+// The '/includes/multi-currency/client' directory is removed because '/includes/multi-currency/*' should contain only server-side files.
+// Furthermore, the './client' directory is already included in 'dist' during the build step.
+rm( '-rf', targetFolder + '/includes/multi-currency/client' );
const output = fs.createWriteStream(
releaseFolder + '/' + pluginSlug + '.zip'
diff --git a/tests/e2e-pw/specs/shopper/klarna-checkout-purchase.spec.ts b/tests/e2e-pw/specs/shopper/klarna-checkout-purchase.spec.ts
index b810f32ecb0..1ce6d5917a0 100644
--- a/tests/e2e-pw/specs/shopper/klarna-checkout-purchase.spec.ts
+++ b/tests/e2e-pw/specs/shopper/klarna-checkout-purchase.spec.ts
@@ -68,6 +68,7 @@ test.describe( 'Klarna Checkout', () => {
await shopperPage
.locator( '.wc_payment_methods' )
.getByText( 'Klarna' )
+ .nth( 1 )
.click();
await shopper.placeOrder( shopperPage );
diff --git a/tests/e2e/specs/wcpay/shopper/shopper-bnpls-checkout.spec.js b/tests/e2e/specs/wcpay/shopper/shopper-bnpls-checkout.spec.js
index 4bf7ea14b9b..8c8c4a30c83 100644
--- a/tests/e2e/specs/wcpay/shopper/shopper-bnpls-checkout.spec.js
+++ b/tests/e2e/specs/wcpay/shopper/shopper-bnpls-checkout.spec.js
@@ -8,9 +8,12 @@ import { uiUnblocked } from '@woocommerce/e2e-utils/build/page-utils';
* Internal dependencies
*/
import { merchantWCP, shopperWCP } from '../../../utils/flows';
-import { setupProductCheckout } from '../../../utils/payments';
+import {
+ selectOnCheckout,
+ setupProductCheckout,
+} from '../../../utils/payments';
-const bnplProviders = [ [ 'Affirm' ], [ 'Afterpay' ] ];
+const bnplProviders = [ [ 'affirm' ], [ 'afterpay_clearpay' ] ];
const UPE_METHOD_CHECKBOXES = [
"//label[contains(text(), 'Affirm')]/preceding-sibling::span/input[@type='checkbox']", // affirm
@@ -49,8 +52,8 @@ describe.each( cardTestingPreventionStates )(
describe.each( bnplProviders )(
`Checkout with %s, carding protection ${ cardTestingPreventionEnabled }`,
- ( providerName ) => {
- it( `should successfully place order with ${ providerName }`, async () => {
+ ( providerId ) => {
+ it( `should successfully place order with ${ providerId }`, async () => {
await shopperWCP.emptyCart();
await setupProductCheckout(
config.get( 'addresses.customer.billing' ),
@@ -58,12 +61,7 @@ describe.each( cardTestingPreventionStates )(
);
await uiUnblocked();
// Select BNPL provider as payment method.
- const xPathPaymentMethodSelector = `//*[@id='payment']/ul/li/label[contains(text(), '${ providerName }')]`;
- await page.waitForXPath( xPathPaymentMethodSelector );
- const [ paymentMethodLabel ] = await page.$x(
- xPathPaymentMethodSelector
- );
- await paymentMethodLabel.click();
+ await selectOnCheckout( providerId, page );
// Check the token presence when card testing prevention is enabled.
if ( cardTestingPreventionEnabled ) {
diff --git a/tests/js/jest.config.js b/tests/js/jest.config.js
index 03060196d4c..7a918a8d63c 100644
--- a/tests/js/jest.config.js
+++ b/tests/js/jest.config.js
@@ -5,7 +5,7 @@ module.exports = {
moduleDirectories: [
'node_modules',
'