do not show 'credit' funding source for UK merchants

This commit is contained in:
David Remer 2020-09-10 10:58:41 +03:00
parent 9a127ced6a
commit 49c66ecd00
2 changed files with 18 additions and 0 deletions

View file

@ -696,6 +696,16 @@ class SmartButton implements SmartButtonInterface {
if ( ! is_checkout() ) { if ( ! is_checkout() ) {
$disable_funding[] = 'card'; $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 ) ); $params['disable-funding'] = implode( ',', array_unique( $disable_funding ) );
$smart_button_url = add_query_arg( $params, 'https://www.paypal.com/sdk/js' ); $smart_button_url = add_query_arg( $params, 'https://www.paypal.com/sdk/js' );
return $smart_button_url; return $smart_button_url;

View file

@ -1578,6 +1578,14 @@ return array(
if ( ! defined( 'PPCP_FLAG_SUBSCRIPTION' ) || ! PPCP_FLAG_SUBSCRIPTION ) { if ( ! defined( 'PPCP_FLAG_SUBSCRIPTION' ) || ! PPCP_FLAG_SUBSCRIPTION ) {
unset( $fields['vault_enabled'] ); 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; return $fields;
}, },