File: plan.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 (21 lines) | stat: -rw-r--r-- 730 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from braintree.util.http import Http
import braintree
from braintree.add_on import AddOn
from braintree.configuration import Configuration
from braintree.discount import Discount
from braintree.resource_collection import ResourceCollection
from braintree.resource import Resource

class Plan(Resource):

    def __init__(self, gateway, attributes):
        Resource.__init__(self, gateway, attributes)
        if "add_ons" in attributes:
            self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons]
        if "discounts" in attributes:
            self.discounts = [Discount(gateway, discount) for discount in self.discounts]

    @staticmethod
    def all():
        return Configuration.gateway().plan.all()