forked from andela-sjames/paystack-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtcontrol.py
More file actions
78 lines (55 loc) · 1.72 KB
/
tcontrol.py
File metadata and controls
78 lines (55 loc) · 1.72 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"""Script used to define the paystack Transfer Control class."""
from paystackapi.base import PayStackBase
class TransferControl(PayStackBase):
"""docstring for Transfer Control."""
@classmethod
def check_balance(cls):
"""
Check Balance.
Args:
No argument required.
Returns:
Json data from paystack API.
"""
return cls().requests.get('balance')
@classmethod
def resend_otp(cls, **kwargs):
"""
Resend OTP for Transfer.
Args:
transfer_code: Transfer code
reason: either resend_otp or transfer
Returns:
Json data from paystack API.
"""
return cls().requests.post('transfer/resend_otp', data=kwargs,)
@classmethod
def disable_otp(cls):
"""
Disable OTP requirement for Transfers
Args:
No arguments required
Returns:
Json data from paystack API.
"""
return cls().requests.post('transfer/disable_otp')
@classmethod
def disable_otp_finalize(cls, **kwargs):
"""
Finalize Disabling of OTP requirement for Transfers
Args:
otp: OTP sent to business phone to verify disabling OTP requirement
Returns:
Json data from paystack API.
"""
return cls().requests.post('transfer/disable_otp_finalize', data=kwargs,)
@classmethod
def enable_otp(cls, **kwargs):
"""
Enable OTP requirement for Transfers
Args:
No arguments required
Returns:
Json data from paystack API.
"""
return cls().requests.post('transfer/enable_otp', data=kwargs,)