Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/helpers.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/helpers.py	(revision 14787)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/helpers.py	(revision 14788)
@@ -116,6 +116,6 @@
     payment.r_company = u'remita'
     if payment.r_code not in ('00', '01'):
-        msg = _('Unsuccessful callback: ${a}', mapping = {'a': payment.r_desc})
-        log = 'unsuccessful callback for %s payment %s: %s' % (
+        msg = _('Unsuccessful response: ${a}', mapping = {'a': payment.r_desc})
+        log = 'unsuccessful response for %s payment %s: %s' % (
             payment.p_category, payment.p_id, payment.r_desc)
         payment.p_state = 'failed'
@@ -123,6 +123,6 @@
         return False, msg, log
     if round(payment.r_amount_approved, 0) != round(payment.amount_auth, 0):
-        msg = _('Callback amount does not match.')
-        log = 'wrong callback for %s payment %s: %s' % (
+        msg = _('Response amount does not match.')
+        log = 'wrong response for %s payment %s: %s' % (
             payment.p_category, payment.p_id, str(jr))
         payment.p_state = 'failed'
@@ -130,6 +130,6 @@
         return False, msg, log
     if jr['orderId'] != payment.p_id:
-        msg = _('Callback order id does not match.')
-        log = 'wrong callback for %s payment %s: %s' % (
+        msg = _('Response order id does not match.')
+        log = 'wrong response for %s payment %s: %s' % (
             payment.p_category, payment.p_id, str(jr))
         payment.p_state = 'failed'
@@ -139,6 +139,6 @@
     if not verify:
         payment.payment_date = datetime.utcnow()
-    msg = _('Successful callback received')
-    log = 'valid callback for %s payment %s: %s' % (
+    msg = _('Successful response received')
+    log = 'valid response for %s payment %s: %s' % (
         payment.p_category, payment.p_id, str(jr))
     notify(grok.ObjectModifiedEvent(payment))
Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py	(revision 14787)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py	(revision 14788)
@@ -166,6 +166,6 @@
         assert qr == (
             False,
-            u'Unsuccessful callback: ${a}',
-            u'unsuccessful callback for schoolfee payment %s: Transaction Pending'
+            u'Unsuccessful response: ${a}',
+            u'unsuccessful response for schoolfee payment %s: Transaction Pending'
             % self.payment.p_id)
 
@@ -182,5 +182,5 @@
             verify=False)
         assert qr[0] == True
-        assert qr[1] == u'Successful callback received'
+        assert qr[1] == u'Successful response received'
 
     @external_test
@@ -211,9 +211,9 @@
         self.payment.r_pay_reference = self.rrr
         self.browser.getLink("Requery Remita Payment Status").click()
-        self.assertTrue('Callback amount does not match.'
+        self.assertTrue('Response amount does not match.'
             in self.browser.contents)
         self.payment.amount_auth = self.amount
         self.browser.getLink("Requery Remita Payment Status").click()
-        self.assertTrue('Callback order id does not match.'
+        self.assertTrue('Response order id does not match.'
             in self.browser.contents)
         self.payment.p_id = self.orderId
@@ -224,5 +224,5 @@
         self.assertEqual(self.payment.r_code, '01')
         self.browser.getLink("Verify Remita Payment Status").click()
-        self.assertTrue('Successful callback received' in self.browser.contents)
+        self.assertTrue('Successful response received' in self.browser.contents)
         return
 
@@ -268,5 +268,5 @@
         self.assertTrue(
             'zope.anybody - kofacustom.nigeria.remita.webservices.PaymentNotificationListenerWebservice'
-            ' - K1000000 - valid callback for schoolfee payment %s: '
+            ' - K1000000 - valid response for schoolfee payment %s: '
             % self.orderId   in logcontent)
         self.assertTrue(
@@ -321,5 +321,5 @@
         self.assertTrue(
             'zope.anybody - kofacustom.nigeria.remita.webservices.PaymentNotificationListenerWebservice'
-            ' - %s - valid callback for application payment %s: '
+            ' - %s - valid response for application payment %s: '
             % (self.applicant.applicant_id, self.orderId) in logcontent)
         self.assertTrue(
Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/webservices.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/webservices.py	(revision 14787)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/webservices.py	(revision 14788)
@@ -96,4 +96,8 @@
                 continue
             ticket = results[0]
+            if ticket.p_state == 'waived':
+                failed += 1
+                continue
+            waspaid = (ticket.p_state == 'paid')
             success, msg, log = query_remita(
                 ticket, self.merchantId, self.api_key,
@@ -105,16 +109,18 @@
                 ticket.student.writeLogMessage(self, log)
                 successful += 1
-                write_payments_log(ticket.student.student_id, ticket)
-                flashtype, msg, log = ticket.doAfterStudentPayment()
-                if log is not None:
-                    ticket.student.writeLogMessage(self, log)
+                if not waspaid:
+                    write_payments_log(ticket.student.student_id, ticket)
+                    flashtype, msg, log = ticket.doAfterStudentPayment()
+                    if log is not None:
+                        ticket.student.writeLogMessage(self, log)
             else:
                 applicant = ticket.__parent__
                 applicant.writeLogMessage(self, log)
                 successful += 1
-                write_payments_log(applicant.applicant_id, ticket)
-                flashtype, msg, log = ticket.doAfterApplicantPayment()
-                if log is not None:
-                    applicant.writeLogMessage(self, log)
+                if not waspaid:
+                    write_payments_log(applicant.applicant_id, ticket)
+                    flashtype, msg, log = ticket.doAfterApplicantPayment()
+                    if log is not None:
+                        applicant.writeLogMessage(self, log)
         self.output = '%s (%s)' % (successful, failed + successful)
         return
