Index: main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/browser.py
===================================================================
--- main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/browser.py	(revision 8640)
+++ main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/browser.py	(revision 8641)
@@ -34,9 +34,12 @@
 from waeup.fceokene.interfaces import MessageFactory as _
 
-PRODUCT_ID = '57'
+PRODUCT_ID = '00'
 SITE_NAME = 'fceokene-kofa.waeup.org'
-PROVIDER_ACCT = '1010764827'
-PROVIDER_BANK_ID = '117'
+PROVIDER_ACCT = '0026781725'
+PROVIDER_BANK_ID = '31'
 PROVIDER_ITEM_NAME = 'BT Education'
+ICT_ACCT = '6216801058'
+ICT_BANK_ID = '117'
+ICT_ITEM_NAME = 'FCEOkene ICT'
 INSTITUTION_NAME = 'FCEOkene'
 CURRENCY = '566'
@@ -150,22 +153,4 @@
         return self.view.url(self.view.context, self.target)
 
-# Deprecated
-#class InterswitchRequestCallbackActionButtonStudent(RCABStudent):
-#    grok.order(3)
-#    grok.context(ICustomStudentOnlinePayment)
-#    icon = 'actionicon_call.png'
-#    text = _('Request CollegePAY callback')
-
-#    def target_url(self):
-#        if self.context.p_state == 'paid':
-#            return ''
-#        site_redirect_url = self.view.url(self.view.context, 'isw_callback')
-#        args = {
-#            'transRef':self.context.p_id,
-#            'prodID':PRODUCT_ID,
-#            'redirectURL':site_redirect_url}
-#        return QUERY_URL + '?%s' % urllib.urlencode(args)
-
-# Alternative preferred solution
 class InterswitchRequestWebserviceActionButtonStudent(APABStudent):
     grok.order(2)
@@ -183,5 +168,4 @@
     text = _('Requery CollegePAY')
     target = 'request_webservice'
-
 
 class InterswitchPageStudent(KofaPage):
@@ -229,45 +213,10 @@
         xmldict['provider_bank_id'] = PROVIDER_BANK_ID
         xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
-        if student.current_mode.endswith('_ft') \
-            and student.state == RETURNING:
-            provider_amt = 600
-        else:
-            provider_amt = 1500
-        xmldict['provider_amt'] = 100 * provider_amt
+        xmldict['provider_amt'] = 100 * 1500
         # Institution data
         studycourse = student['studycourse']
-        xmldict['institution_acct'] = ''
-        xmldict['institution_bank_id'] = ''
-        if student.current_mode.endswith('_ft'):
-            #post-grad full-time students of all faculties
-            if studycourse.current_level in ('700','710','800','810','900','910'):
-                xmldict['institution_acct'] = '1012842833'
-                xmldict['institution_bank_id'] = '117'
-            #all other part-time students depending on faculty
-            elif student.faccode in ('SSC','LAW','MED'):
-                xmldict['institution_acct'] = '0005986938'
-                xmldict['institution_bank_id'] = '31'
-            elif student.faccode in ('ENG','PSC','PHA'):
-                xmldict['institution_acct'] = '0014413973'
-                xmldict['institution_bank_id'] = '129'
-            elif student.faccode in ('LSC','DEN','AGR'):
-                xmldict['institution_acct'] = '1012801319'
-                xmldict['institution_bank_id'] = '117'
-            elif student.faccode in ('ART','EDU','MGS','BMS'):
-                xmldict['institution_acct'] = '6220027556'
-                xmldict['institution_bank_id'] = '51'
-        elif student.current_mode.endswith('_pt'):
-            #post-grad part-time students of all faculties
-            if studycourse.current_level in ('700','710','800','810','900','910'):
-                xmldict['institution_acct'] = '0023708207'
-                xmldict['institution_bank_id'] = '72'
-            #all other part-time students depending on faculty
-            elif student.faccode in ('ENG','LAW','MGS'):
-                xmldict['institution_acct'] = '2019006824'
-                xmldict['institution_bank_id'] = '8'
-            elif student.faccode in ('IPA','PHA','SSC','AGR','EDU'):
-                xmldict['institution_acct'] = '0122012109'
-                xmldict['institution_bank_id'] = '16'
-        xmldict['institution_amt'] = 100 * (self.amount_auth - provider_amt - 150)
+        xmldict['institution_acct'] = '000000000000'
+        xmldict['institution_bank_id'] = '00'
+        xmldict['institution_amt'] = 100 * (self.amount_auth - 1500 - 150)
         xmldict['institution_item_name'] = self.context.p_category
         xmldict['institution_name'] = INSTITUTION_NAME
@@ -295,5 +244,5 @@
     site_name = SITE_NAME
     currency = CURRENCY
-    pay_item_id = '5703'
+    pay_item_id = '0000'
     product_id = PRODUCT_ID
 
@@ -312,14 +261,20 @@
             self.context.creation_date, tz).strftime("%Y-%m-%d %H:%M:%S %Z")
         self.site_redirect_url = self.url(self.context, 'request_webservice')
+        xmldict['detail_ref'] = self.context.p_id
         # Provider data
-        xmldict['detail_ref'] = self.context.p_id
-        xmldict['provider_amt'] = 100 * 400
+        xmldict['provider_amt'] = 100 * 365
         xmldict['provider_acct'] = PROVIDER_ACCT
         xmldict['provider_bank_id'] = PROVIDER_BANK_ID
         xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
+        # ICT data
+        xmldict['ict_amt'] = 100 * 135
+        xmldict['ict_acct'] = ICT_ACCT
+        xmldict['ict_bank_id'] = ICT_BANK_ID
+        xmldict['ict_item_name'] = ICT_ITEM_NAME
         # Institution data
-        xmldict['institution_amt'] = 100 * (self.context.amount_auth - 400 - 150)
-        xmldict['institution_acct'] = '0031716030'
-        xmldict['institution_bank_id'] = '10'
+        xmldict['institution_amt'] = 100 * (
+            self.context.amount_auth - 365 - 150 - 135)
+        xmldict['institution_acct'] = '1012415659'
+        xmldict['institution_bank_id'] = '117'
         xmldict['institution_item_name'] = self.context.p_category
         xmldict['institution_name'] = INSTITUTION_NAME
@@ -329,4 +284,5 @@
 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
 <item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
+<item_detail item_id="3" item_name="%(ict_item_name)s" item_amt="%(ict_amt)d" bank_id="%(ict_bank_id)s" acct_num="%(ict_acct)s" />
 </item_details>
 </payment_item_detail>""" % xmldict
@@ -334,64 +290,5 @@
         return
 
-# Deprecated
-#class InterswitchPaymentCallbackPageStudent(UtilityView, grok.View):
-#    """ Callback view for the CollegePAY gateway
-#    """
-#    grok.context(ICustomStudentOnlinePayment)
-#    grok.name('isw_callback')
-#    grok.require('waeup.payStudent')
-
-    # This view is not yet working for offline querying transactions
-    # since the query string differs from the query string sent after
-    # posting transactions. This Interswitch bug must be removed first.
-    # Alternatively, we could use the webservice only and replace
-    # the RequestCallbackActionButton by a RequestWebserviceActionButton
-
-#    def update(self):
-#        if self.context.p_state == 'paid':
-#            self.flash(_('This ticket has already been paid.'))
-#            return
-#        student = self.context.getStudent()
-#        query = self.request.form
-#        write_log_message(self,'callback received: %s' % query)
-#        self.context.r_card_num = query.get('cardNum', None)
-#        self.context.r_code = query.get('resp', None)
-#        self.context.r_pay_reference  = query.get('payRef', None)
-#        self.context.r_amount_approved = float(query.get('apprAmt', '0.0')) / 100
-#        self.context.r_desc = query.get('desc', None)
-#        if self.context.r_code != '00':
-#            self.flash(_('Unsuccessful callback: ${a}',
-#                mapping = {'a': query.get('desc', _('Incomplete query string.'))}))
-#            write_log_message(self,'unsuccessful callback: %s' % self.context.p_id)
-#            self.context.p_state = 'failed'
-#            return
-#        if self.context.r_amount_approved != payment.amount_auth:
-#            self.flash(_('Wrong amount'))
-#            write_log_message(
-#                self,'successful but wrong amount: %s' % self.context.p_id)
-#            self.context.p_state = 'failed'
-#            return
-#        try:
-#            validation_list = get_SOAP_response(
-#                PRODUCT_ID, self.context.p_id).split(':')
-            # Validation does not make sense yet since the query string
-            # formats are conflicting. We are only printing the validation
-            # string, nothing else.
-#            print 'WARNING: Webservice validation is not yet implemented'
-#            print 'validation list: %s' % validation_list
-#        except:
-#            print 'Connection to webservice failed.'
-        # Add webservice validation here
-#        write_log_message(self,'valid callback: %s' % self.context.p_id)
-#        self.context.p_state = 'paid'
-#        self.context.payment_date = datetime.utcnow()
-#        actions_after_student_payment(student, self.context, self)
-#        return
-
-#    def render(self):
-#        self.redirect(self.url(self.context, '@@index'))
-#        return
-
-# Alternative solution, replaces InterswitchPaymentCallbackPage
+
 class InterswitchPaymentRequestWebservicePageStudent(UtilityView, grok.View):
     """ Request webservice view for the CollegePAY gateway
