Changeset 1224


Ignore:
Timestamp:
7 Jan 2007, 15:20:56 (18 years ago)
Author:
joachim
Message:

added and changed EPayment Modules

Location:
WAeUP_SRP/trunk
Files:
6 added
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/profiles/default/types.xml

    r745 r1224  
    1212 <object name="Department" meta_type="CPS Flexible Type Information"/>
    1313 <object name="Faculty" meta_type="CPS Flexible Type Information"/>
     14 <object name="PaymentsFolder" meta_type="CPS Flexible Type Information"/>
     15 <object name="Payment" meta_type="CPS Flexible Type Information"/>
    1416 <object name="ScratchCardBatch" meta_type="CPS Flexible Type Information"/>
    1517 <object name="ScratchCardBatchesFolder" meta_type="CPS Flexible Type Information"/>
  • WAeUP_SRP/trunk/skins/waeup_epayment/pay_online.py

    r1158 r1224  
    1515logger = logging.getLogger('EPayment.')
    1616import DateTime
     17import time
    1718
    1819request = context.REQUEST
     
    3132sfc = res[0].getObject().getContent().school_fee_code
    3233info = {}
    33 info['callback_url'] = "%s/epayment_cb" % student.absolute_url()
    34 info['payment_type_code'] = sfc
    35 info['payment_type_description'] = "Schoolfee %s for 2006/2007 Session" % sfc
    36 info['payment_bill_to'] = sbrain.name
    37 info['payment_ship_to'] = "University of Benin"
     34info['type_code'] = "ART" #sfc
     35info['type_description'] = "Schoolfee %s for 2006/2007 Session" % sfc
     36info['pay_bill_to'] = sbrain.name
     37info['pay_ship_to'] = "University of Benin"
    3838info['student_id'] = student_id
    3939info['student_name'] = sbrain.name
    4040info['student_email'] = sbrain.email
    41 info['order_id'] = "%s%s" % (student_id[1:],DateTime.DateTime().strftime("%d%m%y%H%M%S"))
     41info['pay_date'] = DateTime.DateTime().strftime("%d%m%y%H%M%S")
     42order_id = info['order_id'] = "%d" % int(time.time()*1000)
     43info['order_id'] = "%s%s" % (student_id[1:],order_id)
    4244info['amount'] = "75000"
     45if "payments" not in student.objectIds():
     46    student.invokeFactory('PaymentsFolder','payment')
     47    payments = getattr(student,'payments')
     48    d = {}
     49    d['Title'] = 'Online Payments'
     50    payment.getContent().edit(mapping=d)
     51else:
     52    payments = getattr(student,'payments')
     53p_id = "p%s" % order_id
     54payments.invokeFactory('Payment', p_id)
     55payment = getattr(payments,p_id)
     56d = {}
     57d.update(info)
     58d['Title'] = "%(payment_type_description)s %(pay_date) %(amount)s N" % info
     59payment.getContent().edit(mapping=d)
     60info['callback_url'] = "%s/payments/%s/epayment_cb" % (student.absolute_url(),p_id)
     61logger.info('"%(student_id)s","%(payment_type_description)s", "%(amount)s N"' % info)
    4362return context.wema_form(info=info)
Note: See TracChangeset for help on using the changeset viewer.