diff --git a/modules/ppcp-paylater-configurator/src/PayLaterConfiguratorModule.php b/modules/ppcp-paylater-configurator/src/PayLaterConfiguratorModule.php index 2c13bed71..83579a08e 100644 --- a/modules/ppcp-paylater-configurator/src/PayLaterConfiguratorModule.php +++ b/modules/ppcp-paylater-configurator/src/PayLaterConfiguratorModule.php @@ -65,11 +65,12 @@ static function () use ( $c ) { return; } - $current_page_id = $c->get( 'wcgateway.current-ppcp-settings-page-id' ); - $is_wc_settings_page = $c->get( 'wcgateway.is-wc-settings-page' ); - $messaging_locations = $c->get( 'paylater-configurator.messaging-locations' ); + $current_page_id = $c->get( 'wcgateway.current-ppcp-settings-page-id' ); + $is_wc_settings_page = $c->get( 'wcgateway.is-wc-settings-page' ); + $messaging_locations = $c->get( 'paylater-configurator.messaging-locations' ); + $is_current_country_send_only = $c->get( 'wcgateway.is-send-only-country' ); - self::add_paylater_update_notice( $messaging_locations, $is_wc_settings_page, $current_page_id ); + self::add_paylater_update_notice( $messaging_locations, $is_wc_settings_page, $current_page_id, $is_current_country_send_only ); $settings = $c->get( 'wcgateway.settings' ); assert( $settings instanceof Settings ); @@ -162,12 +163,13 @@ static function () use ( $c ) { * @param array $message_locations PayLater messaging locations. * @param bool $is_settings_page Whether the current page is a WC settings page. * @param string $current_page_id ID of current settings page tab. + * @param bool $is_current_country_send_only Whether the current store's country is classified as a send-only country. * * @return void */ - private static function add_paylater_update_notice( array $message_locations, bool $is_settings_page, string $current_page_id ) : void { + private static function add_paylater_update_notice( array $message_locations, bool $is_settings_page, string $current_page_id, bool $is_current_country_send_only ) : void { // The message must be registered on any WC-Settings page, except for the Pay Later page. - if ( ! $is_settings_page || Settings::PAY_LATER_TAB_ID === $current_page_id ) { + if ( ! $is_settings_page || Settings::PAY_LATER_TAB_ID === $current_page_id || $is_current_country_send_only ) { return; } diff --git a/modules/ppcp-settings/resources/js/Components/Screens/SendOnlyMessage.js b/modules/ppcp-settings/resources/js/Components/Screens/SendOnlyMessage.js index 967a3f7cd..6c63d2efd 100644 --- a/modules/ppcp-settings/resources/js/Components/Screens/SendOnlyMessage.js +++ b/modules/ppcp-settings/resources/js/Components/Screens/SendOnlyMessage.js @@ -1,16 +1,18 @@ +import { __, sprintf } from '@wordpress/i18n'; + const SendOnlyMessage = () => { - return ( -

- Your current WooCommerce store location is in a "send-only" country, - according to PayPal's policies. Sellers in these countries are - unable to receive payments via PayPal. Since receiving payments is - essential for using the PayPal Payments extension, you will not be - able to connect your PayPal account while operating from a - "send-only" country. To activate PayPal, please update your - WooCommerce store location to a supported region and connect a - PayPal account eligible for receiving payments. -

+ const url = '/wp-admin/admin.php?page=wc-settings'; + + const message = sprintf( + /* translators: 1: URL to the WooCommerce store location settings */ + __( + 'Your current WooCommerce store location is in a "send-only" country, according to PayPal\'s policies. Sellers in these countries are unable to receive payments via PayPal. Since receiving payments is essential for using the PayPal Payments extension, you will not be able to connect your PayPal account while operating from a "send-only" country. To activate PayPal, please update your WooCommerce store location to a supported region and connect a PayPal account eligible for receiving payments.', + 'woocommerce-paypal-payments' + ), + url ); + + return

; }; export default SendOnlyMessage;