Ignore:
Timestamp:
19 Apr 2012, 08:34:28 (13 years ago)
Author:
Henrik Bettermann
Message:

Check only the last 8 digits of order_id.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_uniben/etranzact_cb.py

    r8145 r8212  
    5353logger.info('SUCCESS: %s' % success)
    5454
    55 if success == '-1':
     55if not 'COL1' in success:
    5656    logger.info('%s requeried payment %s for %s without success' % (member,context.getId(),student_id))
    5757    return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
    58 
    59 
    60 # Example:
    61 #'RECEIPT_NO=5001109085339
    62 #&PAYMENT_CODE=500856521315472785095
    63 #&MERCHANT_CODE=0570019903
    64 #&TRANS_AMOUNT=5000.0
    65 #&TRANS_DATE=2011/09/08 10:06:31
    66 #&TRANS_DESCR=Trade%20-%20Tel%20line%20installation%20EO20474-Obinna%20Mbagwu
    67 #&CUSTOMER_ID=EO20474
    68 #&BANK_CODE=500
    69 #&BRANCH_CODE=001
    70 #&SERVICE_ID=EO20474
    71 #&CUSTOMER_NAME=Obinna%20Mbagwu
    72 #&CUSTOMER_ADDRESS=No%207%20Park%20View%20Estate%20Ikoyi
    73 #&TELLER_ID=etzbankteller
    74 #&USERNAME=N/A
    75 #&PASSWORD=N/A
    76 #&BANK_NAME=eTranzact%20Test%20Bank
    77 #&BRANCH_NAME=ETZ%20BANK%20HEAD%20OFFICE
    78 #&CHANNEL_NAME=Bank
    79 #&PAYMENT_METHOD_NAME=Cash
    80 #&PAYMENT_CURRENCY=566
    81 #&TRANS_TYPE=002
    82 #&TRANS_FEE=0.0
    83 #&TYPE_NAME=Trade%20-%20Tel%20line%20installation
    84 #&LEAD_BANK_CODE=057
    85 #&LEAD_BANK_NAME=eTranzact%20Test%20Bank'
    8658
    8759success = request.get('SUCCESS').split('&')
     
    9062pay_doc = context.getContent()
    9163
    92 if pay_doc['order_id'] != success_dict['COL1'] and not ontest :
     64oid = pay_doc['order_id']
     65col1 = success_dict['COL1']
     66
     67if oid[len(oid)-8:len(oid)] != col1[len(col1)-8:len(col1)] and not ontest :
    9368    logger.info('%s requeried payment %s for %s but wrong COL1 %s returned' % (member,context.getId(),student_id,success_dict['COL1']))
    9469    return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
Note: See TracChangeset for help on using the changeset viewer.