Ignore:
Timestamp:
7 Jan 2007, 16:48:21 (18 years ago)
Author:
joachim
Message:

modifications

File:
1 edited

Legend:

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

    r1224 r1226  
    1515logger = logging.getLogger('EPayment.')
    1616import DateTime
    17 import time
    18 
    1917request = context.REQUEST
    2018students = context.portal_url.getPortalObject().campus.students
     
    2927                                     id = sbrain.course)
    3028if 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"
     31else:   
     32    sfc = res[0].getPath().split('/')[-4]
    3333info = {}
    34 info['type_code'] = "ART" #sfc
     34info['amount'] = "75000"
     35info['type_code'] = sfc
    3536info['type_description'] = "Schoolfee %s for 2006/2007 Session" % sfc
    3637info['pay_bill_to'] = sbrain.name
     
    3940info['student_name'] = sbrain.name
    4041info['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)
     42now = DateTime.DateTime()
     43info['pay_date'] = now.strftime("%d%m%y%H%M%S")
     44order_id = info['order_id'] = "%d" % int(now.timeTime()*1000)
    4345info['order_id'] = "%s%s" % (student_id[1:],order_id)
    44 info['amount'] = "75000"
    4546if "payments" not in student.objectIds():
    46     student.invokeFactory('PaymentsFolder','payment')
     47    student.invokeFactory('PaymentsFolder','payments')
    4748    payments = getattr(student,'payments')
    4849    d = {}
    4950    d['Title'] = 'Online Payments'
    50     payment.getContent().edit(mapping=d)
     51    payments.getContent().edit(mapping=d)
    5152else:
    5253    payments = getattr(student,'payments')
    5354p_id = "p%s" % order_id
    5455payments.invokeFactory('Payment', p_id)
     56#from Products.zdb import set_trace;set_trace()
    5557payment = getattr(payments,p_id)
    5658d = {}
    5759d.update(info)
    58 d['Title'] = "%(payment_type_description)s %(pay_date) %(amount)s N" % info
     60d['Title'] = "%(type_description)s %(pay_date) %(amount)s N" % info
    5961payment.getContent().edit(mapping=d)
    6062info['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)
     63logger.info('"%(student_id)s","%(type_description)s", "%(amount)s N"' % info)
    6264return context.wema_form(info=info)
Note: See TracChangeset for help on using the changeset viewer.