Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py	(revision 17230)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py	(revision 17231)
@@ -382,7 +382,12 @@
 # Web checkout helper functions
 
-def get_JSON_webcheckout_response(merchant_code, transref, host, url, https, amount):
+def get_JSON_webcheckout_response(merchant_code, transref, host, url,
+                                  https, amount, mac=None):
+    amount = int(100 * amount)
+    hashargs = transref + merchant_code + str(amount) + mac
+    hashvalue = hashlib.sha512(hashargs).hexdigest()
     headers={
         'Content-Type':'text/xml; charset=utf-8',
+        'Hash':hashvalue,
     }
     if https:
@@ -390,5 +395,4 @@
     else:
         h = httplib.HTTPConnection(host)
-    amount = int(100 * amount)
     args = {'merchantcode': merchant_code,
             'transactionreference': transref,
@@ -401,12 +405,13 @@
     response = h.getresponse()
     if response.status!=200:
-        return {'error': 'Connection error (%s, %s)' % (response.status, response.reason)}
+        return {'error': 'Connection error (%s, %s)' % (
+            response.status, response.reason)}
     jsonout = response.read()
     parsed_json = json.loads(jsonout)
     return parsed_json
 
-def confirm_transaction(payment, merchant_code, host, url, https=True):
+def confirm_transaction(payment, merchant_code, host, url, https, mac):
     jr = get_JSON_webcheckout_response(merchant_code, payment.p_id, host, url,
-                           https, payment.amount_auth)
+                           https, payment.amount_auth, mac)
     error = jr.get('error')
     if error:
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py	(revision 17230)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py	(revision 17231)
@@ -419,4 +419,6 @@
     # https://webpay.interswitchng.com/collections/api/v1/gettransaction.json?merchantcode=MX76823&transactionreference=p6709347986663&amount=100
 
+    mac = "uS6U18pC6GFKCpJoZH6J6jlOmR81FSrHkjBRpMaaydNQtywuG0hdB02J56MCqLV8rmzeAkhiaQR2nNcX3EPJePl5ppidImeKSzdunhddQh61UGpZPiS2CxMdAem8ueA1"
+
     @external_test_3
     def test_confirm_transaction(self):
@@ -427,6 +429,7 @@
         payment = StudentOnlinePayment()
         payment.p_id ='p4465649308559'
+        payment.amount_auth = 100000.0
         success, msg, log = confirm_transaction(
-            payment, merchant_code, host, url, https)
+            payment, merchant_code, host, url, https, self.mac)
         self.assertFalse(success)
         self.assertTrue('Unsuccessful callback:' in msg)
@@ -436,9 +439,9 @@
         payment.amount_auth = 1.0
         success, msg, log = confirm_transaction(
-            payment, merchant_code, host, url, https)
+            payment, merchant_code, host, url, https, self.mac)
         self.assertTrue('Amount Inconsistency' in log)
         payment.amount_auth = 100.0
         success, msg, log = confirm_transaction(
-            payment, merchant_code, host, url, https)
+            payment, merchant_code, host, url, https, self.mac)
         self.assertEqual('Successful callback received', msg)
         self.assertTrue(success)
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/webcheckoutbrowser.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/webcheckoutbrowser.py	(revision 17230)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/webcheckoutbrowser.py	(revision 17231)
@@ -267,4 +267,5 @@
     https = True
     split_accounts = None
+    mac = None
 
 
@@ -282,5 +283,6 @@
             self.gateway_host,
             self.gateway_url,
-            self.https)
+            self.https,
+            self.mac)
         applicant.writeLogMessage(self, log)
         if not success:
@@ -309,4 +311,5 @@
     gateway_url = None
     https = True
+    mac = None
 
     def update(self):
@@ -323,5 +326,6 @@
             self.gateway_host,
             self.gateway_url,
-            self.https)
+            self.https,
+            self.mac)
         student.writeLogMessage(self, log)
         if not success:
