code: protected function isAcceptedPayment(PaymentInterface $payment)
      {
          return in_array($payment->getState(), $this->getAcceptedStates($payment), true);
      }
docs: Returns whether the credit/outstanding payment is accepted.
  
  @param PaymentInterface $payment
  
  @return bool