added support for payment error and fixed #223