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

@param PaymentInterface $payment

@return bool