Don't force default token gateway active by default
This commit is contained in:
parent
92be60f3e4
commit
660649e767
|
@ -179,19 +179,14 @@ class WC_Payment_Gateways {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_user_logged_in() ) {
|
$current_gateway = false;
|
||||||
$default_token = WC_Payment_Tokens::get_customer_default_token( get_current_user_id() );
|
$current = WC()->session->get( 'chosen_payment_method' );
|
||||||
if ( ! is_null( $default_token ) ) {
|
|
||||||
$default_token_gateway = $default_token->get_gateway_id();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$current = ( isset( $default_token_gateway ) ? $default_token_gateway : WC()->session->get( 'chosen_payment_method' ) );
|
|
||||||
|
|
||||||
if ( $current && isset( $gateways[ $current ] ) ) {
|
if ( $current && isset( $gateways[ $current ] ) ) {
|
||||||
$current_gateway = $gateways[ $current ];
|
$current_gateway = $gateways[ $current ];
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
if ( ! $current_gateway ) {
|
||||||
$current_gateway = current( $gateways );
|
$current_gateway = current( $gateways );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue