Changeset 13585


Ignore:
Timestamp:
11 Jan 2016, 08:57:40 (9 years ago)
Author:
Henrik Bettermann
Message:

Only Interswitch payments are suitable for verification.

Do no change payment ticket if response code is 20050.

Location:
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch
Files:
2 edited

Legend:

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

    r13584 r13585  
    8686    @property
    8787    def target_url(self):
    88         if self.context.p_state != 'paid':
     88        if self.context.p_state != 'paid' \
     89            or self.context.r_company != u'interswitch':
    8990            return ''
    9091        return self.view.url(self.view.context, self.target)
     
    186187
    187188    def update(self):
    188         if self.context.p_state  != 'paid':
     189        if self.context.p_state  != 'paid' \
     190            or self.context.r_company != u'interswitch':
    189191            self.flash(_('This ticket has not been paid.'), type='danger')
    190192            return
     
    219221
    220222    def update(self):
    221         if self.context.p_state != 'paid':
     223        if self.context.p_state != 'paid' \
     224            or self.context.r_company != u'interswitch':
    222225            self.flash(_('This ticket has not been paid.'), type='danger')
    223226            return
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py

    r13584 r13585  
    9595def query_interswitch_SOAP(payment, product_id, host, url, https, verify):
    9696    sr = get_SOAP_response(product_id, payment.p_id, host, url, https)
     97    log = 'invalid callback for payment %s: %s' % (payment.p_id, str(jr))
    9798    if sr.startswith('Connection error'):
    9899        msg = _('Connection error')
     
    102103    if len(wlist) != 7:
    103104        msg = _('Invalid callback: ${a}', mapping = {'a': sr})
     105        log = 'invalid callback for payment %s: %s' % (payment.p_id, sr)
     106        return False, msg, log
     107    if verify and jr['ResponseCode'] == '20050':
     108        msg = _('Integration method has changed.')
    104109        log = 'invalid callback for payment %s: %s' % (payment.p_id, sr)
    105110        return False, msg, log
     
    170175        log = 'invalid callback for payment %s: %s' % (payment.p_id, str(jr))
    171176        return False, msg, log
     177    if verify and jr['ResponseCode'] == '20050':
     178        msg = _('Integration method has changed.')
     179        log = 'invalid callback for payment %s: %s' % (payment.p_id, str(jr))
     180        return False, msg, log
    172181    payment.r_code = jr['ResponseCode']
    173182    payment.r_desc = jr['ResponseDescription']
Note: See TracChangeset for help on using the changeset viewer.