Index: WAeUP_SRP/trunk/skins/waeup_epayment/pay_online.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/pay_online.py	(revision 1224)
+++ WAeUP_SRP/trunk/skins/waeup_epayment/pay_online.py	(revision 1226)
@@ -15,6 +15,4 @@
 logger = logging.getLogger('EPayment.')
 import DateTime
-import time
-
 request = context.REQUEST
 students = context.portal_url.getPortalObject().campus.students
@@ -29,8 +27,11 @@
                                      id = sbrain.course)
 if not res:
-    return None
-sfc = res[0].getObject().getContent().school_fee_code
+    logger.info('"%s","certificate not found", "%s"' % (student_id,course))
+    sfc = "ART"
+else:    
+    sfc = res[0].getPath().split('/')[-4]
 info = {}
-info['type_code'] = "ART" #sfc
+info['amount'] = "75000"
+info['type_code'] = sfc
 info['type_description'] = "Schoolfee %s for 2006/2007 Session" % sfc
 info['pay_bill_to'] = sbrain.name
@@ -39,24 +40,25 @@
 info['student_name'] = sbrain.name
 info['student_email'] = sbrain.email
-info['pay_date'] = DateTime.DateTime().strftime("%d%m%y%H%M%S")
-order_id = info['order_id'] = "%d" % int(time.time()*1000)
+now = DateTime.DateTime()
+info['pay_date'] = now.strftime("%d%m%y%H%M%S")
+order_id = info['order_id'] = "%d" % int(now.timeTime()*1000)
 info['order_id'] = "%s%s" % (student_id[1:],order_id)
-info['amount'] = "75000"
 if "payments" not in student.objectIds():
-    student.invokeFactory('PaymentsFolder','payment')
+    student.invokeFactory('PaymentsFolder','payments')
     payments = getattr(student,'payments')
     d = {}
     d['Title'] = 'Online Payments'
-    payment.getContent().edit(mapping=d)
+    payments.getContent().edit(mapping=d)
 else:
     payments = getattr(student,'payments')
 p_id = "p%s" % order_id
 payments.invokeFactory('Payment', p_id)
+#from Products.zdb import set_trace;set_trace()
 payment = getattr(payments,p_id)
 d = {}
 d.update(info)
-d['Title'] = "%(payment_type_description)s %(pay_date) %(amount)s N" % info
+d['Title'] = "%(type_description)s %(pay_date) %(amount)s N" % info
 payment.getContent().edit(mapping=d)
 info['callback_url'] = "%s/payments/%s/epayment_cb" % (student.absolute_url(),p_id)
-logger.info('"%(student_id)s","%(payment_type_description)s", "%(amount)s N"' % info)
+logger.info('"%(student_id)s","%(type_description)s", "%(amount)s N"' % info)
 return context.wema_form(info=info)
Index: WAeUP_SRP/trunk/skins/waeup_epayment/wema_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/wema_form.pt	(revision 1224)
+++ WAeUP_SRP/trunk/skins/waeup_epayment/wema_form.pt	(revision 1226)
@@ -3,5 +3,5 @@
     <metal:main fill-slot="main">
       <form method="post" action="http://www.wemaonlinepayments.biz/payment.aspx">
-        <input name="x_SiteID" type="hidden" id="x_SiteID" />
+        <input name="x_SiteID" type="hidden" id="x_SiteID" value="8000"/>
         <input name="x_Redirect_url" type="hidden" id="x_Redirect_url" 
                value="http://uniben.waeup.org/callback"
@@ -12,18 +12,18 @@
           <tr>
             <input name="x_PaymentCode" type="hidden" 
-                   tal:attributes="value info/payment_type_code" />
-            <input name="x_PaymentDesc" type="hidden" 
-                   tal:attributes="value info/payment_type_description" />
+                   tal:attributes="value info/type_code" />
+            <input name="x_PayDesc" type="hidden" 
+                   tal:attributes="value info/type_description" />
             <td >Description</td>
-            <td tal:content="info/payment_type_description"></td>
+            <td tal:content="info/type_description"></td>
           </tr>
           <tr>
             <input name="x_Billto" type="hidden" 
-                   tal:attributes="value info/payment_bill_to" />
+                   tal:attributes="value info/pay_bill_to" />
             <input name="x_Shipto" type="hidden" 
-                   tal:attributes="value info/payment_ship_to" />
-            <input name="x_PayersID" type="hidden" 
+                   tal:attributes="value info/pay_ship_to" />
+            <input name="x_PayerID" type="hidden" 
                    tal:attributes="value info/student_id" />
-            <input name="x_PayerName" type="hidden" 
+            <input name="x_PayerNames" type="hidden" 
                    tal:attributes="value info/student_name" />
             <input name="x_PayerEmail" type="hidden" 
@@ -31,5 +31,5 @@
             <input name="x_OrderID" type="hidden" 
                    tal:attributes="value info/order_id" />
-            <td tal:content="info/payment_bill_to"></td>
+            <td tal:content="info/pay_bill_to"></td>
           </tr>
           <tr>
