diff --git a/modules/ppcp-button/src/Assets/class-smartbutton.php b/modules/ppcp-button/src/Assets/class-smartbutton.php index a3bc2fcdf..ece8ab872 100644 --- a/modules/ppcp-button/src/Assets/class-smartbutton.php +++ b/modules/ppcp-button/src/Assets/class-smartbutton.php @@ -696,6 +696,16 @@ class SmartButton implements SmartButtonInterface { if ( ! is_checkout() ) { $disable_funding[] = 'card'; } + + /** + * Disable card for UK. + */ + $region = wc_get_base_location(); + $country = $region['country']; + if ( 'GB' === $country ) { + $disable_funding[] = 'card'; + } + $params['disable-funding'] = implode( ',', array_unique( $disable_funding ) ); $smart_button_url = add_query_arg( $params, 'https://www.paypal.com/sdk/js' ); return $smart_button_url; diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index 8ca46f73e..aeadb273a 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -1578,6 +1578,14 @@ return array( if ( ! defined( 'PPCP_FLAG_SUBSCRIPTION' ) || ! PPCP_FLAG_SUBSCRIPTION ) { unset( $fields['vault_enabled'] ); } + /** + * Disable card for UK. + */ + $region = wc_get_base_location(); + $country = $region['country']; + if ( 'GB' === $country ) { + unset( $fields['disable_funding']['options']['card'] ); + } return $fields; },