Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/browser.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/browser.py	(revision 12509)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/browser.py	(revision 12973)
@@ -17,4 +17,5 @@
 ##
 import grok
+from datetime import datetime, timedelta
 from zope.component import getUtility
 from waeup.kofa.interfaces import IKofaUtils
@@ -165,4 +166,8 @@
         if self.context.p_state == 'paid':
             return _("Payment ticket can't be re-sent to CollegePAY.")
+        tz = getUtility(IKofaUtils).tzinfo
+        time_delta = datetime.utcnow() - self.context.creation_date
+        if time_delta.seconds > 3600:
+            return _("This payment ticket is too old. Please create a new ticket.")
         student = self.context.student
         certificate = getattr(student['studycourse'],'certificate',None)
@@ -224,4 +229,8 @@
             return _("Payment ticket can't be send to CollegePAY. "
                      "Application period has expired.")
+        tz = getUtility(IKofaUtils).tzinfo
+        time_delta = datetime.utcnow() - self.context.creation_date
+        if time_delta.seconds > 3600:
+            return _("This payment ticket is too old. Please create a new ticket.")
         self.applicant = self.context.__parent__
         self.amount_auth = int(100 * self.context.amount_auth)
Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py	(revision 12509)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py	(revision 12973)
@@ -17,5 +17,5 @@
 ##
 import os
-from datetime import datetime
+from datetime import datetime, timedelta, date
 from zope.component import createObject, getUtility
 from zope.catalog.interfaces import ICatalog
@@ -52,4 +52,5 @@
             self.browser.contents)
         self.payment_url = self.browser.url
+        self.payment = self.student['payments'][self.value]
 
     def test_interswitch_form(self):
@@ -94,4 +95,29 @@
             self.browser.contents)
 
+    def test_interswitch_form_ticket_expired(self):
+        # Manager can access InterswitchForm
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertMatches('...<input type="hidden" name="pay_item_id" />...',
+                           self.browser.contents)
+        self.assertMatches('...Total Amount Authorized:...',
+                           self.browser.contents)
+        self.assertEqual(self.student.current_mode, 'ug_ft')
+        self.assertMatches(
+            '...<input type="hidden" name="amount" value="4000000" />...',
+            self.browser.contents)
+        delta = timedelta(minutes=61)
+        self.payment.creation_date -= delta
+        self.browser.open(self.payment_url)
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertMatches(
+            '...This payment ticket is too old. Please create a new ticket...',
+            self.browser.contents)
+        delta = timedelta(minutes=2)
+        self.payment.creation_date += delta
+        self.browser.open(self.payment_url)
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertMatches('...Total Amount Authorized:...',
+                           self.browser.contents)
+
 class InterswitchTestsApplicants(ApplicantsFullSetup):
     """Tests for the Interswitch payment gateway.
@@ -116,7 +142,5 @@
         self.assertMatches('...ticket created...',
                            self.browser.contents)
-        #ctrl = self.browser.getControl(name='val_id')
-        #value = ctrl.options[0]
-        #self.browser.getLink(value).click()
+        self.payment = self.applicant.values()[0]
         self.payment_url = self.browser.url
 
@@ -134,3 +158,15 @@
             '...<input type="hidden" name="amount" value="100000" />...',
             self.browser.contents)
+        delta = timedelta(minutes=61)
+        self.payment.creation_date -= delta
+        self.browser.open(self.payment_url)
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertMatches(
+            '...This payment ticket is too old. Please create a new ticket...',
+            self.browser.contents)
+        delta = timedelta(minutes=2)
+        self.payment.creation_date += delta
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertMatches('...Total Amount Authorized:...',
+                           self.browser.contents)
 
