mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
Fix pay later enabling
It should be enabled only when enabled on the Pay Later tab, also we disabling we can use `paylater` instead of `credit`
This commit is contained in:
parent
68b13a480b
commit
d35fdea592
1 changed files with 8 additions and 7 deletions
|
@ -972,19 +972,20 @@ class SmartButton implements SmartButtonInterface {
|
|||
$disable_funding = $all_sources;
|
||||
}
|
||||
|
||||
if ( ! $this->settings_status->is_pay_later_button_enabled_for_location( $this->context() ) ) {
|
||||
$disable_funding[] = 'credit';
|
||||
$enable_funding = array( 'venmo' );
|
||||
|
||||
if ( $this->settings_status->is_pay_later_button_enabled_for_location( $this->context() ) ||
|
||||
$this->settings_status->is_pay_later_messaging_enabled_for_location( $this->context() )
|
||||
) {
|
||||
$enable_funding[] = 'paylater';
|
||||
} else {
|
||||
$disable_funding[] = 'paylater';
|
||||
}
|
||||
|
||||
if ( count( $disable_funding ) > 0 ) {
|
||||
$params['disable-funding'] = implode( ',', array_unique( $disable_funding ) );
|
||||
}
|
||||
|
||||
$enable_funding = array( 'venmo' );
|
||||
if ( $this->settings_status->is_pay_later_messaging_enabled_for_location( $this->context() ) || ! in_array( 'credit', $disable_funding, true ) ) {
|
||||
$enable_funding[] = 'paylater';
|
||||
}
|
||||
|
||||
if ( $this->is_free_trial_cart() ) {
|
||||
$enable_funding = array();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue