File: paypal_account.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 (29 lines) | stat: -rw-r--r-- 1,007 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import braintree
from braintree.resource import Resource
from braintree.configuration import Configuration

class PayPalAccount(Resource):
    @staticmethod
    def find(paypal_account_token):
        return Configuration.gateway().paypal_account.find(paypal_account_token)

    @staticmethod
    def delete(paypal_account_token):
        return Configuration.gateway().paypal_account.delete(paypal_account_token)

    @staticmethod
    def update(paypal_account_token, params={}):
        return Configuration.gateway().paypal_account.update(paypal_account_token, params)

    @staticmethod
    def signature():
        signature = [
            "token",
            {"options": ["make_default"]}
        ]
        return signature

    def __init__(self, gateway, attributes):
        Resource.__init__(self, gateway, attributes)
        if "subscriptions" in attributes:
            self.subscriptions = [braintree.subscription.Subscription(gateway, subscription) for subscription in self.subscriptions]