diff options
-rw-r--r-- | boto/fps/connection.py | 10 |
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, |