Changeset 1257 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
10 Jan 2007, 09:02:02 (18 years ago)
Author:
joachim
Message:

create payment object before submitting to the bank

Location:
WAeUP_SRP/trunk/skins/waeup_epayment
Files:
3 edited

Legend:

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

    r1243 r1257  
    1313"""
    1414import logging
     15from urllib import urlencode
    1516logger = logging.getLogger('EPayment.')
    1617import DateTime
     
    3435##    sfc = res[0].getPath().split('/')[-4]
    3536info = {}
     37info['site_id'] = '8000'
     38info['currency_id'] = '566'
    3639info['amount'] = amount
    3740info['type_code'] = sbrain.faculty
     
    5558else:
    5659    payments = getattr(student,'payments')
     60if request.has_key('epayment'):
     61    return context.wema_form(info=info)
     62
    5763p_id = "p%s" % order_id
    5864payments.invokeFactory('Payment', p_id)
     
    6975    info['action'] = "%s/payments/%s/simulate_callback" % (student.absolute_url(),p_id)
    7076logger.info('"%(student_id)s","%(type_description)s", "%(amount)s N"' % info)
    71 return context.wema_form(info=info)
     77payment_fields = (('x_SiteID','site_id'),
     78                  ('x_Redirect_url','callback_url'),
     79                  ('x_CurrencyID','currency_id'),
     80                  ('x_PaymentCode','type_code'),
     81                  ('x_PayDesc','type_description'),
     82                  ('x_Billto','pay_bill_to'),
     83                  ('x_Shipto','pay_ship_to'),
     84                  ('x_PayerID','student_id'),
     85                  ('x_PayerNames','student_name'),
     86                  ('x_PayerEmail','student_email'),
     87                  ('x_OrderID','order_id'),
     88                  ('x_amt','amount'),
     89                  )
     90args = {}
     91for arg,field in payment_fields:
     92    args[arg] = info[field]
     93url = info['action'] + "?" + urlencode(args)
     94request.RESPONSE.redirect(url)
     95
  • WAeUP_SRP/trunk/skins/waeup_epayment/payments_view.pt

    r1247 r1257  
    3737       
    3838        <form tal:attributes="action string: ${context/absolute_url}/pay_online" method="post" class="group">
    39          <input type="submit" class="context" value="Initiate School Fee Online Payment" />
     39         <input type="submit" name="epayment"
     40                class="context"
     41                value="Initiate School Fee Online Payment"
     42                />
    4043        </form> 
    4144
  • WAeUP_SRP/trunk/skins/waeup_epayment/wema_form.pt

    r1247 r1257  
    66        <br />
    77               
    8       <form method="post" action="http://www.wemaonlinepayments.biz/payment.aspx"
    9             tal:attributes="action info/action">
    10         <input name="x_SiteID" type="hidden" id="x_SiteID" value="8000"/>
    11         <input name="x_Redirect_url" type="hidden" id="x_Redirect_url"
    12                value="http://uniben.waeup.org/callback"
    13                tal:attributes="value info/callback_url"
    14                />
    15         <input name="x_CurrencyID" type="hidden" value="566" />
     8      <form method="post" action="pay_online">
    169        <table>
    1710          <tr>
    1811            <td width="100px">
    19             <input name="x_PaymentCode" type="hidden"
    20                    tal:attributes="value info/type_code" />
    21             <input name="x_PayDesc" type="hidden"
    22                    tal:attributes="value info/type_description" />
    2312            Payment:</td>
    2413            <td tal:content="info/type_description"></td>
     
    2615          <tr>
    2716            <td>
    28             <input name="x_Billto" type="hidden"
    29                    tal:attributes="value info/pay_bill_to" />
    30             <input name="x_Shipto" type="hidden"
    31                    tal:attributes="value info/pay_ship_to" />
    32             <input name="x_PayerID" type="hidden"
    33                    tal:attributes="value info/student_id" />
    34             <input name="x_PayerNames" type="hidden"
    35                    tal:attributes="value info/student_name" />
    36             <input name="x_PayerEmail" type="hidden"
    37                    tal:attributes="value info/student_email" />
    38             <input name="x_OrderID" type="hidden"
    39                    tal:attributes="value info/order_id" />
    4017            Name:
    4118            </td>
     
    4421          <tr>
    4522            <td >
    46             <input name="x_amt" type="hidden"
    47                    tal:attributes="value info/amount" />
    4823            Amount:
    4924            </td>
     
    5833        </table>
    5934        <br />
    60         <input type="submit" class="standalone" name="btnPostPopup"
    61                      value="Start"
    62                      />
     35        <input type="submit"
     36               class="standalone"
     37               name="goto_bank"
     38               value="Start"
     39               />
    6340
    6441      </form>
Note: See TracChangeset for help on using the changeset viewer.