Remove add venmo to disable funding by default, add it as disable_funding option

This commit is contained in:
dinamiko 2021-03-10 15:02:54 +01:00
parent e2cb8cdb1f
commit f8ac20367b
2 changed files with 6 additions and 3 deletions

View file

@ -724,9 +724,8 @@ class SmartButton implements SmartButtonInterface {
if ( $payee->merchant_id() ) {
$params['merchant-id'] = $payee->merchant_id();
}
$disable_funding = $this->settings->has( 'disable_funding' ) ?
$disable_funding = $this->settings->has( 'disable_funding' ) ?
$this->settings->get( 'disable_funding' ) : array();
$disable_funding[] = 'venmo';
if ( ! is_checkout() ) {
$disable_funding[] = 'card';
}
@ -739,7 +738,10 @@ class SmartButton implements SmartButtonInterface {
if ( 'GB' === $country ) {
$disable_funding[] = 'credit';
}
$params['disable-funding'] = implode( ',', array_unique( $disable_funding ) );
if ( count( $disable_funding ) > 0 ) {
$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;