summaryrefslogtreecommitdiff
path: root/boto/fps
diff options
context:
space:
mode:
authorunknown <jaraco@.jaraco.com>2010-09-26 13:46:25 -0400
committerunknown <jaraco@.jaraco.com>2010-09-26 13:46:25 -0400
commit524c9500de1ed2d2de74711bfbde7a392878988a (patch)
tree99dacc2bae8c9066115adf14c1acc27c8e4fc7be /boto/fps
parent377e14b861e06486245cedae1910862a05f5dbb8 (diff)
downloadboto-524c9500de1ed2d2de74711bfbde7a392878988a.tar.gz
Updated FPSConnection to use a real endpoint unless the sandbox is used for the API host.
Diffstat (limited to 'boto/fps')
-rw-r--r--boto/fps/connection.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/boto/fps/connection.py b/boto/fps/connection.py
index 1474da83..d37ce8cd 100644
--- a/boto/fps/connection.py
+++ b/boto/fps/connection.py
@@ -135,8 +135,14 @@ class FPSConnection(AWSQueryConnection):
hmac = self.hmac.copy()
hmac.update(canonical)
signature = urllib.quote_plus(base64.encodestring(hmac.digest()).strip())
-
- return "https://authorize.payments-sandbox.amazon.com%s&awsSignature=%s" % (url, signature)
+
+ # use the sandbox authorization endpoint if we're using the
+ # sandbox for API calls.
+ endpoint_host = 'authorize.payments.amazon.com'
+ if 'sandbox' in self.host:
+ endpoint_host = 'authorize.payments-sandbox.amazon.com'
+ fmt = "https://%(endpoint_host)s%(url)s&awsSignature=%(signature)s"
+ return fmt % vars()
def pay(self, transactionAmount, senderTokenId,
recipientTokenId=None, callerTokenId=None,