Don't force default token gateway active by default
This commit is contained in:
parent
20c184274b
commit
2ef13c3e72
|
@ -179,19 +179,14 @@ class WC_Payment_Gateways {
|
|||
return;
|
||||
}
|
||||
|
||||
if ( is_user_logged_in() ) {
|
||||
$default_token = WC_Payment_Tokens::get_customer_default_token( get_current_user_id() );
|
||||
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' ) );
|
||||
$current_gateway = false;
|
||||
$current = WC()->session->get( 'chosen_payment_method' );
|
||||
|
||||
if ( $current && isset( $gateways[ $current ] ) ) {
|
||||
$current_gateway = $gateways[ $current ];
|
||||
}
|
||||
|
||||
} else {
|
||||
if ( ! $current_gateway ) {
|
||||
$current_gateway = current( $gateways );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue