Ignore:
Timestamp:
11 Jan 2016, 06:09:59 (9 years ago)
Author:
Henrik Bettermann
Message:

Do not change payment date after verification.

File:
1 edited

Legend:

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

    r13581 r13584  
    9393    return parsed_json
    9494
    95 def query_interswitch_SOAP(payment, product_id, host, url, https):
     95def query_interswitch_SOAP(payment, product_id, host, url, https, verify):
    9696    sr = get_SOAP_response(product_id, payment.p_id, host, url, https)
    9797    if sr.startswith('Connection error'):
     
    132132        return False, msg, log
    133133    payment.p_state = 'paid'
    134     payment.payment_date = datetime.utcnow()
     134    if not verify:
     135        payment.payment_date = datetime.utcnow()
    135136    msg = _('Successful callback received.')
    136137    log = 'valid callback for %s payment %s: %s' % (
     
    139140    return True, msg, log
    140141
    141 def query_interswitch(payment, product_id, host, url, https, mac):
     142def query_interswitch(payment, product_id, host, url, https, mac, verify):
    142143    # If no mac mac key is given, fall back to deprecated SOAP method
    143144    # (Uniben, AAUA, FCEOkene).
    144145    if mac == None:
    145         return query_interswitch_SOAP(payment, product_id, host, url, https)
     146        return query_interswitch_SOAP(
     147            payment, product_id, host, url, https, verify)
    146148    jr = get_JSON_response(product_id, payment.p_id, host, url,
    147149                           https, mac, payment.amount_auth)
     
    196198        return False, msg, log
    197199    payment.p_state = 'paid'
    198     payment.payment_date = datetime.utcnow()
     200    if not verify:
     201        payment.payment_date = datetime.utcnow()
    199202    msg = _('Successful callback received')
    200203    log = 'valid callback for %s payment %s: %s' % (
Note: See TracChangeset for help on using the changeset viewer.