Commit 0126a06d authored by Jérome Perrin's avatar Jérome Perrin

payzen_secure_payment: fix missing-timeout and unnecessary-pass pylint warnings

parent 98a0ddb4
Pipeline #39400 failed with stage
in 0 seconds
......@@ -50,6 +50,9 @@ else:
del(os.environ['TZ'])
time.tzset()
DEFAULT_TIMEOUT = 30 # seconds
class PayzenREST:
"""REST communication
......@@ -68,7 +71,12 @@ class PayzenREST:
LOG('callPayzenApi', WARNING,
"data = %s URL = %s" % (str(payzen_dict), URL), error=False)
# send data
result = requests.post(URL, data=payzen_dict, headers=header)
result = requests.post(
URL,
data=payzen_dict,
headers=header,
timeout=self.getTimeout() or DEFAULT_TIMEOUT,
)
try:
data = result.json()
except Exception:
......@@ -110,10 +118,11 @@ class PayzenService(XMLObject, PayzenREST):
property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject
, PropertySheet.Reference
, PropertySheet.SocketClient
)
def initialize(self, REQUEST=None, **kw):
"""See Payment Service Interface Documentation"""
pass
def _getSignature(self, ob, sorted_key_list):
"""Calculates signature from ob
......
  • cc @rafael

    we should maybe make a mixin which computes a timeout based on remaining time left for the current request, but this is enough to fix the pylint warnings on py3 ( pylint has more rules on py3 )

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