Projet

Général

Profil

0006-sips2-PEP8-style.patch

Benjamin Dauvergne, 04 avril 2020 13:05

Télécharger (2,7 ko)

Voir les différences:

Subject: [PATCH 6/7] sips2: PEP8, style

 eopayment/sips2.py | 37 ++++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 deletions(-)
eopayment/sips2.py
1 1
# -*- coding: utf-8 -*-
2

  
3
from decimal import Decimal
4
from gettext import gettext as _
2 5
import collections
6
import hashlib
7
import hmac
3 8
import json
4
from six.moves.urllib import parse as urlparse
5 9
import string
6
from decimal import Decimal
7 10
import uuid
8
import hashlib
9
import hmac
10
from gettext import gettext as _
11
import requests
12 11
import warnings
13 12

  
13
from six.moves.urllib import parse as urlparse
14

  
15
import requests
16

  
14 17
from .common import (PaymentCommon, FORM, Form, PaymentResponse, PAID, ERROR,
15
        CANCELED, ResponseError, force_text)
18
                     CANCELED, ResponseError, force_text)
16 19

  
17 20
__all__ = ['Payment']
18 21

  
......
266 269
        data['seal'] = self.get_seal_for_json_ws_data(data)
267 270
        url = self.WS_URL.get(self.platform) + '/rs-services/v2/cashManagement/%s' % endpoint
268 271
        self.logger.debug('posting %r to %s endpoint', data, endpoint)
269
        response = requests.post(url, data=json.dumps(data),
270
                headers={'content-type': 'application/json',
271
                         'accept': 'application/json'})
272
        response = requests.post(
273
            url,
274
            data=json.dumps(data),
275
            headers={
276
                'content-type': 'application/json',
277
                'accept': 'application/json'
278
            })
272 279
        self.logger.debug('received %r', response.content)
273 280
        response.raise_for_status()
274 281
        json_response = response.json()
......
301 308
        data['seal'] = self.get_seal_for_json_ws_data(data)
302 309
        url = self.WS_URL.get(self.platform) + '/rs-services/v2/diagnostic/getTransactionData'
303 310
        self.logger.debug('posting %r to %s endpoint', data, 'diagnostic')
304
        response = requests.post(url, data=json.dumps(data),
305
                headers={'content-type': 'application/json',
306
                         'accept': 'application/json'})
311
        response = requests.post(
312
            url,
313
            data=json.dumps(data),
314
            headers={
315
                'content-type': 'application/json',
316
                'accept': 'application/json',
317
            })
307 318
        self.logger.debug('received %r', response.content)
308 319
        response.raise_for_status()
309 320
        return response.json()
310
-