Index: /main/waeup.aaue/trunk/CHANGES.txt
===================================================================
--- /main/waeup.aaue/trunk/CHANGES.txt	(revision 11649)
+++ /main/waeup.aaue/trunk/CHANGES.txt	(revision 11650)
@@ -4,4 +4,7 @@
 1.2dev (unreleased)
 ===================
+
+* The PAYMENT_TYPE Etranzact is sending contains the amount and is
+  being compared with amount_auth of the payment ticket.
 
 * To guarantee that cleared students pay both acceptance fee and school fees,
Index: /main/waeup.aaue/trunk/src/waeup/aaue/etranzact/browser.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/etranzact/browser.py	(revision 11649)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/etranzact/browser.py	(revision 11650)
@@ -65,4 +65,7 @@
     These are not the data of the payee but of the payer. And it's
     not the id of the payer but of the payment.
+
+    The PAYMENT_TYPE Etranzact is sending contains the amount and is
+    being compared with amount_auth of the payment ticket.
     """
     grok.name('feerequest')
@@ -84,5 +87,10 @@
                 self.output = ERROR_PART1 + 'Wrong IP address' + ERROR_PART2
                 return
-        if PAYMENT_TYPE not in ('SCHOOL-FEE', 'ACCEPTANCE-FEE', 'APPLICATION-FEE'):
+
+        #if PAYMENT_TYPE not in ('SCHOOL-FEE', 'ACCEPTANCE-FEE', 'APPLICATION-FEE'):
+
+        try:
+            payment_type_amount = int(PAYMENT_TYPE)
+        except (ValueError, TypeError):
             self.output = ERROR_PART1 + 'Invalid PAYMENT_TYPE' + ERROR_PART2
             return
@@ -114,16 +122,22 @@
             self.output = ERROR_PART1 + 'PAYEE_ID already used' + ERROR_PART2
             return
-        if PAYMENT_TYPE == 'SCHOOL-FEE' \
-            and not results[0].p_category.startswith('schoolfee'):
+
+        #if PAYMENT_TYPE == 'SCHOOL-FEE' \
+        #    and not results[0].p_category.startswith('schoolfee'):
+        #    self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2
+        #    return
+        #if PAYMENT_TYPE == 'ACCEPTANCE-FEE' \
+        #    and not results[0].p_category == 'clearance':
+        #    self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2
+        #    return
+        #if PAYMENT_TYPE == 'APPLICATION-FEE' \
+        #    and not results[0].p_category == 'application':
+        #    self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2
+        #    return
+        
+        if payment_type_amount != amount:
             self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2
             return
-        if PAYMENT_TYPE == 'ACCEPTANCE-FEE' \
-            and not results[0].p_category == 'clearance':
-            self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2
-            return
-        if PAYMENT_TYPE == 'APPLICATION-FEE' \
-            and not results[0].p_category == 'application':
-            self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2
-            return
+
         try:
             owner = IPayer(results[0])
Index: /main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py	(revision 11649)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py	(revision 11650)
@@ -84,20 +84,7 @@
     def test_webservice(self):
         self.browser.open(
-            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE'
+            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=1234'
             % self.p_id)
         self.assertEqual(self.browser.contents,
-            # Version 1
-            #'FULL_NAME=Anna Tester&'
-            #'FACULTY=fac1&'
-            #'DEPARTMENT=dep1&'
-            #'RETURN_TYPE=%s&'
-            #'PROGRAMME_TYPE=CERT1&'
-            #'PAYMENT_TYPE=School Fee&'
-            #'ACADEMIC_SESSION=2004/2005&'
-            #'MATRIC_NO=E1000000&'
-            #'FEE_AMOUNT=1234.0&'
-            #'TRANSACTION_STATUS=unpaid'
-
-            # Version 2
             'PayeeName=Anna Tester~'
             'Faculty=fac1~'
@@ -121,5 +108,5 @@
         self.assertEqual(self.browser.contents, ERROR_PART1 + 'Missing PAYEE_ID' + ERROR_PART2)
         self.browser.open(
-            'http://localhost/app/feerequest?PAYEE_ID=nonsense&PAYMENT_TYPE=SCHOOL-FEE')
+            'http://localhost/app/feerequest?PAYEE_ID=nonsense&PAYMENT_TYPE=1234')
         self.assertEqual(self.browser.contents, ERROR_PART1 + 'Invalid PAYEE_ID' + ERROR_PART2)
         self.browser.open(
@@ -132,14 +119,10 @@
         self.assertEqual(self.browser.contents, ERROR_PART1 + 'Invalid PAYMENT_TYPE' + ERROR_PART2)
         self.browser.open(
-            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=ACCEPTANCE-FEE'
-            % self.p_id)
-        self.assertEqual(self.browser.contents, ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2)
-        self.browser.open(
-            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=APPLICATION-FEE'
+            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=3456'
             % self.p_id)
         self.assertEqual(self.browser.contents, ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2)
         self.student['payments'][self.p_id].p_state = 'paid'
         self.browser.open(
-            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE'
+            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=1234'
             % self.p_id)
         self.assertEqual(self.browser.contents, ERROR_PART1 + 'PAYEE_ID already used' + ERROR_PART2)
