diff --git a/changelog/fix-token-retrieval-per-payment-method b/changelog/fix-token-retrieval-per-payment-method new file mode 100644 index 00000000000..1ec9a65c246 --- /dev/null +++ b/changelog/fix-token-retrieval-per-payment-method @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Retrieve saved tokens only relevant for the specific payment gateway. diff --git a/includes/class-wc-payments-token-service.php b/includes/class-wc-payments-token-service.php index 46cbe3b5f65..ecd4670e266 100644 --- a/includes/class-wc-payments-token-service.php +++ b/includes/class-wc-payments-token-service.php @@ -252,7 +252,7 @@ private function get_gateway_specific_retrievable_payment_methods( $gateway_id ) foreach ( self::REUSABLE_GATEWAYS_BY_PAYMENT_METHOD as $payment_method => $gateway ) { if ( $gateway === $gateway_id ) { - if ( Payment_Method::LINK ) { + if ( Payment_Method::LINK === $payment_method ) { if ( $this->is_payment_method_enabled( Payment_Method::LINK ) ) { $methods[] = Payment_Method::LINK; }