Changeset 1226 for WAeUP_SRP/trunk
- Timestamp:
- 7 Jan 2007, 16:48:21 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/__init__.py
r1080 r1226 44 44 ("AccoFolder", 45 45 "AccoHall", 46 ) 47 ), 48 ("Payment", 49 ("PaymentsFolder", 50 "Payment", 46 51 ) 47 52 ), -
WAeUP_SRP/trunk/skins/waeup_epayment/pay_online.py
r1224 r1226 15 15 logger = logging.getLogger('EPayment.') 16 16 import DateTime 17 import time18 19 17 request = context.REQUEST 20 18 students = context.portal_url.getPortalObject().campus.students … … 29 27 id = sbrain.course) 30 28 if not res: 31 return None 32 sfc = res[0].getObject().getContent().school_fee_code 29 logger.info('"%s","certificate not found", "%s"' % (student_id,course)) 30 sfc = "ART" 31 else: 32 sfc = res[0].getPath().split('/')[-4] 33 33 info = {} 34 info['type_code'] = "ART" #sfc 34 info['amount'] = "75000" 35 info['type_code'] = sfc 35 36 info['type_description'] = "Schoolfee %s for 2006/2007 Session" % sfc 36 37 info['pay_bill_to'] = sbrain.name … … 39 40 info['student_name'] = sbrain.name 40 41 info['student_email'] = sbrain.email 41 info['pay_date'] = DateTime.DateTime().strftime("%d%m%y%H%M%S") 42 order_id = info['order_id'] = "%d" % int(time.time()*1000) 42 now = DateTime.DateTime() 43 info['pay_date'] = now.strftime("%d%m%y%H%M%S") 44 order_id = info['order_id'] = "%d" % int(now.timeTime()*1000) 43 45 info['order_id'] = "%s%s" % (student_id[1:],order_id) 44 info['amount'] = "75000"45 46 if "payments" not in student.objectIds(): 46 student.invokeFactory('PaymentsFolder','payment ')47 student.invokeFactory('PaymentsFolder','payments') 47 48 payments = getattr(student,'payments') 48 49 d = {} 49 50 d['Title'] = 'Online Payments' 50 payment .getContent().edit(mapping=d)51 payments.getContent().edit(mapping=d) 51 52 else: 52 53 payments = getattr(student,'payments') 53 54 p_id = "p%s" % order_id 54 55 payments.invokeFactory('Payment', p_id) 56 #from Products.zdb import set_trace;set_trace() 55 57 payment = getattr(payments,p_id) 56 58 d = {} 57 59 d.update(info) 58 d['Title'] = "%( payment_type_description)s %(pay_date) %(amount)s N" % info60 d['Title'] = "%(type_description)s %(pay_date) %(amount)s N" % info 59 61 payment.getContent().edit(mapping=d) 60 62 info['callback_url'] = "%s/payments/%s/epayment_cb" % (student.absolute_url(),p_id) 61 logger.info('"%(student_id)s","%( payment_type_description)s", "%(amount)s N"' % info)63 logger.info('"%(student_id)s","%(type_description)s", "%(amount)s N"' % info) 62 64 return context.wema_form(info=info) -
WAeUP_SRP/trunk/skins/waeup_epayment/wema_form.pt
r1158 r1226 3 3 <metal:main fill-slot="main"> 4 4 <form method="post" action="http://www.wemaonlinepayments.biz/payment.aspx"> 5 <input name="x_SiteID" type="hidden" id="x_SiteID" />5 <input name="x_SiteID" type="hidden" id="x_SiteID" value="8000"/> 6 6 <input name="x_Redirect_url" type="hidden" id="x_Redirect_url" 7 7 value="http://uniben.waeup.org/callback" … … 12 12 <tr> 13 13 <input name="x_PaymentCode" type="hidden" 14 tal:attributes="value info/ payment_type_code" />15 <input name="x_Pay mentDesc" type="hidden"16 tal:attributes="value info/ payment_type_description" />14 tal:attributes="value info/type_code" /> 15 <input name="x_PayDesc" type="hidden" 16 tal:attributes="value info/type_description" /> 17 17 <td >Description</td> 18 <td tal:content="info/ payment_type_description"></td>18 <td tal:content="info/type_description"></td> 19 19 </tr> 20 20 <tr> 21 21 <input name="x_Billto" type="hidden" 22 tal:attributes="value info/pay ment_bill_to" />22 tal:attributes="value info/pay_bill_to" /> 23 23 <input name="x_Shipto" type="hidden" 24 tal:attributes="value info/pay ment_ship_to" />25 <input name="x_Payer sID" type="hidden"24 tal:attributes="value info/pay_ship_to" /> 25 <input name="x_PayerID" type="hidden" 26 26 tal:attributes="value info/student_id" /> 27 <input name="x_PayerName " type="hidden"27 <input name="x_PayerNames" type="hidden" 28 28 tal:attributes="value info/student_name" /> 29 29 <input name="x_PayerEmail" type="hidden" … … 31 31 <input name="x_OrderID" type="hidden" 32 32 tal:attributes="value info/order_id" /> 33 <td tal:content="info/pay ment_bill_to"></td>33 <td tal:content="info/pay_bill_to"></td> 34 34 </tr> 35 35 <tr>
Note: See TracChangeset for help on using the changeset viewer.