From 3281c6139420a68a75fa3dae739b71aa8094acb6 Mon Sep 17 00:00:00 2001 From: dinamiko Date: Mon, 31 May 2021 12:01:14 +0200 Subject: [PATCH 1/2] Add query parameter `enable-funding=venmo` to all button loads except when Vault is turned on --- modules/ppcp-button/src/Assets/class-smartbutton.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ppcp-button/src/Assets/class-smartbutton.php b/modules/ppcp-button/src/Assets/class-smartbutton.php index 0af35654c..bdeed2394 100644 --- a/modules/ppcp-button/src/Assets/class-smartbutton.php +++ b/modules/ppcp-button/src/Assets/class-smartbutton.php @@ -754,6 +754,10 @@ class SmartButton implements SmartButtonInterface { $params['disable-funding'] = implode( ',', array_unique( $disable_funding ) ); } + if ( ! $this->settings->has( 'vault_enabled' ) || ! $this->settings->get( 'vault_enabled' ) ) { + $params['enable-funding'] = 'venmo'; + } + $smart_button_url = add_query_arg( $params, 'https://www.paypal.com/sdk/js' ); return $smart_button_url; } From bdd9bb76369f7f2355910fcf8f9973d233c30480 Mon Sep 17 00:00:00 2001 From: dinamiko Date: Tue, 15 Jun 2021 15:52:55 +0200 Subject: [PATCH 2/2] Remove vault conditional when adding venmo to enable funding --- modules/ppcp-button/src/Assets/class-smartbutton.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/ppcp-button/src/Assets/class-smartbutton.php b/modules/ppcp-button/src/Assets/class-smartbutton.php index bdeed2394..b765023e8 100644 --- a/modules/ppcp-button/src/Assets/class-smartbutton.php +++ b/modules/ppcp-button/src/Assets/class-smartbutton.php @@ -754,9 +754,7 @@ class SmartButton implements SmartButtonInterface { $params['disable-funding'] = implode( ',', array_unique( $disable_funding ) ); } - if ( ! $this->settings->has( 'vault_enabled' ) || ! $this->settings->get( 'vault_enabled' ) ) { - $params['enable-funding'] = 'venmo'; - } + $params['enable-funding'] = 'venmo'; $smart_button_url = add_query_arg( $params, 'https://www.paypal.com/sdk/js' ); return $smart_button_url;