summaryrefslogtreecommitdiff
path: root/boto/fps
diff options
context:
space:
mode:
authorThejaswi Puthraya <thejaswi.puthraya@gmail.com>2011-03-24 14:57:46 +0530
committerThejaswi Puthraya <thejaswi.puthraya@gmail.com>2011-03-24 14:57:46 +0530
commit2191a9a991f403487bd62b69de567236c636cca9 (patch)
tree0eba35b8ae5c6b8eb1e2259982fa81800fc81b32 /boto/fps
parentc220b4b9e95213ffe6ad4e36d4742e421b1b7740 (diff)
downloadboto-2191a9a991f403487bd62b69de567236c636cca9.tar.gz
Changes to make FPS work with the latest API (2010-08-28).
Diffstat (limited to 'boto/fps')
-rw-r--r--boto/fps/connection.py36
1 files changed, 16 insertions, 20 deletions
diff --git a/boto/fps/connection.py b/boto/fps/connection.py
index 3d7812ea..c57dfa0a 100644
--- a/boto/fps/connection.py
+++ b/boto/fps/connection.py
@@ -20,9 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-import base64
-import hmac
-import hashlib
import urllib
import xml.sax
import uuid
@@ -35,7 +32,7 @@ from boto.exception import FPSResponseError
class FPSConnection(AWSQueryConnection):
- APIVersion = '2007-01-08'
+ APIVersion = '2010-08-28'
def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
is_secure=True, port=None, proxy=None, proxy_port=None,
@@ -158,7 +155,7 @@ class FPSConnection(AWSQueryConnection):
return final
def pay(self, transactionAmount, senderTokenId,
- recipientTokenId=None, callerTokenId=None,
+ recipientTokenId=None,
chargeFeeTo="Recipient",
callerReference=None, senderReference=None, recipientReference=None,
senderDescription=None, recipientDescription=None, callerDescription=None,
@@ -169,20 +166,16 @@ class FPSConnection(AWSQueryConnection):
"""
params = {}
params['SenderTokenId'] = senderTokenId
- # this is for 2008-09-17 specification
- params['TransactionAmount.Amount'] = str(transactionAmount)
+ # this is for 2010-08-28 specification
+ params['TransactionAmount.Value'] = str(transactionAmount)
params['TransactionAmount.CurrencyCode'] = "USD"
- #params['TransactionAmount'] = str(transactionAmount)
params['ChargeFeeTo'] = chargeFeeTo
-
- params['RecipientTokenId'] = (
- recipientTokenId if recipientTokenId is not None
- else boto.config.get("FPS", "recipient_token")
- )
- params['CallerTokenId'] = (
- callerTokenId if callerTokenId is not None
- else boto.config.get("FPS", "caller_token")
- )
+
+ if recipientTokenId:
+ params['RecipientTokenId'] = (
+ recipientTokenId if recipientTokenId is not None
+ else boto.config.get("FPS", "recipient_token")
+ )
if(transactionDate != None):
params['TransactionDate'] = transactionDate
if(senderReference != None):
@@ -236,7 +229,7 @@ class FPSConnection(AWSQueryConnection):
Cancels a reserved or pending transaction.
"""
params = {}
- params['transactionId'] = transactionId
+ params['TransactionId'] = transactionId
if(description != None):
params['description'] = description
@@ -257,7 +250,8 @@ class FPSConnection(AWSQueryConnection):
params = {}
params['ReserveTransactionId'] = reserveTransactionId
if(transactionAmount != None):
- params['TransactionAmount'] = transactionAmount
+ params['TransactionAmount.Value'] = transactionAmount
+ params['TransactionAmount.CurrencyCode'] = "USD"
response = self.make_request("Settle", params)
body = response.read()
@@ -277,7 +271,8 @@ class FPSConnection(AWSQueryConnection):
params['CallerReference'] = callerReference
params['TransactionId'] = transactionId
if(refundAmount != None):
- params['RefundAmount'] = refundAmount
+ params['RefundAmount.Value'] = refundAmount
+ params['RefundAmount.CurrencyCode'] = "USD"
if(callerDescription != None):
params['CallerDescription'] = callerDescription
@@ -324,6 +319,7 @@ class FPSConnection(AWSQueryConnection):
return rs
else:
raise FPSResponseError(response.status, response.reason, body)
+
def get_token_by_caller_token(self, tokenId):
"""
Returns details about the token specified by 'callerReference'.