Added support for failed and check if invoice was paid.