Here you return from constructor if not successful i.e. there was an error. However you return before assigning the error value to the error attribute which results in a run time exception when one tries to access the error attribute after the call was not successful. Fix this by "self.error = data["error"]" before return.
Paynow-Python-SDK/paynow/model.py
Line 119 in ad0212e
Here you return from constructor if not successful i.e. there was an error. However you return before assigning the error value to the error attribute which results in a run time exception when one tries to access the error attribute after the call was not successful. Fix this by "self.error = data["error"]" before return.