Changeset 5193 for WAeUP_SRP/trunk


Ignore:
Timestamp:
14 May 2010, 11:38:09 (15 years ago)
Author:
Henrik Bettermann
Message:

implement split-request-payment

Location:
WAeUP_SRP/trunk/skins
Files:
2 added
2 edited

Legend:

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

    r5175 r5193  
    5656# begin customization
    5757
    58 if review_state in ('returning',):
     58if review_state in ('returning',) and info['next_session'] != session:
    5959    if session in ('06',):
    6060        info['payment_method'] = "online_payment"
  • WAeUP_SRP/trunk/skins/waeup_aaue/getPaymentsFolderInfo.py

    r5190 r5193  
    5656# begin customization
    5757
    58 if review_state == 'cleared_and_validated':
    59     info['payment_method'] = "online_payment"
    60 #elif review_state == 'cleared_and_validated' and session == '07':
    61 #    info['payment_method'] = "sc_payment"
    62 elif review_state == 'returning' and info['next_session'] != session:
    63     info['payment_method'] = "online_payment"
     58if review_state in ('returning',) and info['next_session'] != session:
     59    if session in ('06','07','08'):
     60        info['payment_method'] = "online_payment"
     61    else:
     62        info['payment_method'] = "first_instalment"
     63elif review_state in ('cleared_and_validated',):
     64    if session in ('06','07','08','09'):
     65        info['payment_method'] = "online_payment"
     66    else:
     67        info['payment_method'] = "first_instalment"
     68elif session in ('09','10','11',) and review_state in ('school_fee_paid','courses_registered','courses_validated',):
     69    second_instalment_records = aq_payments(Eq('student_id',student_id) & Eq('category','schoolfee2') & Eq('session_id',session) & Eq('status','paid'))
     70    if not second_instalment_records:
     71        info['payment_method'] = "second_instalment"
     72    else:   
     73        pass
    6474info['prod_id'] = '119'
    6575
     
    8292        row['title'] = "Invalid Payment, Naira %s, %s" % (payment.amount,
    8393                                                          payment.date.strftime("%d/%m/%y %H:%M:%S"))
     94    elif payment.type == 'request' and payment.resp_approved_amount:
     95        row['title'] = "%s for Session %s, Naira %s, %s" % (vocabularies.payment_categories.get(payment.category),
     96                                                            vocabularies.sessions.get(payment.session_id),
     97                                                            payment.resp_approved_amount,
     98                                                            payment.date.strftime("%d/%m/%y %H:%M:%S"))
     99    elif payment.type == 'request':
     100        row['title'] = "%s for Session %s, %s" % (vocabularies.payment_categories.get(payment.category),
     101                                                            vocabularies.sessions.get(payment.session_id),
     102                                                            payment.date.strftime("%d/%m/%y %H:%M:%S"))                                                           
    84103    else:
    85104        row['title'] = "%s for Session %s, Naira %s, %s" % (vocabularies.payment_categories.get(payment.category),
     
    100119    row['trans_ref'] = payment.order_id
    101120    if row['is_requeryable']:
    102         row['callback_url'] = "%(url)s/interswitch_cb" % row
     121        if payment.category == 'schoolfee':
     122            row['callback_url'] = "%(url)s/interswitch_cb" % row
     123        elif payment.category == 'schoolfee2':
     124            row['callback_url'] = "%(url)s/interswitch_cb2" % row             
    103125#        if payment.category == 'schoolfee':
    104126#            row['callback_url'] = "%(url)s/interswitch_cb" % row
     
    112134        row['href'] = href
    113135    elif row['is_requestable']:
    114         row['callback_url'] = "%(url)s/interswitch_request_cb" % row
     136        if payment.category == 'schoolfee':
     137            row['callback_url'] = "%(url)s/interswitch_request_cb" % row
     138        elif payment.category == 'schoolfee2':
     139            row['callback_url'] = "%(url)s/interswitch_request_cb2" % row     
    115140        #href = '%(query_url)s' % info
    116141        href = "http://testwebpay.interswitchng.com/CollegepayService/TransactionQueryURL.aspx"
    117142        href += '?redirectURL=%(callback_url)s' % row
     143        #href += '&productid=%(prod_id)s' % info
    118144        href += '&productid=53'
    119145        href += '&merchantref=ignore'
    120146        href += '&custNumber=%s' % student_id
    121147        href += '&session=%s' % info['next_session_str']
    122         href += '&semester=Semester 1'             
     148        href += '&semester=Semester 1'
     149        if payment.category == 'schoolfee2':   
     150            href += '&semester=Semester 2'         
    123151        row['href'] = href       
    124152    if payment.status == 'paid':
Note: See TracChangeset for help on using the changeset viewer.