From: Gael Le Mignot Date: Mon, 25 Nov 2019 15:02:20 +0000 (+0100) Subject: Added/changed a few logs X-Git-Tag: 1.4.1~5^2~12^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=refs%2Fheads%2F2019-sept;p=teleforma.git Added/changed a few logs --- diff --git a/teleforma/views/payment.py b/teleforma/views/payment.py index 19f50981..26ac1212 100644 --- a/teleforma/views/payment.py +++ b/teleforma/views/payment.py @@ -23,7 +23,7 @@ def call_scherlocks(what, data, merchant_id): Perform a Scherlock's call, with parameters in data what is either 'request' or 'response', the program to call """ - log.debug('call_scherlocks %r %r' % (what, data)) + log.info('call_scherlocks %r %r' % (what, data)) requestbin = os.path.join(settings.PAYMENT_SHERLOCKS_PATH, 'bin/static', what) params = dict(data) params['pathfile'] = os.path.join(settings.PAYMENT_SHERLOCKS_PATH, @@ -31,8 +31,6 @@ def call_scherlocks(what, data, merchant_id): params = ' '.join([ '%s=%s' % (k,v) for k,v in params.items() ]) cmdline = requestbin + ' ' + params - print cmdline - status, out = commands.getstatusoutput(cmdline) if status: raise OSError, "error calling %s" % cmdline @@ -45,10 +43,10 @@ def check_payment_info(data): """ Check that the payment info are valid """ - response_code = data[8]; - cvv_response_code = data[14]; + response_code = data[8] + cvv_response_code = data[14] - log.debug('check_payment_info %s %s' % (response_code, cvv_response_code)) + log.info('check_payment_info %s %s' % (response_code, cvv_response_code)) return response_code == '00' @@ -104,14 +102,16 @@ def bank_auto(request, merchant_id): """ res = call_scherlocks('response', { 'message': request.POST['DATA'] }, merchant_id = merchant_id) - order_id = res[24]; + order_id = res[24] payment = Payment.objects.get(pk = order_id) if check_payment_info(res) and payment.type == 'online' and not payment.online_paid: payment.online_paid = True payment.save() + log.info('bank_auto validating order_id %s' % (order_id)) tmpl_name = 'payment_ok' res = 'OK - Validated' else: + log.info('bank_auto failing order_id %s' % (order_id)) tmpl_name = 'payment_failed' res = 'OK - Cancelled'