Ignore:
Timestamp:
8 Jan 2007, 17:39:17 (18 years ago)
Author:
joachim
Message:

more fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_epayment/pay_online.py

    r1235 r1243  
    2424student = getattr(students,student_id)
    2525sbrain = context.students_catalog(id=student_id)[0]
    26 res = context.portal_catalog(portal_type="Certificate",
    27                                      id = sbrain.course)
    28 if not res:
    29     logger.info('"%s","certificate not found", "%s"' % (student_id,course))
    30     sfc = "ART"
    31 else:   
    32     sfc = res[0].getPath().split('/')[-4]
     26amount,description = context.getSchoolFee(sbrain.faculty)
     27##res = context.portal_catalog(portal_type="Certificate",
     28##                                     id = sbrain.course)
     29##
     30##if not res:
     31##    logger.info('"%s","certificate not found", "%s"' % (student_id,course))
     32##    sfc = "ART"
     33##else:   
     34##    sfc = res[0].getPath().split('/')[-4]
    3335info = {}
    34 info['amount'] = "75000"
    35 info['type_code'] = sfc
    36 info['type_description'] = "Schoolfee %s for 2006/2007 Session" % sfc
     36info['amount'] = amount
     37info['type_code'] = sbrain.faculty
     38info['type_description'] = description
    3739info['pay_bill_to'] = sbrain.name
    3840info['pay_ship_to'] = "University of Benin"
     
    4143info['student_email'] = sbrain.email
    4244now = DateTime.DateTime()
    43 info['pay_date'] = now.strftime("%d%m%y%H%M%S")
     45info['date'] = now
    4446order_id = info['order_id'] = "%d" % int(now.timeTime()*1000)
    4547info['order_id'] = "%s%s" % (student_id[1:],order_id)
     
    4850    payments = getattr(student,'payments')
    4951    d = {}
    50     d['Title'] = 'Online Payments'
     52    d['Title'] = 'Payments'
    5153    payments.getContent().edit(mapping=d)
     54    wftool.doActionFor(payments,'open')
    5255else:
    5356    payments = getattr(student,'payments')
    5457p_id = "p%s" % order_id
    5558payments.invokeFactory('Payment', p_id)
    56 #from Products.zdb import set_trace;set_trace()
    5759payment = getattr(payments,p_id)
    5860d = {}
    5961d.update(info)
    60 d['Title'] = "%(type_description)s %(pay_date) %(amount)s N" % info
     62#from Products.zdb import set_trace;set_trace()
    6163payment.getContent().edit(mapping=d)
    6264info['callback_url'] = "%s/payments/%s/epayment_cb" % (student.absolute_url(),p_id)
    63 if context.portal_url().find('uniben-demo.waeup.org') >-1:
     65if context.portal_url().find('uniben-demo.waeup.org') >-1 or\
     66   context.portal_url().find('uniben.waeup.org') >-1:
    6467    info['action'] = "http://www.wemaonlinepayments.biz/payment.aspx"
    6568else:
Note: See TracChangeset for help on using the changeset viewer.