File tree Expand file tree Collapse file tree
modules/ppcp-store-sync/src/CartValidation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,8 +35,6 @@ class ShippingValidator implements ValidatorInterface {
3535 /**
3636 * List of shipping countries that are supported by the agentic integration.
3737 * Managed on plugin-side for extra code and test stability.
38- *
39- * If this list is expanded, also update the message in {@see validate_country()}
4038 */
4139 private const PAYPAL_SUPPORTED_COUNTRIES = array ( 'US ' );
4240
@@ -348,17 +346,6 @@ private function validate_country( ?string $country_code ): ?ValidationIssue {
348346 );
349347 }
350348
351- if ( $ this ->get_wc_countries () && ! $ this ->is_paypal_supported_country ( $ country_code ) ) {
352- return ValidationIssue::create_shipping_unavailable ( sprintf ( 'Shipping to %s is not supported by PayPal ' , $ country_code ) )
353- ->user_message ( 'PayPal currently only supports shipping to the United States. ' )
354- ->for_field ( 'shipping_address.country_code ' )
355- ->add_resolution (
356- ResolutionOption::create_update_address ()
357- ->label ( 'Use a supported shipping country ' )
358- ->priority ( Priority::HIGH )
359- );
360- }
361-
362349 return null ;
363350 }
364351
@@ -374,6 +361,10 @@ private function is_country_allowed( string $country_code ): bool {
374361 return true ;
375362 }
376363
364+ if ( ! $ this ->is_paypal_supported_country ( $ country_code ) ) {
365+ return false ;
366+ }
367+
377368 $ allowed_countries = $ wc_countries ->get_shipping_countries ();
378369
379370 if ( empty ( $ allowed_countries ) ) {
You can’t perform that action at this time.
0 commit comments