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 -*- -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()