forked from andela-sjames/paystack-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverification.py
More file actions
62 lines (47 loc) · 1.51 KB
/
verification.py
File metadata and controls
62 lines (47 loc) · 1.51 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
"""Script used to define the paystack Verification class."""
from paystackapi.base import PayStackBase
class Verification(PayStackBase):
"""docstring for Verification."""
@classmethod
def verify_bvn(cls, bvn):
"""
Verify BVN
Args:
bvn: customer's BVN number
Returns:
Json data from paystack API.
"""
return cls().requests.get(f"bank/resolve_bvn/{bvn}")
@classmethod
def verify_account(cls, **kwargs):
"""
Verify account
Args:
account_number: customer's account number
bank_code: customer's bank code
Returns:
Json data from paystack API.
"""
return cls().requests.get("bank/resolve", qs=kwargs,)
@classmethod
def verify_card_bin(cls, card_bin):
"""
Verify card bin
Args:
card_bin: customer's card bin number
Returns:
Json data from paystack API.
"""
return cls().requests.get(f"decision/bin/{card_bin}")
@classmethod
def verify_phone(cls, **kwargs):
"""
Verify customer phone number
Args:
verification_type: phone verification type
phone: customer's phone number
callback_url: url to receive verification details
Returns:
Json data from paystack API.
"""
return cls().requests.post('verifications', data=kwargs)