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 -*-
import collections
import json
from six.moves.urllib import parse as urlparse
import string
from decimal import Decimal
import uuid
from gettext import gettext as _
import collections
import hashlib
import hmac
from gettext import gettext as _
import requests
import json
import string
import uuid
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()