Sort keys in JSON payment metadata

This commit is contained in:
Raphael Michel
2019-07-09 16:13:23 +02:00
parent 5a03033255
commit eef713816e
2 changed files with 3 additions and 3 deletions

View File

@@ -86,7 +86,7 @@ class LoggingMixin:
if (sensitivekey in k) and v:
data[k] = "********"
logentry.data = json.dumps(data, cls=CustomJSONEncoder)
logentry.data = json.dumps(data, cls=CustomJSONEncoder, sort_keys=True)
elif data:
raise TypeError("You should only supply dictionaries as log data.")
if save:

View File

@@ -1185,7 +1185,7 @@ class OrderPayment(models.Model):
@info_data.setter
def info_data(self, d):
self.info = json.dumps(d)
self.info = json.dumps(d, sort_keys=True)
@cached_property
def payment_provider(self):
@@ -1543,7 +1543,7 @@ class OrderRefund(models.Model):
@info_data.setter
def info_data(self, d):
self.info = json.dumps(d)
self.info = json.dumps(d, sort_keys=True)
@cached_property
def payment_provider(self):