Commit cb6a3fce authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_payzen: Fixup typo and increase verbose on failures to connect to Payzen

parent 18c60ac7
......@@ -18,7 +18,7 @@ isTransitionPossible = context.getPortalObject().portal_workflow.isTransitionPos
status = data_kw['status']
answer = data_kw['answer']
if status != "SUCCESS":
error_code = answer["error_code"]
error_code = answer["errorCode"]
if error_code == "PSP_010":
# Transaction Not Found
# Mark on payment transaction history log that transaction was not processed yet
......@@ -36,7 +36,9 @@ if status != "SUCCESS":
return
else:
# Unknown errorCode
payzen_event.confirm(comment='Unknown errorCode %r' % error_code)
# https://payzen.io/pt-BR/rest/V4.0/api/errors-reference.html
error_message = answer.get('errorMessage', '')
payzen_event.confirm(comment='Unknown errorCode %r, message: %s' % (error_code, error_message))
return
transaction_list = answer["transactions"]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment