File: disbursement.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 (19 lines) | stat: -rw-r--r-- 785 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from decimal import Decimal
from braintree.resource import Resource
from braintree.transaction_search import TransactionSearch
from braintree.merchant_account import MerchantAccount

class Disbursement(Resource):
    def __init__(self, gateway, attributes):
        Resource.__init__(self, gateway, attributes)
        self.amount = Decimal(self.amount)
        self.merchant_account = MerchantAccount(gateway, attributes["merchant_account"])

    def __repr__(self):
        detail_list = ["amount", "disbursement_date", "exception_message", "follow_up_action", "id", "success", "retry"]
        return super(Disbursement, self).__repr__(detail_list)

    def transactions(self):
        return self.gateway.transaction.search([TransactionSearch.ids.in_list(self.transaction_ids)])