From bf8bb3b9a8f40dcf502023a44c7ab02cb8e1c163 Mon Sep 17 00:00:00 2001 From: Brad Beattie Date: Mon, 22 Aug 2011 14:42:51 -0700 Subject: [PATCH 1/3] Providing mechanism for path suffixes to satisfy charges API format as documented at http://docs.chargify.com/api-charges. --- chargify.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chargify.py b/chargify.py index 510bfbb..f5e2ea7 100644 --- a/chargify.py +++ b/chargify.py @@ -137,6 +137,10 @@ def construct_request(self, **kwargs): value = kwargs.pop(identifier, None) if value: path.insert(path.index(name)+1, str(value)) + + # Append a path suffix if provided + if 'suffix' in kwargs: + path.append(kwargs['suffix']) # Convert the data to a JSON string data = kwargs.pop('data', None) From 946f852223d31aa740a924f0ad71b7c8ae41d542 Mon Sep 17 00:00:00 2001 From: Brad Beattie Date: Mon, 22 Aug 2011 14:58:34 -0700 Subject: [PATCH 2/3] Allowing multiple suffixes --- chargify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chargify.py b/chargify.py index f5e2ea7..cd95231 100644 --- a/chargify.py +++ b/chargify.py @@ -140,7 +140,7 @@ def construct_request(self, **kwargs): # Append a path suffix if provided if 'suffix' in kwargs: - path.append(kwargs['suffix']) + path += kwargs['suffix'] # Convert the data to a JSON string data = kwargs.pop('data', None) From 4aea1d153eddc69c9d8b0d48c8b05bfe3e4af5f7 Mon Sep 17 00:00:00 2001 From: Brad Beattie Date: Thu, 25 Aug 2011 11:16:22 -0700 Subject: [PATCH 3/3] Using extend instead of += --- chargify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chargify.py b/chargify.py index cd95231..b47a580 100644 --- a/chargify.py +++ b/chargify.py @@ -140,7 +140,7 @@ def construct_request(self, **kwargs): # Append a path suffix if provided if 'suffix' in kwargs: - path += kwargs['suffix'] + path.extend(kwargs['suffix']) # Convert the data to a JSON string data = kwargs.pop('data', None)