forked from andela-sjames/paystack-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrecipient.py
More file actions
39 lines (30 loc) · 1.15 KB
/
trecipient.py
File metadata and controls
39 lines (30 loc) · 1.15 KB
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
30
31
32
33
34
35
36
37
38
39
"""Script used to define the paystack Transfer Recipient class."""
from paystackapi.base import PayStackBase
class TransferRecipient(PayStackBase):
"""docstring for Transfer Recipient."""
@classmethod
def create(cls, **kwargs):
"""
Method defined to create transfer recipient.
Args:
type: Recipient Type (Only nuban at this time)
name: A name for the recipient
account_number: Required if type is nuban
bank_code: Required if type is nuban.
You can get the list of Bank Codes by calling the List Banks endpoint.
**kwargs
Returns:
Json data from paystack API.
"""
return cls().requests.post('transferrecipient', data=kwargs,)
@classmethod
def list(cls, **kwargs):
"""
Method defined to list transfer recipient.
Args:
perPage: records you want to retrieve per page (Integer)
page: what page you want to retrieve (Integer)
Returns:
Json data from paystack API.
"""
return cls().requests.get('transferrecipient', qs=kwargs,)