Ignore:
Timestamp:
15 Jul 2020, 09:00:00 (4 years ago)
Author:
Henrik Bettermann
Message:

Adjust to new Interswitch API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py

    r16114 r16167  
    182182    #  u'BankCode': u''}
    183183
    184 
    185     if len(jr) < 8:
     184    if not 'ResponseCode' in jr.keys() \
     185        or not 'ResponseDescription' in jr.keys() \
     186        or not 'Amount' in jr.keys():
    186187        msg = _('Invalid callback: ${a}', mapping = {'a': str(jr)})
    187188        log = 'invalid callback for payment %s: %s' % (payment.p_id, str(jr))
     
    194195    payment.r_desc = jr['ResponseDescription']
    195196    payment.r_amount_approved = jr['Amount'] / 100.0
    196     payment.r_card_num = jr['CardNumber']
     197    payment.r_card_num = jr.get('CardNumber', u'')
    197198    payment.r_pay_reference = jr.get('PaymentReference', u'')
    198199    #payment.r_company = u'interswitch'
Note: See TracChangeset for help on using the changeset viewer.