Skip to content

Commit 3745bf2

Browse files
added meta in verify response for card charges
1 parent 34b3fdb commit 3745bf2

8 files changed

+32
-31
lines changed

rave_python/rave_bills.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def create(self, details):
5757
tracking_payload = {
5858
"publicKey": self._getPublicKey(),
5959
"language": "Python v2",
60-
"version": "1.2.12",
60+
"version": "1.2.13",
6161
"title": "Create-Bills-error",
6262
"message": responseTime
6363
}
@@ -68,7 +68,7 @@ def create(self, details):
6868
tracking_payload = {
6969
"publicKey": self._getPublicKey(),
7070
"language": "Python v2",
71-
"version": "1.2.12",
71+
"version": "1.2.13",
7272
"title": "Create-Bills",
7373
"message": responseTime
7474
}

rave_python/rave_card.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def _handleVerifyResponse(self, response, txRef):
7171
chargemessage = responseJson["data"]["chargemessage"]
7272
chargecode = responseJson["data"]["chargecode"]
7373
currency = responseJson["data"]["currency"]
74+
meta = responseJson["data"]["meta"]
7475

7576
# Check if the call returned something other than a 200
7677
if not response.ok:
@@ -79,10 +80,10 @@ def _handleVerifyResponse(self, response, txRef):
7980

8081
# if the chargecode is not 00
8182
elif not (responseJson["data"].get("chargecode", None) == "00"):
82-
return {"error": False, "transactionComplete": False, "txRef": txRef, "flwRef":flwRef, "amount": amount, "chargedamount": chargedamount, "cardToken": cardToken, "vbvmessage": vbvmessage, "chargemessage": chargemessage, "chargecode": chargecode, "currency": currency}
83+
return {"error": False, "transactionComplete": False, "txRef": txRef, "flwRef":flwRef, "amount": amount, "chargedamount": chargedamount, "cardToken": cardToken, "vbvmessage": vbvmessage, "chargemessage": chargemessage, "chargecode": chargecode, "currency": currency, "meta": meta}
8384

8485
else:
85-
return {"error":False, "transactionComplete": True, "txRef": txRef, "flwRef": flwRef, "amount": amount, "chargedamount": chargedamount, "cardToken": cardToken, "vbvmessage": vbvmessage, "chargemessage": chargemessage, "chargecode": chargecode, "currency": currency}
86+
return {"error":False, "transactionComplete": True, "txRef": txRef, "flwRef": flwRef, "amount": amount, "chargedamount": chargedamount, "cardToken": cardToken, "vbvmessage": vbvmessage, "chargemessage": chargemessage, "chargecode": chargecode, "currency": currency, "meta": meta}
8687

8788

8889
# Charge card function

rave_python/rave_payment.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,12 @@ def charge(self, feature_name, paymentDetails, requiredParameters, endpoint, sho
219219
if response.ok:
220220
tracking_endpoint = self._trackingMap
221221
responseTime = response.elapsed.total_seconds()
222-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name, "message": responseTime}
222+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name, "message": responseTime}
223223
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
224224
else:
225225
tracking_endpoint = self._trackingMap
226226
responseTime = response.elapsed.total_seconds()
227-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name + "-error", "message": responseTime}
227+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name + "-error", "message": responseTime}
228228
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
229229

230230
if shouldReturnRequest:
@@ -266,12 +266,12 @@ def validate(self, feature_name, flwRef, otp, endpoint=None):
266266
if response.ok:
267267
tracking_endpoint = self._trackingMap
268268
responseTime = response.elapsed.total_seconds()
269-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name, "message": responseTime}
269+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name, "message": responseTime}
270270
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
271271
else:
272272
tracking_endpoint = self._trackingMap
273273
responseTime = response.elapsed.total_seconds()
274-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name + "-error", "message": responseTime}
274+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name + "-error", "message": responseTime}
275275
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
276276

277277
return self._handleValidateResponse(response, flwRef)
@@ -301,12 +301,12 @@ def verify(self, feature_name, txRef, endpoint=None):
301301
if response.ok:
302302
tracking_endpoint = self._trackingMap
303303
responseTime = response.elapsed.total_seconds()
304-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name, "message": responseTime}
304+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name, "message": responseTime}
305305
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
306306
else:
307307
tracking_endpoint = self._trackingMap
308308
responseTime = response.elapsed.total_seconds()
309-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name + "-error", "message": responseTime}
309+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name + "-error", "message": responseTime}
310310
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
311311

312312
return self._handleVerifyResponse(response, txRef)
@@ -333,12 +333,12 @@ def refund(self, feature_name, flwRef, amount, ):
333333
if response.ok:
334334
tracking_endpoint = self._trackingMap
335335
responseTime = response.elapsed.total_seconds()
336-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name, "message": responseTime}
336+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name, "message": responseTime}
337337
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
338338
else:
339339
tracking_endpoint = self._trackingMap
340340
responseTime = response.elapsed.total_seconds()
341-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name + "-error", "message": responseTime}
341+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name + "-error", "message": responseTime}
342342
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
343343

344344
try:

rave_python/rave_transfer.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ def _handleTransferStatusRequests(self, feature_name, endpoint, isPostRequest=Fa
6868
if response.ok:
6969
tracking_endpoint = self._trackingMap
7070
responseTime = response.elapsed.total_seconds()
71-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name,"message": responseTime}
71+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name,"message": responseTime}
7272
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
7373
return {"error": False, "returnedData": responseJson}
7474
else:
7575
tracking_endpoint = self._trackingMap
7676
responseTime = response.elapsed.total_seconds()
77-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name + "-error","message": responseTime}
77+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name + "-error","message": responseTime}
7878
raise TransferFetchError({"error": True, "returnedData": responseJson })
7979

8080
def _handleTransferRetriesRequests(self, feature_name, endpoint, isPostRequest=False, data=None):
@@ -101,13 +101,13 @@ def _handleTransferRetriesRequests(self, feature_name, endpoint, isPostRequest=F
101101
if response.ok:
102102
tracking_endpoint = self._trackingMap
103103
responseTime = response.elapsed.total_seconds()
104-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name,"message": responseTime}
104+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name,"message": responseTime}
105105
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
106106
return {"error": False, "returnedData": responseJson}
107107
else:
108108
tracking_endpoint = self._trackingMap
109109
responseTime = response.elapsed.total_seconds()
110-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name + "-error","message": responseTime}
110+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name + "-error","message": responseTime}
111111
return {"error": True, "returnedData": errorMessage }
112112

113113

@@ -140,12 +140,12 @@ def initiate(self, transferDetails):
140140
#feature logging
141141
tracking_endpoint = self._trackingMap
142142
responseTime = response.elapsed.total_seconds()
143-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": "Initiate-Transfer-error","message": responseTime}
143+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": "Initiate-Transfer-error","message": responseTime}
144144
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
145145
else:
146146
tracking_endpoint = self._trackingMap
147147
responseTime = response.elapsed.total_seconds()
148-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": "Initiate-Transfer","message": responseTime}
148+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": "Initiate-Transfer","message": responseTime}
149149
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
150150
return self._handleInitiateResponse(response, transferDetails)
151151

@@ -172,12 +172,12 @@ def bulk(self, bulkDetails):
172172
#feature logging
173173
tracking_endpoint = self._trackingMap
174174
responseTime = response.elapsed.total_seconds()
175-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": "Initiate-Bulk-error","message": responseTime}
175+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": "Initiate-Bulk-error","message": responseTime}
176176
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
177177
else:
178178
tracking_endpoint = self._trackingMap
179179
responseTime = response.elapsed.total_seconds()
180-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": "Initiate-Bulk","message": responseTime}
180+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": "Initiate-Bulk","message": responseTime}
181181
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
182182

183183
return self._handleBulkResponse(response, bulkDetails)
@@ -254,12 +254,12 @@ def fetchRetries(self, transfer_id):
254254
# #feature logging
255255
# tracking_endpoint = self._trackingMap
256256
# responseTime = response.elapsed.total_seconds()
257-
# tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": "interwallet_transfers-error","message": responseTime}
257+
# tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": "interwallet_transfers-error","message": responseTime}
258258
# tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
259259
# else:
260260
# tracking_endpoint = self._trackingMap
261261
# responseTime = response.elapsed.total_seconds()
262-
# tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": "interwallet_transfers","message": responseTime}
262+
# tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": "interwallet_transfers","message": responseTime}
263263
# tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
264264
# return self._handleInitiateInterWalletResponse(response, data)
265265

rave_python/rave_verify.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ def _handleVerifyStatusRequests(self, endpoint, feature_name, isPostRequest=Fals
5454
#feature logging
5555
tracking_endpoint = self._trackingMap
5656
responseTime = response.elapsed.total_seconds()
57-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name,"message": responseTime}
57+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name,"message": responseTime}
5858
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
5959
return {"error": False, "returnedData": responseJson}
6060
else:
6161
tracking_endpoint = self._trackingMap
6262
responseTime = response.elapsed.total_seconds()
63-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name + "-error", "message": responseTime}
63+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name + "-error", "message": responseTime}
6464
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
6565

6666
raise BVNFetchError({"error": True, "returnedData": responseJson })

rave_python/rave_virtualaccount.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ def create(self, accountDetails):
7272
if response.ok == False:
7373
tracking_endpoint = self._trackingMap
7474
responseTime = response.elapsed.total_seconds()
75-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": "Create-virtual-account-error","message": responseTime}
75+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": "Create-virtual-account-error","message": responseTime}
7676
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
7777
else:
7878
tracking_endpoint = self._trackingMap
7979
responseTime = response.elapsed.total_seconds()
80-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": "Create-virtual-account","message": responseTime}
80+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": "Create-virtual-account","message": responseTime}
8181
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
8282

8383
return self._handleCreateResponse(response, accountDetails)

rave_python/rave_virtualcard.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ def _handleCardStatusRequests(self, type, endpoint, feature_name, isPostRequest=
5454
#feature logging
5555
tracking_endpoint = self._trackingMap
5656
responseTime = response.elapsed.total_seconds()
57-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name,"message": responseTime}
57+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name,"message": responseTime}
5858
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
5959

6060
return {"error": False, "returnedData": responseJson}
6161
else:
6262
tracking_endpoint = self._trackingMap
6363
responseTime = response.elapsed.total_seconds()
64-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": feature_name + "-error","message": responseTime}
64+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": feature_name + "-error","message": responseTime}
6565
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
6666

6767
raise CardStatusError(type, {"error": True, "returnedData": responseJson })
@@ -84,12 +84,12 @@ def create(self, vcardDetails):
8484
if response.ok == False:
8585
tracking_endpoint = self._trackingMap
8686
responseTime = response.elapsed.total_seconds()
87-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": "Create-card-error", "message": responseTime}
87+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": "Create-card-error", "message": responseTime}
8888
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
8989
else:
9090
tracking_endpoint = self._trackingMap
9191
responseTime = response.elapsed.total_seconds()
92-
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.12", "title": "Create-card","message": responseTime}
92+
tracking_payload = {"publicKey": self._getPublicKey(),"language": "Python v2", "version": "1.2.13", "title": "Create-card","message": responseTime}
9393
tracking_response = requests.post(tracking_endpoint, data=json.dumps(tracking_payload))
9494

9595
return self._handleCreateResponse(response, vcardDetails)

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="rave_python",
8-
version="1.2.12",
8+
version="1.2.13",
99
author="Flutterwave",
1010
author_email="[email protected]",
1111
description="Official Rave Python Wrapper By Flutterwave",

0 commit comments

Comments
 (0)