forked from Jake-parkers/rave-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrwanda.py
More file actions
25 lines (21 loc) · 698 Bytes
/
rwanda.py
File metadata and controls
25 lines (21 loc) · 698 Bytes
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
from rave_python import Rave, RaveExceptions, Misc
rave = Rave("FLWPUBK_TEST-*********************-X", "FLWSECK_TEST-**************************-X", production = True, usingEnv = False)
# mobile payload
payload = {
"amount": "50",
"email": "vokuduj@webmail24.top",
"phonenumber": "243546576879",
"redirect_url": "https://rave-webhook.herokuapp.com/receivepayment",
"IP":""
}
try:
res = rave.RWMobile.charge(payload)
print (res)
res = rave.RWMobile.verify(res["txRef"])
print(res)
except RaveExceptions.TransactionChargeError as e:
print(e.err)
print(e.err["flwRef"])
except RaveExceptions.TransactionVerificationError as e:
print(e.err["errMsg"])
print(e.err["txRef"])