Changeset 1226 for WAeUP_SRP/trunk


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

modifications

Location:
WAeUP_SRP/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/__init__.py

    r1080 r1226  
    4444        ("AccoFolder",
    4545         "AccoHall",
     46         )
     47     ),
     48     ("Payment",
     49        ("PaymentsFolder",
     50         "Payment",
    4651         )
    4752     ),
  • 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)
  • WAeUP_SRP/trunk/skins/waeup_epayment/wema_form.pt

    r1158 r1226  
    33    <metal:main fill-slot="main">
    44      <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"/>
    66        <input name="x_Redirect_url" type="hidden" id="x_Redirect_url"
    77               value="http://uniben.waeup.org/callback"
     
    1212          <tr>
    1313            <input name="x_PaymentCode" type="hidden"
    14                    tal:attributes="value info/payment_type_code" />
    15             <input name="x_PaymentDesc" 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" />
    1717            <td >Description</td>
    18             <td tal:content="info/payment_type_description"></td>
     18            <td tal:content="info/type_description"></td>
    1919          </tr>
    2020          <tr>
    2121            <input name="x_Billto" type="hidden"
    22                    tal:attributes="value info/payment_bill_to" />
     22                   tal:attributes="value info/pay_bill_to" />
    2323            <input name="x_Shipto" type="hidden"
    24                    tal:attributes="value info/payment_ship_to" />
    25             <input name="x_PayersID" type="hidden"
     24                   tal:attributes="value info/pay_ship_to" />
     25            <input name="x_PayerID" type="hidden"
    2626                   tal:attributes="value info/student_id" />
    27             <input name="x_PayerName" type="hidden"
     27            <input name="x_PayerNames" type="hidden"
    2828                   tal:attributes="value info/student_name" />
    2929            <input name="x_PayerEmail" type="hidden"
     
    3131            <input name="x_OrderID" type="hidden"
    3232                   tal:attributes="value info/order_id" />
    33             <td tal:content="info/payment_bill_to"></td>
     33            <td tal:content="info/pay_bill_to"></td>
    3434          </tr>
    3535          <tr>
Note: See TracChangeset for help on using the changeset viewer.