Skip to content

is_success and is_declined is broken #6

@chadwhitacre

Description

@chadwhitacre
(Pdb) trans.is_success()
*** AttributeError: 'Transaction' object has no attribute 'processor_response'
(Pdb) trans.is_declined()
*** AttributeError: 'function' object has no attribute 'get'
(Pdb) 

The docstring for each says "You are better off checking trans.errors", which is good advice. Could these functions themselves be simplified to use trans.errors?

def is_success(self):
    return not self.is_declined()

def is_declined(self):
    return bool(self.errors)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions