sips2: PEP8, style (#41320)

This commit is contained in:
Benjamin Dauvergne 2020-04-04 12:56:00 +02:00
parent 69aa304c43
commit a3307e0a47
1 changed files with 25 additions and 14 deletions

View File

@ -1,18 +1,21 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import collections
import json
from six.moves.urllib import parse as urlparse
import string
from decimal import Decimal from decimal import Decimal
import uuid from gettext import gettext as _
import collections
import hashlib import hashlib
import hmac import hmac
from gettext import gettext as _ import json
import requests import string
import uuid
import warnings import warnings
from six.moves.urllib import parse as urlparse
import requests
from .common import (PaymentCommon, FORM, Form, PaymentResponse, PAID, ERROR, from .common import (PaymentCommon, FORM, Form, PaymentResponse, PAID, ERROR,
CANCELED, ResponseError, force_text) CANCELED, ResponseError, force_text)
__all__ = ['Payment'] __all__ = ['Payment']
@ -266,9 +269,13 @@ class Payment(PaymentCommon):
data['seal'] = self.get_seal_for_json_ws_data(data) data['seal'] = self.get_seal_for_json_ws_data(data)
url = self.WS_URL.get(self.platform) + '/rs-services/v2/cashManagement/%s' % endpoint url = self.WS_URL.get(self.platform) + '/rs-services/v2/cashManagement/%s' % endpoint
self.logger.debug('posting %r to %s endpoint', data, endpoint) self.logger.debug('posting %r to %s endpoint', data, endpoint)
response = requests.post(url, data=json.dumps(data), response = requests.post(
headers={'content-type': 'application/json', url,
'accept': 'application/json'}) data=json.dumps(data),
headers={
'content-type': 'application/json',
'accept': 'application/json'
})
self.logger.debug('received %r', response.content) self.logger.debug('received %r', response.content)
response.raise_for_status() response.raise_for_status()
json_response = response.json() json_response = response.json()
@ -301,9 +308,13 @@ class Payment(PaymentCommon):
data['seal'] = self.get_seal_for_json_ws_data(data) data['seal'] = self.get_seal_for_json_ws_data(data)
url = self.WS_URL.get(self.platform) + '/rs-services/v2/diagnostic/getTransactionData' url = self.WS_URL.get(self.platform) + '/rs-services/v2/diagnostic/getTransactionData'
self.logger.debug('posting %r to %s endpoint', data, 'diagnostic') self.logger.debug('posting %r to %s endpoint', data, 'diagnostic')
response = requests.post(url, data=json.dumps(data), response = requests.post(
headers={'content-type': 'application/json', url,
'accept': 'application/json'}) data=json.dumps(data),
headers={
'content-type': 'application/json',
'accept': 'application/json',
})
self.logger.debug('received %r', response.content) self.logger.debug('received %r', response.content)
response.raise_for_status() response.raise_for_status()
return response.json() return response.json()