Adjustments funding source naming

This commit is contained in:
Pedro Silva 2024-03-25 15:45:12 +00:00
parent 09937fc991
commit fdca5c56a5
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
3 changed files with 13 additions and 3 deletions

View file

@ -1318,7 +1318,7 @@ document.querySelector("#payment").before(document.querySelector("#ppcp-messages
$disable_funding,
array_diff(
array_keys( $this->all_funding_sources ),
array( 'venmo', 'paylater' )
array( 'venmo', 'paylater', 'paypal' )
)
);
}
@ -1339,6 +1339,14 @@ document.querySelector("#payment").before(document.querySelector("#ppcp-messages
$disable_funding[] = 'paylater';
}
// Make sure paypal is not sent in disable funding.
$disable_funding = array_filter(
$disable_funding,
function( $value ) {
return $value !== 'paypal';
}
);
if ( count( $disable_funding ) > 0 ) {
$params['disable-funding'] = implode( ',', array_unique( $disable_funding ) );
}