diff --git a/openpaygo/metrics_request.py b/openpaygo/metrics_request.py index 72a05b8..9672b58 100644 --- a/openpaygo/metrics_request.py +++ b/openpaygo/metrics_request.py @@ -50,10 +50,10 @@ def get_simple_request_dict(self): simple_request["historical_data"] = self.historical_data # We prepare the auth if self.auth_method: - simple_request[ - "auth" - ] = OpenPAYGOMetricsShared.generate_request_signature_from_data( - simple_request, self.auth_method, self.secret_key + simple_request["auth"] = ( + OpenPAYGOMetricsShared.generate_request_signature_from_data( + simple_request, self.auth_method, self.secret_key + ) ) return simple_request @@ -83,10 +83,10 @@ def get_condensed_request_dict(self): raise ValueError( "Additional variables not present in the data format: " + str(data_copy) ) - condensed_request[ - "data" - ] = OpenPAYGOMetricsShared.remove_trailing_empty_elements( - condensed_request["data"] + condensed_request["data"] = ( + OpenPAYGOMetricsShared.remove_trailing_empty_elements( + condensed_request["data"] + ) ) # We add the historical data historical_data_copy = copy.deepcopy(self.historical_data) @@ -105,10 +105,10 @@ def get_condensed_request_dict(self): condensed_request["historical_data"].append(time_step_data) # We prepare the auth if self.auth_method: - condensed_request[ - "auth" - ] = OpenPAYGOMetricsShared.generate_request_signature_from_data( - condensed_request, self.auth_method, self.secret_key + condensed_request["auth"] = ( + OpenPAYGOMetricsShared.generate_request_signature_from_data( + condensed_request, self.auth_method, self.secret_key + ) ) # We replace the key names by the condensed ones condensed_request = OpenPAYGOMetricsShared.convert_dict_keys_to_condensed( diff --git a/openpaygo/metrics_response.py b/openpaygo/metrics_response.py index 2568d61..9ad4951 100644 --- a/openpaygo/metrics_response.py +++ b/openpaygo/metrics_response.py @@ -171,14 +171,14 @@ def get_answer_dict(self): # If there is not data format, we just return the full response condensed_answer = copy.deepcopy(self.response_dict) if self.secret_key: - condensed_answer[ - "auth" - ] = OpenPAYGOMetricsShared.generate_response_signature_from_data( - serial_number=self.request_dict.get("serial_number"), - request_count=self.request_dict.get("request_count"), - data=condensed_answer, - timestamp=self.request_dict.get("timestamp"), - secret_key=self.secret_key, + condensed_answer["auth"] = ( + OpenPAYGOMetricsShared.generate_response_signature_from_data( + serial_number=self.request_dict.get("serial_number"), + request_count=self.request_dict.get("request_count"), + data=condensed_answer, + timestamp=self.request_dict.get("timestamp"), + secret_key=self.secret_key, + ) ) return OpenPAYGOMetricsShared.convert_dict_keys_to_condensed(condensed_answer)