File: successful_result.py

package info (click to toggle)
python-braintree 3.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,376 kB
  • ctags: 1,998
  • sloc: python: 13,634; makefile: 73; sh: 8
file content (17 lines) | stat: -rw-r--r-- 631 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from braintree.attribute_getter import AttributeGetter

class SuccessfulResult(AttributeGetter):
    """
    An instance of this class is returned from most operations when the request is successful.  Call the name of the resource (eg, customer, credit_card, etc) to get the object::

        result = Transaction.sale({..})
        if result.is_success:
            transaction = result.transaction
        else:
            print [error.code for error in result.errors.all]
    """

    @property
    def is_success(self):
        """ Returns whether the result from the gateway is a successful response. """
        return True