Changeset 1798


Ignore:
Timestamp:
18 May 2007, 13:51:16 (18 years ago)
Author:
Henrik Bettermann
Message:

there are records with duplicate uid in online_payments_import which was not catched by the import function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTool.py

    r1794 r1798  
    287287        #    st = res[0]
    288288        #res = self.returning_import(matric_no = st.matric_no)
    289         res = self.returning_import(id = student_id)       
     289        res = self.returning_import(id = student_id)
    290290        if res:
    291291            student = res[0]
     
    617617
    618618            # format of the second file sent by Tayo
     619            #data['datetime'] = date = 0
     620            #data['student_id'] = student_id = pay_transaction['Payer ID']
     621            #data['order_id'] = order_id = pay_transaction['Order ID (Tranx Ref)']
     622            #data['response_code'] = response_code = '00'
     623            #data['amount'] = amount = pay_transaction['Amount']
     624           
     625            # format of the third file sent by Kehinde
    619626            data['datetime'] = date = 0
    620             data['student_id'] = student_id = pay_transaction['Payer ID']
    621             data['order_id'] = order_id = pay_transaction['Order ID (Tranx Ref)']
     627            data['student_id'] = student_id = pay_transaction['customer_id']
     628            data['order_id'] = order_id = pay_transaction['merchant_reference']
    622629            data['response_code'] = response_code = '00'
    623             data['amount'] = amount = pay_transaction['Amount']
     630            data['amount'] = amount = pay_transaction['Amount']           
    624631
    625632            dup = False
     
    633640            if dup:
    634641                if response_code == "00":
    635                     opt.modifyRecord(**data)
     642                    try:
     643                        opt.modifyRecord(**data)
     644                    except:
     645                        logger.info("duplicate uid, order_id %(order_id)s, student_id %(student_id)s, response_code %(response_code)s" % data)
     646                        continue
    636647                else:
    637648                    pay_transaction['Error'] = "Duplicate order_id"
Note: See TracChangeset for help on using the changeset viewer.