Do not disable card funding source if card gateway enabled

This commit is contained in:
Alex P 2022-07-19 11:14:32 +03:00
parent c11635343d
commit 429260ca34

View file

@ -958,7 +958,10 @@ class SmartButton implements SmartButtonInterface {
$is_dcc_enabled = $this->settings->has( 'dcc_enabled' ) && $this->settings->get( 'dcc_enabled' );
if ( is_checkout() && $is_dcc_enabled ) {
$available_gateways = WC()->payment_gateways->get_available_payment_gateways();
$is_separate_card_enabled = isset( $available_gateways[ CardButtonGateway::ID ] );
if ( is_checkout() && ( $is_dcc_enabled || $is_separate_card_enabled ) ) {
$key = array_search( 'card', $disable_funding, true );
if ( false !== $key ) {
unset( $disable_funding[ $key ] );