From e621f931bd2ee3269354b02b46b9fe213789ebd4 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sat, 4 Apr 2020 12:56:00 +0200 Subject: [PATCH 6/7] sips2: PEP8, style --- eopayment/sips2.py | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/eopayment/sips2.py b/eopayment/sips2.py index 440546c..7b8de2d 100644 --- a/eopayment/sips2.py +++ b/eopayment/sips2.py @@ -1,18 +1,21 @@ # -*- coding: utf-8 -*- + +from decimal import Decimal +from gettext import gettext as _ import collections +import hashlib +import hmac import json -from six.moves.urllib import parse as urlparse import string -from decimal import Decimal import uuid -import hashlib -import hmac -from gettext import gettext as _ -import requests import warnings +from six.moves.urllib import parse as urlparse + +import requests + from .common import (PaymentCommon, FORM, Form, PaymentResponse, PAID, ERROR, - CANCELED, ResponseError, force_text) + CANCELED, ResponseError, force_text) __all__ = ['Payment'] @@ -266,9 +269,13 @@ class Payment(PaymentCommon): data['seal'] = self.get_seal_for_json_ws_data(data) url = self.WS_URL.get(self.platform) + '/rs-services/v2/cashManagement/%s' % endpoint self.logger.debug('posting %r to %s endpoint', data, endpoint) - response = requests.post(url, data=json.dumps(data), - headers={'content-type': 'application/json', - 'accept': 'application/json'}) + response = requests.post( + url, + data=json.dumps(data), + headers={ + 'content-type': 'application/json', + 'accept': 'application/json' + }) self.logger.debug('received %r', response.content) response.raise_for_status() json_response = response.json() @@ -301,9 +308,13 @@ class Payment(PaymentCommon): data['seal'] = self.get_seal_for_json_ws_data(data) url = self.WS_URL.get(self.platform) + '/rs-services/v2/diagnostic/getTransactionData' self.logger.debug('posting %r to %s endpoint', data, 'diagnostic') - response = requests.post(url, data=json.dumps(data), - headers={'content-type': 'application/json', - 'accept': 'application/json'}) + response = requests.post( + url, + data=json.dumps(data), + headers={ + 'content-type': 'application/json', + 'accept': 'application/json', + }) self.logger.debug('received %r', response.content) response.raise_for_status() return response.json() -- 2.24.0