Index: main/kofacustom.nigeria/trunk/CHANGES.txt
===================================================================
--- main/kofacustom.nigeria/trunk/CHANGES.txt	(revision 13580)
+++ main/kofacustom.nigeria/trunk/CHANGES.txt	(revision 13581)
@@ -4,4 +4,6 @@
 1.3.dev0 (unreleased)
 =====================
+
+- Add buttons and pages to verify CollegePay payments.
 
 - Implement Interswitch JSON transaction query. This webservice is
Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/browser.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/browser.py	(revision 13580)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/browser.py	(revision 13581)
@@ -34,4 +34,6 @@
 from kofacustom.nigeria.interfaces import MessageFactory as _
 
+# Buttons
+
 class InterswitchActionButtonStudent(ManageActionButton):
     grok.order(1)
@@ -73,4 +75,27 @@
     grok.require('waeup.payApplicant')
 
+class InterswitchVerifyWebserviceActionButtonStudent(ManageActionButton):
+    grok.order(3)
+    grok.context(INigeriaOnlinePayment)
+    grok.view(OPDPStudent)
+    grok.require('waeup.manageStudent')
+    icon = 'actionicon_call.png'
+    text = _('Verify Payment')
+    target = 'verify_payment'
+
+    @property
+    def target_url(self):
+        if self.context.p_state != 'paid':
+            return ''
+        return self.view.url(self.view.context, self.target)
+
+class InterswitchVerifyWebserviceActionButtonApplicant(
+    InterswitchVerifyWebserviceActionButtonStudent):
+    grok.view(OPDPApplicant)
+    grok.require('waeup.manageApplication')
+
+
+# Webservice request views
+
 class InterswitchPaymentRequestWebservicePageStudent(UtilityView, grok.View):
     """ Request webservice view for the CollegePAY gateway
@@ -146,4 +171,72 @@
         self.redirect(self.url(self.context, '@@index'))
         return
+
+class InterswitchPaymentVerifyWebservicePageStudent(UtilityView, grok.View):
+    """ Verify payment view for the CollegePAY gateway
+    """
+    grok.context(INigeriaStudentOnlinePayment)
+    grok.name('verify_payment')
+    grok.require('waeup.manageStudent')
+
+    product_id = None
+    gateway_host = None
+    gateway_url = None
+    https = True
+    mac = None
+
+    def update(self):
+        if self.context.p_state  != 'paid':
+            self.flash(_('This ticket has not been paid.'), type='danger')
+            return
+        student = self.context.student
+        success, msg, log = query_interswitch(
+            self.context, self.product_id,
+            self.gateway_host, self.gateway_url,
+            self.https, self.mac)
+        student.writeLogMessage(self, log)
+        if not success:
+            self.flash(msg, type='danger')
+            return
+        self.flash(msg)
+        return
+
+    def render(self):
+        self.redirect(self.url(self.context, '@@index'))
+        return
+
+class InterswitchPaymentVerifyWebservicePageApplicant(UtilityView, grok.View):
+    """ Verify payment view for the CollegePAY gateway
+    """
+    grok.context(INigeriaApplicantOnlinePayment)
+    grok.name('verify_payment')
+    grok.require('waeup.manageApplication')
+
+    product_id = None
+    gateway_host = None
+    gateway_url = None
+    https = True
+    mac = None
+
+    def update(self):
+        if self.context.p_state != 'paid':
+            self.flash(_('This ticket has not been paid.'), type='danger')
+            return
+        applicant = self.context.__parent__
+        success, msg, log = query_interswitch(
+            self.context, self.product_id,
+            self.gateway_host, self.gateway_url,
+            self.https, self.mac)
+        applicant.writeLogMessage(self, log)
+        if not success:
+            self.flash(msg, type='danger')
+            return
+        self.flash(msg)
+        return
+
+    def render(self):
+        self.redirect(self.url(self.context, '@@index'))
+        return
+
+# Forwarding pages
 
 class InterswitchPageStudent(KofaPage):
Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py	(revision 13580)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py	(revision 13581)
@@ -133,5 +133,5 @@
     payment.p_state = 'paid'
     payment.payment_date = datetime.utcnow()
-    msg = _('Successful callback received')
+    msg = _('Successful callback received.')
     log = 'valid callback for %s payment %s: %s' % (
         payment.p_category, payment.p_id, sr)
