Changeset 2151 for WAeUP_SRP


Ignore:
Timestamp:
23 Aug 2007, 10:31:35 (17 years ago)
Author:
joachim
Message:

online payment for parttime, please test.

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

Legend:

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

    r1952 r2151  
    4848info = {}
    4949is_so = info['is_so'] = context.isSectionOfficer()
     50is_student = info['is_student'] = context.isStudent()
     51info['student_name'] = s_brain.name
    5052info['query_url'] = "https://webpay.interswitchng.com/paydirect/services/TransactionQueryURL.aspx"
    51 info['prod_id'] = '61'
    52 #res = context.portal_catalog(portal_type='Student',id = student_id)
    53 #res = context.students_catalog(id = student_id)
    54 info['review_state'] = s_brain.review_state
     53review_state = info['review_state'] = s_brain.review_state
     54if s_brain.mode.endswith('_ft'):
     55    online_payment = True
     56else:
     57    online_payment = review_state == 'cleared_and_validated'
     58info['online_payment'] = online_payment
    5559session = s_brain.session
    5660info['next_session'], info['next_session_str'] = context.getNextSessionId(session)
  • WAeUP_SRP/trunk/skins/waeup_epayment/getSchoolFee.py

    r1994 r2151  
    55##bind script=script
    66##bind subpath=traverse_subpath
    7 ##parameters=faculty=None, session=None
     7##parameters=brain=None
    88##title=
    99##
     
    2727                '06': ('22200','23700'),
    2828                }
     29pt_fees = {
     30           "DIF": {'new': "32200",
     31                   'returning': "17700",
     32                   'description': 'Diploma in French'},
     33           "DTA": {'new':"34200",
     34                   'returning':"19700",
     35                  'description': 'Diploma in Theatre Arts'},
     36           "DISD": {'new':"42200",
     37                    'returning':"27700",
     38                   'description': 'Diploma in International Studies'},
     39           "DFA": {'new':"34200",
     40                   'returning':"19700",
     41                  'description': 'Diploma in Fine & Applied Arts'},
     42           "DAE": {'new':"41700",
     43                   'returning':"25700",
     44                  'description': 'Diploma in Agric Economics'},
     45           "DFS": {'new':"38700",
     46                   'returning':"22700",
     47                  'description': 'Diploma in Fishery, Forestry & Wild Life'},
     48           "DFBS": {'new':"38700",
     49                    'returning':"22700",
     50                   'description': 'Diploma in Food & Breweries'},
     51           "DIA": {'new':"42200",
     52                   'returning':"27700",
     53                  'description': 'Diploma in Accounting'},
     54           "DBF": {'new':"42200",
     55                   'returning':"27700",
     56                  'description': 'Diploma in Banking & Finance'},
     57           "DAIC": {'new':"38700",
     58                    'returning':"22700",
     59                   'description': 'Diploma in Applied Industrial Chemistry'},
     60           "DAM": {'new':"38700",
     61                   'returning':"22700",
     62                  'description': 'Diploma in Applied Microbiology'},
     63           "DIG": {'new':"41700",
     64                   'returning':"25700",
     65                  'description': 'Diploma in Geology'},
     66           "DSLT": {'new':"41700",
     67                    'returning':"25700",
     68                   'description': 'Diploma in Science Laboratory Technology'},
     69           "DICE": {'new':"43700",
     70                    'returning':"27700",
     71                   'description': 'Diploma in Computer Engineering'},
     72           "DICHE": {'new':"43700",
     73                     'returning':"27700",
     74                    'description': 'Diploma in Chemical Engineering'},
     75           "DDP": {'new':"43700",
     76                   'returning':"27700",
     77                  'description': 'Diploma in Data Processing'},
     78           "DCG": {'new':"34200",
     79                   'returning':"19700",
     80                  'description': 'Diploma in Cartography'},
     81           "DSW": {'new':"40200",
     82                   'returning':"25700",
     83                  'description': 'Diploma in Social Works'},
     84           "DIL": {'new':"42200",
     85                   'returning':"27700",
     86                  'description': 'Diploma in Law'},
     87           "DHT": {'new':"42200",
     88                   'returning':"27700",
     89                  'description': 'Diploma in Recreation, Hotel & Tourism Mgt.'},
     90           "DEC": {'new':"36200",
     91                   'returning':"21200",
     92                  'description': 'Certificate in Early Child Health & Dev.'},
     93           "DLS": {'new':"37200",
     94                   'returning':"24200",
     95                  'description': 'Diploma in Library & Information Science'},
     96           "BFA": {'new':"42200",
     97                   'returning':"27700",
     98                  'description': 'Bachelor in Fine & Applied Arts'},
     99           "BTA": {'new':"42200",
     100                   'returning':"27700",
     101                  'description': 'Bachelor in Theatre Arts'},
     102           "BEL": {'new':"42200",
     103                   'returning':"27700",
     104                  'description': 'Bachelor in English'},
     105           "BFR": {'new':"42200",
     106                   'returning':"27700",
     107                  'description': 'Bachelor in French'},
     108           "BISD": {'new':"42200",
     109                    'returning':"27700",
     110                   'description': 'Bachelor in International Std. & Diplomacy'},
     111           "BAE": {'new':"48700",
     112                   'returning':"32700",
     113                  'description': 'Bachelor in Agric Econs'},
     114           "BAN": {'new':"43700",
     115                   'returning':"27700",
     116                  'description': 'Bachelor in Animal Science'},
     117           "BAC": {'new':"43700",
     118                   'returning':"27700",
     119                  'description': 'Bachelor in Crop Science'},
     120           "BAS": {'new':"43700",
     121                   'returning':"27700",
     122                  'description': 'Bachelor in Soil Science'},
     123           "BIA": {'new':"47200",
     124                   'returning':"32700",
     125                  'description': 'Bachelor in Accounting'},
     126           "BBF": {'new':"47200",
     127                   'returning':"32700",
     128                  'description': 'Bachelor in Banking & Finance'},
     129           "BLG": {'new':"37200",
     130                   'returning':"22700",
     131                  'description': 'Bachelor in Local Goverment'},
     132           "BPA": {'new':"47200",
     133                   'returning':"32700",
     134                  'description': 'Bachelor in Public Admin'},
     135           "BSW": {'new':"42200",
     136                   'returning':"27700",
     137                  'description': 'Bachelor in  Social Works'},
     138           "BES": {'new':"43700",
     139                   'returning':"27700",
     140                  'description': 'Bachelor in Environmental Science'},
     141           "BSLT": {'new':"43700",
     142                    'returning':"27700",
     143                   'description': 'Bachelor in Science Lab Technology'},
     144           "BIP": {'new':"43700",
     145                   'returning':"27700",
     146                  'description': 'Bachelor in Industrial Physics'},
     147           "BSCS": {'new':"45700",
     148                    'returning':"29700",
     149                   'description': 'Bachelor in Statistics with Computer'},
     150           "LLBPT": {'new':"47200",
     151                     'returning':"32700",
     152                    'description': 'Bachelor in Law'},
     153           "ODPT": {'new':"58700",
     154                    'returning':"42700",
     155                   'description': 'Doctor of Optometry'},
     156           "PHARMD": {'new':"58700",
     157                      'returning':"44700",
     158                     'description': 'Doctor of Pharmacy'},
     159           "BEEL": {'new':"38700",
     160                    'returning':"32700",
     161                   'description': 'Bachelor in Electrical/Electronics'},
     162           "BECE": {'new':"38700",
     163                    'returning':"32700",
     164                   'description': 'Bachelor in Chemical Engineering'},
     165           "BECO": {'new':"38700",
     166                    'returning':"32700",
     167                   'description': 'Bachelor in Computer Engineering'},
     168           "BPRE": {'new':"38700",
     169                    'returning':"32700",
     170                   'description': 'Bachelor in Production Engineering'},
     171           "BEPE": {'new':"38700",
     172                    'returning':"32700",
     173                   'description': 'Bachelor in Petroleum Engineering'},
     174           "BECV": {'new':"38700",
     175                    'returning':"32700",
     176                   'description': 'Bachelor in Civil Engineering'},
     177          }
    29178#sessionstring = "School Fee for Session %s" % context.portal_vocabularies.sessions.get(session)
    30179# sessionstring = "School Fee for Session %s" % context.sessions_voc(key=session)
     
    35184#     return fee_1_data
    36185# return fee_2_data
    37 f = 1
    38 if faculty in fee1:
    39     f = 0
    40 return (session_fees[session][f],
    41         "School Fee for Session %s" % context.sessions_voc(key=session))
     186d = {}
     187if brain.mode.endswith('_ft'):
     188    f = 1
     189    if brain.faculty in fee1:
     190        f = 0
     191    d['new'] = session_fees[brain.session][f]
     192    d['returning'] = session_fees[brain.session][f]
     193    d['description'] = "School Fee for Session %s" % context.sessions_voc(key=brain.session)
     194if pt_fees.has_key(brain.course):
     195    d = pt_fees[brain.course]
     196    d['description'] = "School Fee for Session %s %s" % (context.sessions_voc(key=brain.session),
     197                                                         d['description'])
     198return d
    42199
  • WAeUP_SRP/trunk/skins/waeup_epayment/interswitch_form.pt

    r1937 r2151  
    11<metal:body use-macro="here/main_template/macros/master">
    2     <metal:main fill-slot="main"
    3                 tal:define="info options/info">
    4                
    5         <h3>Confirm Your Payment Data! </h3>
    6         <br />
    7                
     2  <metal:main fill-slot="main"
     3              tal:define="info options/info">
     4    <h3>Confirm Your Payment Data! </h3>
     5    <br />
     6    <span tal:condition="not: info/payment_possible">
     7      No payment Information for your course available.
     8    </span>
     9    <span tal:condition="info/payment_possible">
    810      <form method="post" action="pay_interswitch">
    911        <table>
     
    4042
    4143      </form>
     44    </span>
    4245    </metal:main>
    4346</metal:body>
  • WAeUP_SRP/trunk/skins/waeup_epayment/pay_interswitch.py

    r1992 r2151  
    3434
    3535sbrain = context.students_catalog(id=student_id)[0]
    36 amount,description = context.getSchoolFee(sbrain.faculty,sbrain.session)
     36#amount,description = context.getSchoolFee(sbrain.faculty,sbrain.session,sbrain.course)
    3737info = {}
     38info['student'] = sbrain
     39info['payment_possible'] = False
     40fee_dict = context.getSchoolFee(sbrain)
     41if not fee_dict:
     42    return context.interswitch_form(info=info)
     43info['payment_possible'] = True
    3844info['site_id'] = '61'
    3945info['currency_id'] = '566'
    40 info['amount'] = amount
    41 info['type_code'] = sbrain.faculty
    42 info['type_description'] = description
     46if sbrain.entry_session == context.getSessionId()[-2:]:
     47    amount = info['amount'] = fee_dict['new']
     48else:
     49    amount = info['amount'] = fee_dict['returning']
     50if sbrain.mode.endswith('_ft'):
     51    pay_item_id = "6100"
     52    info['type_code'] = sbrain.faculty
     53else:
     54    pay_item_id = "6101"
     55    info['type_code'] = sbrain.course
     56info['type_description'] = fee_dict['description']
    4357info['pay_bill_to'] = sbrain.name
    4458info['pay_ship_to'] = "University of Benin"
     
    5266p_id = "p%s" % order_id
    5367
    54 #from Products.zdb import set_trace;set_trace()
    5568if student_id is None:
    5669    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
     
    132145args['site_name'] = "uniben.waeup.org"
    133146args['cust_name_desc'] = "Student Name"
    134 args['pay_item_id'] = "6100"
     147args['pay_item_id'] = pay_item_id
    135148args['pay_item_name'] = "UNIBEN Tuition Payments"
    136149args['payment_params'] = 'switch_college_split'
  • WAeUP_SRP/trunk/skins/waeup_epayment/payments_view.pt

    r1950 r2151  
    77    <span tal:condition="info" tal:omit-tag="">
    88      <span tal:define= " rows info/payments;
    9       review_state context/getStudentReviewState;
    10       is_student context/isStudent;
    11       s_name context/getStudentNameInContext;"
     9      review_state info/review_state;
     10      is_student info/is_student;
     11      s_name info/student_name;"
    1212      >
    1313        <a href=""
     
    5757        <br />
    5858        <div>
    59           <form tal:condition="python:review_state == 'cleared_and_validated'"
     59          <form tal:condition="info/online_payment"
    6060                tal:attributes="action string: ${context/absolute_url}/pay_interswitch" method="post" class="group">
    6161            <input type="submit" name="epayment"
     
    6464                   />
    6565          </form> 
    66           <form tal:condition="python:review_state == 'returning'"
     66          <form tal:condition="not: info/online_payment"
    6767                tal:attributes="action string: ${context/absolute_url}/pay_by_sc" method="post" class="group">
    6868            <input type="hidden" name="paid_session"
Note: See TracChangeset for help on using the changeset viewer.