Skip to content

Commit

Permalink
fixing a few issues with UDF sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
burhan committed Nov 3, 2014
1 parent 4e5de78 commit 2b7045e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
History
-------

1.1.2 (2014-11-03)
++++++++++++++++++

* Fixed issue iterating over UDF dictionary keys
* Fixed issue where unicode was being passed to sanitize
unicode strings are not allowed in UDF fields

1.1 (2014-08-12)
++++++++++++++++

Expand Down
4 changes: 2 additions & 2 deletions e24PaymentPipe/e24PaymentPipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ def udf(self, value):
raise ValueError('Only 5 user defined fields (UDF) are allowed')
if not all(x[:3].upper() == 'UDF' and 0 < int(x[-1]) <= 5 for x in value.keys()):
raise ValueError('Dictionary keys must be in the form of UDF1 through UDF5')
self._udf.update({k.upper(): sanitize(v) for k, v in value.iteritems()})
self._udf.update({k.upper(): sanitize(str(v)) for k, v in value.items()})
except AttributeError:
# Passed value does not have a keys() method,
# assume its not a dictionary
self._udf.update({'UDF{}'.format(k + 1): sanitize(v) for k, v in enumerate(value)})
self._udf.update({'UDF{}'.format(k + 1): sanitize(str(v)) for k, v in enumerate(value)})

@property
def error_url(self):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setup(
name='e24PaymentPipe',
version='1.1.1',
version='1.1.2',
description="This package provides a Python implementation for ACI's e24PaymentPipe Merchant Gateway",
long_description=readme + '\n\n' + history,
author='Burhan Khalid',
Expand Down

0 comments on commit 2b7045e

Please sign in to comment.