diff options
| author | Joren Van Onder <jov@odoo.com> | 2020-02-12 21:00:29 +0000 |
|---|---|---|
| committer | Joren Van Onder <jov@odoo.com> | 2020-02-13 08:16:01 +0000 |
| commit | aee95865bb6e4e0a0a3b0baa34ea8e4f1ec065d2 (patch) | |
| tree | 141d66ece44bdbae815eacc2002186fbda601a90 | |
| parent | d6db3bc5ef38ae6e53bf0cd45a6a677f5492e201 (diff) | |
[IMP] payment_authorize: log API responses
Makes debugging possible without having to run the db locally and
manually adding _loggers everywhere.
Parts of the error are logged already, leading to messages like:
...payment_authorize.models.payment: The transaction was unsuccessful
Unfortunately they don't show the reason. The entire response is
something like:
{'messages': {'message': [{'code': 'E00027',
'text': 'The transaction was unsuccessful.'}],
'resultCode': 'Error'},
'transactionResponse': {'SupplementalDataQualificationIndicator': 0,
'accountNumber': '',
'accountType': '',
'authCode': '',
'avsResultCode': 'P',
'cavvResultCode': '',
'cvvResultCode': '',
'errors': [{'errorCode': '5',
'errorText': 'A valid amount is '
'required.'}],
'refTransID': '',
'responseCode': '3',
'testRequest': '0',
'transHash': '',
'transHashSha2': '',
'transId': '0'}}
Since we log the full request above, let's also log the full response.
PS. this was present before but was lost with 26f3d8465d3c6f1da80c186.
opw-2188889
closes odoo/odoo#45259
X-original-commit: d269bba3b9f4f4fa567a2a7084396bdf08422fa4
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
| -rw-r--r-- | addons/payment_authorize/models/authorize_request.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/payment_authorize/models/authorize_request.py b/addons/payment_authorize/models/authorize_request.py index 80b9e4bdbf2..dce188477ba 100644 --- a/addons/payment_authorize/models/authorize_request.py +++ b/addons/payment_authorize/models/authorize_request.py @@ -44,6 +44,7 @@ class AuthorizeAPI(): resp = requests.post(self.url, json.dumps(data)) resp.raise_for_status() resp = json.loads(resp.content) + _logger.info("_authorize_request: Received response:\n%s", resp) messages = resp.get('messages') if messages and messages.get('resultCode') == 'Error': return { |
