Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py	(revision 16515)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py	(revision 16528)
@@ -361,6 +361,6 @@
         notify(grok.ObjectModifiedEvent(payment))
         return False, msg, log
-    if payment.r_amount_approved != payment.amount_auth:
-        msg = _('Callback amount does not match.')
+    if payment.r_amount_approved != payment.net_amt:
+        msg = _('Callback amount does not match net amount.')
         log = 'unsuccessful callback for %s payment %s: callback amount %s does not match' % (
             payment.p_category, payment.p_id, amount)
Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/paydirectbrowser.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/paydirectbrowser.py	(revision 16515)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/paydirectbrowser.py	(revision 16528)
@@ -26,4 +26,5 @@
 from waeup.kofa.browser.layout import UtilityView, KofaPage, KofaFormPage, action
 from waeup.kofa.browser.viewlets import ManageActionButton
+from waeup.kofa.payments.interfaces import IPayer
 from waeup.kofa.students.interfaces import IStudentsUtils
 from waeup.kofa.students.browser import OnlinePaymentDisplayFormPage as OPDPStudent
@@ -117,9 +118,12 @@
                 self.gateway_url, True)
             if result_xml.startswith('Connection error'):
+                IPayer(self.context).payer.writeLogMessage(self, result_xml)
                 return result_xml
             doc=parseString(result_xml)
             if not doc.getElementsByTagName('ResponseCode'):
+                IPayer(self.context).payer.writeLogMessage(self, 'invalid callback')
                 return _('Invalid callback from Interswitch')
             rc = doc.getElementsByTagName('ResponseCode')[0].firstChild.data
+            IPayer(self.context).payer.writeLogMessage(self, 'response code: %s' % rc)
             if rc not in ('100', '108'):
                 return 'Error response code from Interswitch: %s' % rc
@@ -148,19 +152,17 @@
     @action('Requery now', style='primary')
     def fetch(self):
-        student = self.context.student
         success, msg, log = fetch_booking_details(
             self.context, self.merchant_id, self.gateway_host,
             self.gateway_url, self.https)
-        student.writeLogMessage(self, log)
+        IPayer(self.context).payer.writeLogMessage(self, log)
         if not success:
             self.flash(msg, type='warning')
             self.redirect(self.url(self.context, '@@index'))
             return
-        write_payments_log(student.student_id, self.context)
-        flashtype, msg, log = self.context.doAfterStudentPayment()
+        write_payments_log(IPayer(self.context).id, self.context)
+        flashtype, msg, log = IPayer(self.context).doAfterPayment()
         if log is not None:
-            student.writeLogMessage(self, log)
+            IPayer(self.context).payer.writeLogMessage(self, log)
         self.flash(msg, type=flashtype)
-        self.redirect(self.url(self.context, '@@index'))
         return
 
@@ -192,22 +194,4 @@
             self.context.gateway_amt = self.gateway_amt
             self.context.r_company = u'interswitch'
-        return
-
-    @action('Requery now', style='primary')
-    def fetch(self):
-        applicant = self.context.__parent__
-        success, msg, log = fetch_booking_details(
-            self.context, self.merchant_id, self.gateway_host,
-            self.gateway_url, self.https)
-        applicant.writeLogMessage(self, log)
-        if not success:
-            self.flash(msg, type='warning')
-            self.redirect(self.url(self.context, '@@index'))
-            return
-        write_payments_log(applicant.applicant_id, self.context)
-        flashtype, msg, log = self.context.doAfterApplicantPayment()
-        if log is not None:
-            applicant.writeLogMessage(self, log)
-        self.flash(msg, type=flashtype)
         return
 
Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py	(revision 16515)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py	(revision 16528)
@@ -303,7 +303,7 @@
         payment.p_session = self.student.current_session
         payment.p_item = u'My Certificate'
-        # p6214352306153 has been manuylly set completed by Interswitch
+        # p6214352306153 has been manually set completed by Interswitch
         payment.p_id = u'p6214352306153'
-        payment.amount_auth = 700.0 # 300 will be added
+        payment.amount_auth = 10.0 # 300 will be added
         self.student['payments'][payment.p_id] = payment
         result_xml = get_SOAP_response_paydirect(
@@ -314,5 +314,5 @@
         amount=float(doc.getElementsByTagName('Amount')[0].firstChild.data)
         self.assertEqual(status, 'Completed')
-        self.assertEqual(amount, payment.amount_auth + 300)
+        self.assertEqual(amount, 1000)
         self.assertEqual(refnumber, '60336214352306153')
         # Now we login and check what will happen with the student after payment
@@ -321,5 +321,6 @@
         self.browser.getLink("Pay via Interswitch PAYDirect").click()
         # 300 has been added
-        self.assertEqual(payment.amount_auth, 1000)
+        self.assertEqual(payment.amount_auth, 310)
+        self.assertEqual(payment.net_amt, 10)
         # Reference number has been saved 
         self.browser.getControl("Requery").click()
