Index: /WAeUP_SRP/base/Payment.py
===================================================================
--- /WAeUP_SRP/base/Payment.py	(revision 2890)
+++ /WAeUP_SRP/base/Payment.py	(revision 2891)
@@ -43,5 +43,5 @@
             d['key'] = payment.getId()
             d['amount'] = doc.amount
-            d['description'] = d['type_description'] = doc.type_description
+            d['type_description'] = doc.type_description
             subject = ''
             if doc.type_description.startswith('School'):
@@ -55,5 +55,5 @@
                     p_status = "paid"
                     break
-                if doc.resp_code in ("00","IP"):
+                if doc.resp_code in ("00","IP","AP"):
                     p_type = "online"
                     p_status = "paid"
@@ -64,5 +64,5 @@
             d['key'] = payment.getId()
             d['type'] = p_type  # scratch card
-            d['target'] = student_record.course
+            d['item'] = student_record.course
             d['status'] = p_status
             d['resp_approved_amount'] = getattr(doc,'resp_approved_amount',None)
@@ -73,8 +73,8 @@
             d['resp_card_num'] = doc.resp_card_num
             d['date'] = getattr(doc,'date',None)
-            d['resp_date'] = getattr(doc,'resp_date',None)
+            #d['resp_date'] = getattr(doc,'resp_date',None)
             # msg = " ".join(["%s: %s" % (key,value) for key,value in d.items()])
             # logger.info(msg)
-            
+
             review_state = wftool.getInfoFor(payment,'review_state',None)
             if review_state == "closed":
Index: /WAeUP_SRP/base/skins/waeup_epayment/interswitch_acco_cb.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_epayment/interswitch_acco_cb.py	(revision 2890)
+++ /WAeUP_SRP/base/skins/waeup_epayment/interswitch_acco_cb.py	(revision 2891)
@@ -53,9 +53,19 @@
 for rc,pdk in resp_codes:
     pd[pdk] = request.get(rc,'')
+    
+    
+## for testing purposes
+pd['resp_desc'] = 'Simulated Callback'
+pd['resp_pay_reference'] = 'XXXX'
+pd['resp_code'] = '00'
+pd['resp_card_num'] = '0000'
+pd['resp_approved_amount'] = '10000'    
 
 if pd['resp_code'] == '00' and len(pd['resp_approved_amount']) > 4:
     pd['resp_approved_amount'] = pd['resp_approved_amount'][:-2]
+    pd['status'] = 'paid'
 else:
     pd['resp_approved_amount'] = '0'
+    pd['status'] = 'failed'    
 
 review_state = wftool.getInfoFor(context,'review_state',None)
@@ -86,4 +96,9 @@
     else:
         logger.info('%s received unsuccessfull callback: %s' % (student_id,pd['resp_desc']))
+
+    try:
+        wftool.doActionFor(context,'close')
+    except:
+        logger.info('%s no workflow action close' % student_id)       
     try:
         wftool.doActionFor(acco_info['acco'],'pay_maintenance_fee',dest_container=acco_info['acco'])
@@ -92,6 +107,7 @@
         logger.info('%s no workflow action pay_maintainance_fee' % student_id)
         return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
-    
-else:        
+ 
+
+else:
     next_info = context.getNextInfo(s_brain)
     next_session_id = next_info['next_session_id']
@@ -101,5 +117,5 @@
     next_verdict = next_info['next_verdict']
     next_previous_verdict = next_info['next_previous_verdict']
-    
+
     if  resp == '00':
         if context.getStudentReviewState() == "school_fee_paid":
@@ -121,5 +137,5 @@
             if next_transition:
                 wftool.doActionFor(student,next_transition)
-    
+
         logger.info('%s received valid callback' % student_id)
         referer = request.get('HTTP_REFERER','none')
@@ -133,4 +149,4 @@
     except:
         logger.info('%s no workflow action close' % student_id)
-    
 
+
Index: /WAeUP_SRP/base/skins/waeup_epayment/pay_by_sc.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_epayment/pay_by_sc.py	(revision 2890)
+++ /WAeUP_SRP/base/skins/waeup_epayment/pay_by_sc.py	(revision 2891)
@@ -106,6 +106,6 @@
     info['status'] = 'paid'
     info['session_id'] = student_record.session
-    info['target'] = student_record.course
-    info['subject'] = 'schoolfee'
+    info['item'] = student_record.course
+    info['category'] = 'schoolfee'
     info['resp_code'] = "SC"
     info['resp_desc'] = "SC Payment Successful"
Index: /WAeUP_SRP/base/skins/waeup_epayment/pay_interswitch_acco.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_epayment/pay_interswitch_acco.py	(revision 2890)
+++ /WAeUP_SRP/base/skins/waeup_epayment/pay_interswitch_acco.py	(revision 2891)
@@ -19,5 +19,5 @@
 from urllib import urlencode
 import logging
-logger = logging.getLogger('Skins.pay_interswitch')
+logger = logging.getLogger('Skins.pay_interswitch_acco')
 import DateTime
 
@@ -75,4 +75,5 @@
 info['student_id'] = student_id
 info['student_name'] = student_record.name
+info['session_id'] = student_record.session
 info['student_email'] = student_record.email
 info['date'] = now
@@ -105,5 +106,5 @@
                                                       payment_id)
 
-logger.info('%(student_id)s initiated %(description)s payment with order_id %(order_id)s and callback url %(callback_url)s' % info)
+logger.info('%(student_id)s initiated %(type_description)s payment with order_id %(order_id)s and callback url %(callback_url)s' % info)
 payment_fields = (('product_id','site_id'),
                   ('site_name','site_name'),
Index: /WAeUP_SRP/base/skins/waeup_epayment/payment_receipt.pt
===================================================================
--- /WAeUP_SRP/base/skins/waeup_epayment/payment_receipt.pt	(revision 2890)
+++ /WAeUP_SRP/base/skins/waeup_epayment/payment_receipt.pt	(revision 2891)
@@ -20,5 +20,5 @@
         </tr>        
         <tr>
-          <td>JAMB Registration Number:</td>
+          <td>Registration Number:</td>
           <td tal:content="student/jamb_reg_no" />
         </tr>           
Index: /WAeUP_SRP/base/skins/waeup_epayment/simulate_callback.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_epayment/simulate_callback.py	(revision 2890)
+++ /WAeUP_SRP/base/skins/waeup_epayment/simulate_callback.py	(revision 2891)
@@ -13,5 +13,5 @@
 current = DateTime.DateTime()
 pr = context.portal_registration
-logger = logging.getLogger('EPayment.Simulate')
+logger = logging.getLogger('Skins.simulate_callback')
 
 args = {}
@@ -24,5 +24,5 @@
 #set_trace()
 #url = "%s" % (context.absolute_url())
-raw_url = REQUEST.get("site_redirect_url") 
+raw_url = REQUEST.get("site_redirect_url")
 url = "%s&%s" % (raw_url,urlencode(args))
 return REQUEST.RESPONSE.redirect(url)
Index: /WAeUP_SRP/base/skins/waeup_layout/layout_student_acco_edit.pt
===================================================================
--- /WAeUP_SRP/base/skins/waeup_layout/layout_student_acco_edit.pt	(revision 2890)
+++ /WAeUP_SRP/base/skins/waeup_layout/layout_student_acco_edit.pt	(revision 2891)
@@ -16,4 +16,10 @@
   apply request/apply_button|nothing;
   widgets python:context.getRenderedWidgets(layout);
+  info python: context.getAccommodationInfo();
+  maintenance_online info/online_payment|nothing;
+  
+  
+  
+  
   ">
   <form action="" id="editForm" method="post" 
@@ -44,7 +50,4 @@
                      tal:attributes="for cell/widget_input_area_id|nothing;">label</label>:
             </div>
-            <button type="button" class="tooltipControl"
-                    tal:condition="widget/help"
-                    tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button>
             </td>
             <td>
@@ -52,18 +55,4 @@
               <div tal:replace="structure cell/widget_rendered"/>
             </span>
-            <div class="tooltipArea" style="visibility: hidden;"
-                 tal:condition="widget/help"
-                 tal:attributes="id tooltip_id;
-                 onclick python:'showElement(false, \'%s\')' % tooltip_id;"
-                 >
-              <tal:block tal:content="widget/help">This is the help for this field
-              </tal:block>
-            </div>
-            <tal:block condition="err">
-              <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)">
-                <br /><em style="color: red"
-                          tal:content="msg">err</em>
-              </tal:block>
-            </tal:block>
             </td>
           </div>
@@ -91,7 +80,4 @@
                      tal:attributes="for cell/widget_input_area_id|nothing;">label</label>:
             </div>
-            <button type="button" class="tooltipControl"
-                    tal:condition="widget/help"
-                    tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button>
           </td>
           <td>
@@ -99,18 +85,4 @@
               <div tal:replace="structure cell/widget_rendered"/>
             </span>
-            <div class="tooltipArea" style="visibility: hidden;"
-                 tal:condition="widget/help"
-                 tal:attributes="id tooltip_id;
-                 onclick python:'showElement(false, \'%s\')' % tooltip_id;"
-                 >
-              <tal:block tal:content="widget/help">This is the help for this field
-              </tal:block>
-            </div>
-            <tal:block condition="err">
-              <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)">
-                <br /><em style="color: red"
-                          tal:content="msg">err</em>
-              </tal:block>
-            </tal:block>
           </td>
         </div>
@@ -122,16 +94,5 @@
          value="Save" 
          id="cpsdocument_edit_button"
-         tal:condition="not:creation" />
-  <input type="submit" class="standalone" name="apply_admission"
-         value="apply for admission"
-         id="cpsdocument_edit_and_view_button"
-         tal:condition="apply" 
-         tal:attributes="value apply"/>
-  <input type="submit" 
-         class="standalone" 
-         name="cpsdocument_create_button"
-         value="apply"
-         tal:attributes="value options/button"
-         tal:condition="creation" />
+         tal:condition="python:not creation and not maintenance_online" />
 
 </form>
Index: /WAeUP_SRP/base/skins/waeup_student/accommodation_edit_form.pt
===================================================================
--- /WAeUP_SRP/base/skins/waeup_student/accommodation_edit_form.pt	(revision 2890)
+++ /WAeUP_SRP/base/skins/waeup_student/accommodation_edit_form.pt	(revision 2891)
@@ -3,5 +3,7 @@
                    data_storage options/ds|nothing;
                    mode options/mode;
-                   edition python:1;"
+                   edition python:1;
+                   info python: context.getAccommodationInfo();
+                   maintenance_online info/online_payment|nothing"
                    >
 <metal:block define-macro="edit_form">
@@ -27,21 +29,24 @@
         <br />
         <div tal:replace="structure rendered_main" />
-          <p>Instructions :</p>
-        <ul tal:condition="python: mode == 'create'">
-            <li>Buy a Hostel Application Scratch Card.</li> 
+        
+        <p tal:condition="not: maintenance_online">Instructions :</p>
+        
+        <ul tal:condition="python: mode == 'create' and not maintenance_online">
+                  <li>Buy a Hostel Application Scratch Card.</li> 
             <li>Enter the PIN above and press 'Book'.</li>
             <li>Print your Hostel Allocation Slip.</li>
-          </ul>
-        <tal:block condition="python: mode == 'edit'" 
-                   tal:define="info python: context.getAccommodationInfo();
-                   maintenance_online info/online_payment|nothing"
-                   >
-          <ul tal:condition="not: maintenance_online" tal:omit-tag="">
-            <li>Buy a Hostel Maintainance Scratch Card 
-              (Code: <span tal:replace="python: info['acco_doc'].acco_maint_code" />) for 
-              <span tal:replace="python: info['acco_doc'].acco_maint_fee" /> Nairas</li> 
-            <li>Enter the PIN above and press 'Save'.</li>
-            <li>Print your Hostel Maintenance Receipt.</li>
-          </ul>
+        </ul>
+ 
+        <tal:block condition="python: mode == 'edit'" >
+ 
+           <ul tal:condition="not: maintenance_online" tal:omit-tag="">
+             <li>Buy a Hostel Maintainance Scratch Card 
+               (Code: <span tal:replace="python: info['acco_doc'].acco_maint_code" />) for 
+               <span tal:replace="python: info['acco_doc'].acco_maint_fee" /> Nairas</li> 
+             <li>Enter the PIN above and press 'Save'.</li>
+             <li>Print your Hostel Maintenance Receipt.</li>
+           </ul>
+          
+        
           <tal:block condition="maintenance_online">
             <table tal:condition="not: info/maintenance_paid">
Index: /WAeUP_SRP/fceokene/profiles/default/layouts/payment.xml
===================================================================
--- /WAeUP_SRP/fceokene/profiles/default/layouts/payment.xml	(revision 2890)
+++ /WAeUP_SRP/fceokene/profiles/default/layouts/payment.xml	(revision 2891)
@@ -128,25 +128,25 @@
   <property name="vocabulary">payment_status</property>
  </widget>
- <widget name="subject" meta_type="Select Widget">
-  <property name="title">Payment Subject</property>
-  <property name="fields">
-   <element value="subject"/>
-  </property>
-  <property name="is_required">False</property>
-  <property name="label">Payment Subject</property>
-  <property name="label_edit">Payment Subject</property>
-  <property name="readonly_layout_modes"/>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
-  <property name="vocabulary">payment_subjects</property>
- </widget>
- <widget name="target" meta_type="String Widget">
-  <property name="title">Payment Target</property>
-  <property name="fields">
-   <element value="target"/>
-  </property>
-  <property name="is_required">False</property>
-  <property name="label">Payment for</property>
-  <property name="label_edit">Payment for</property>
+ <widget name="category" meta_type="Select Widget">
+  <property name="title">Payment Category</property>
+  <property name="fields">
+   <element value="category"/>
+  </property>
+  <property name="is_required">False</property>
+  <property name="label">Payment Category</property>
+  <property name="label_edit">Payment Category</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">payment_categories</property>
+ </widget>
+ <widget name="item" meta_type="String Widget">
+  <property name="title">Payment Item</property>
+  <property name="fields">
+   <element value="item"/>
+  </property>
+  <property name="is_required">False</property>
+  <property name="label">Payment Item</property>
+  <property name="label_edit">Payment Item</property>
   <property name="readonly_layout_modes"/>
   <property name="hidden_layout_modes"/>
Index: /WAeUP_SRP/fceokene/profiles/default/payments_catalog.xml
===================================================================
--- /WAeUP_SRP/fceokene/profiles/default/payments_catalog.xml	(revision 2890)
+++ /WAeUP_SRP/fceokene/profiles/default/payments_catalog.xml	(revision 2891)
@@ -14,8 +14,8 @@
  <column value="status"/>
  <column value="student_id"/>
- <column value="subject"/>
+ <column value="category"/>
  <column value="surcharge"/>
  <column value="type"/>
- <column value="target"/>
+ <column value="item"/>
  <index name="key" meta_type="FieldIndex">
   <indexed_attr value="key"/>
@@ -35,5 +35,5 @@
  <index name="resp_desc" meta_type="KeywordIndex">
   <indexed_attr value="resp_desc"/>
- </index>  
+ </index>
  <index name="session_id" meta_type="FieldIndex">
   <indexed_attr value="session_id"/>
@@ -41,15 +41,15 @@
   <index name="status" meta_type="FieldIndex">
     <indexed_attr value="status"/>
- </index> 
+ </index>
  <index name="student_id" meta_type="FieldIndex">
   <indexed_attr value="student_id"/>
  </index>
- <index name="subject" meta_type="KeywordIndex">
-  <indexed_attr value="subject"/>
+ <index name="category" meta_type="FieldIndex">
+  <indexed_attr value="category"/>
  </index>
- <index name="target" meta_type="FieldIndex">
-  <indexed_attr value="target"/>
+ <index name="item" meta_type="FieldIndex">
+  <indexed_attr value="item"/>
  </index>
- <index name="type" meta_type="KeywordIndex">
+ <index name="type" meta_type="FieldIndex">
   <indexed_attr value="type"/>
  </index>
Index: /WAeUP_SRP/fceokene/profiles/default/schemas/payment.xml
===================================================================
--- /WAeUP_SRP/fceokene/profiles/default/schemas/payment.xml	(revision 2890)
+++ /WAeUP_SRP/fceokene/profiles/default/schemas/payment.xml	(revision 2891)
@@ -8,7 +8,7 @@
   <field name="amount" meta_type="CPS String Field"/>
   <field name="surcharge" meta_type="CPS String Field"/>
-  <field name="subject" meta_type="CPS String Field"/>
+  <field name="item" meta_type="CPS String Field"/>
   <field name="type" meta_type="CPS String Field"/>
-  <field name="target" meta_type="CPS String Field"/>
+  <field name="category" meta_type="CPS String Field"/>
   <field name="status" meta_type="CPS String Field"/>
   <field name="resp_pay_reference" meta_type="CPS String Field"/>
Index: /WAeUP_SRP/fceokene/profiles/default/vocabularies.xml
===================================================================
--- /WAeUP_SRP/fceokene/profiles/default/vocabularies.xml	(revision 2890)
+++ /WAeUP_SRP/fceokene/profiles/default/vocabularies.xml	(revision 2891)
@@ -31,5 +31,5 @@
  <object name="payment_types" meta_type="CPS Vocabulary"/>
  <object name="payment_status" meta_type="CPS Vocabulary"/>
- <object name="payment_subjects" meta_type="CPS Vocabulary"/>
+ <object name="payment_categories" meta_type="CPS Vocabulary"/>
  <object name="exam_types" meta_type="CPS Vocabulary"/>
  <object name="pin_prefixes" meta_type="CPS Vocabulary"/>
@@ -49,4 +49,4 @@
  <object name="screening_types" meta_type="CPS Vocabulary"/>
  <object name="aos" meta_type="CPS Vocabulary"/>
- <object name="application_status" meta_type="CPS Vocabulary"/> 
+ <object name="application_status" meta_type="CPS Vocabulary"/>
  </object>
Index: /WAeUP_SRP/fceokene/profiles/default/vocabularies/payment_categories.xml
===================================================================
--- /WAeUP_SRP/fceokene/profiles/default/vocabularies/payment_categories.xml	(revision 2891)
+++ /WAeUP_SRP/fceokene/profiles/default/vocabularies/payment_categories.xml	(revision 2891)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="vocabulary.xsl"?>
+<object name="payment_categories" meta_type="CPS Vocabulary">
+    <property name="title"></property>
+    <property name="title_msgid"></property>
+    <property name="description"></property>
+    <property name="acl_write_roles">Manager</property>
+
+    <item key="" msgid=""></item>
+    <item key="hostel_maintenance" msgid="">Hostel Maintenance</item>
+    <item key="schoolfee" msgid="">School Fee</item>
+    <item key="transfer" msgid="">Transfer</item>
+</object>
Index: eUP_SRP/fceokene/profiles/default/vocabularies/payment_subjects.xml
===================================================================
--- /WAeUP_SRP/fceokene/profiles/default/vocabularies/payment_subjects.xml	(revision 2890)
+++ 	(revision )
@@ -1,13 +1,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="vocabulary.xsl"?>
-<object name="payment_subjects" meta_type="CPS Vocabulary">
-    <property name="title"></property>
-    <property name="title_msgid"></property>
-    <property name="description"></property>
-    <property name="acl_write_roles">Manager</property>
-
-    <item key="" msgid=""></item>
-    <item key="hostel_maintenance" msgid="">Hostel Maintainance</item>
-    <item key="schoolfee" msgid="">School Fee</item>
-    <item key="transfer" msgid="">Transfer</item>
-</object>
Index: /WAeUP_SRP/fceokene/waeup_custom/getInterswitchParams.py
===================================================================
--- /WAeUP_SRP/fceokene/waeup_custom/getInterswitchParams.py	(revision 2890)
+++ /WAeUP_SRP/fceokene/waeup_custom/getInterswitchParams.py	(revision 2891)
@@ -10,7 +10,7 @@
 # $Id$
 
-test = "simulate"
+test = ""
 d = {}
-d['payment_possible'] = True 
+d['payment_possible'] = True
 d['pay_ship_to'] = "Federal College Okene"
 
@@ -18,22 +18,22 @@
 d['site_name'] = "fceokene.waeup.org"
 d['currency_id'] = '566'
-d['type'] = 'online' 
-d['status'] = 'started' 
+d['type'] = 'online'
+d['status'] = 'started'
 d['surcharge'] = '150'
 d['payment_params'] = 'switch_college_split'
 if test == 'simulate':
-    d['action'] = "%s/payments/%s/simulate_callback" % (student.absolute_url(),payment_id)
+    d['action'] = "%s/payments/%s/simulate_callback" % (student.absolute_url(),payment_id) #do not use simulate_callback
 elif test == 'test':
-    d['action'] = "https://webpay.interswitchng.com/testpaydirect/webpay/pay.aspx"
+    d['action'] = "https://webpay.interswitchng.com/test_paydirect/webpay/pay.aspx"
 else:
     d['action'] = "https://webpay.interswitchng.com/paydirect/webpay/pay.aspx"
 if paytype in ("HOM",):
     d['callback_function'] = 'interswitch_acco_cb'
-    d['pay_item_id'] = '8302' 
-    d['description'] = d['type_description'] = 'Hostel Maintenance Fee'
-    d['pay_item_name'] = "FCE Okene %(description)s" % d
-    d['amount'] = '4000' 
-    d['subject'] = 'hostel_maintenance' 
-    d['target'] = paytype 
+    d['pay_item_id'] = '8302'
+    d['type_description'] = 'Hostel Maintenance Fee'
+    d['pay_item_name'] = "FCE Okene %(type_description)s" % d
+    d['amount'] = '4000'
+    d['category'] = 'hostel_maintenance'
+    d['item'] = paytype
 
 return d
Index: /WAeUP_SRP/fceokene/waeup_custom/getPaymentsFolderInfo.py
===================================================================
--- /WAeUP_SRP/fceokene/waeup_custom/getPaymentsFolderInfo.py	(revision 2890)
+++ /WAeUP_SRP/fceokene/waeup_custom/getPaymentsFolderInfo.py	(revision 2891)
@@ -43,5 +43,5 @@
 #student = getattr(students,student_id)
 student_record = context.students_catalog.getRecordByKey(student_id)
-context['updatePayments']()
+#context['updatePayments']()
 payments = []
 
@@ -98,6 +98,5 @@
                                   hasattr(so_doc, 'order_id') and not so_doc.resp_code) or str(member) in ('admin','gbenga','isouaba'):
             row['is_requeryable'] = True
-            row['callback_url'] = "%s/payments/%s/interswitch_cb" % (student.absolute_url(),
-                                                            so.getId)
+            row['callback_url'] = "%s/interswitch_cb" % (payments_path)
             href = '%(query_url)s' % info
             href += '?transRef=%(trans_ref)s' % row
Index: /WAeUP_SRP/fceokene/waeup_custom/pay_interswitch.py
===================================================================
--- /WAeUP_SRP/fceokene/waeup_custom/pay_interswitch.py	(revision 2890)
+++ /WAeUP_SRP/fceokene/waeup_custom/pay_interswitch.py	(revision 2891)
@@ -62,6 +62,6 @@
 info['status'] = 'started'
 info['session_id'] = student_record.session
-info['target'] = student_record.course
-info['subject'] = 'schoolfee'
+info['item'] = student_record.course
+info['category'] = 'schoolfee'
 info['student_email'] = student_record.email
 now = DateTime.DateTime()
