Changeset 42
- Timestamp:
- 04/15/08 21:53:17 (4 years ago)
- Location:
- trunk/fpys
- Files:
-
- 3 modified
-
client.py (modified) (3 diffs)
-
tests/client_test.py (modified) (2 diffs)
-
tests/wsgi_responder.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fpys/client.py
r41 r42 83 83 84 84 for name in ['CallerTokenId', 'SenderTokenId', 'RecipientTokenId', 'TokenId', 85 'PaymentInstruction', 'AccountId', 'TokenFriendlyName' ]:85 'PaymentInstruction', 'AccountId', 'TokenFriendlyName', 'RequestId']: 86 86 if document.find(name) is not None: 87 87 attr_name = name[0].lower() + name[1:] … … 219 219 return self.execute(params) 220 220 221 def discardResults(self): 221 def discardResults(self, transaction_ids): 222 params = {'Action': 'DiscardResults', 223 'TransactionIds': transaction_ids} 224 return self.execute(params) 225 226 def getAccountActivity(self): 222 227 pass 223 228 … … 390 395 return self.execute(params) 391 396 392 def retryTransaction(self): 393 pass 397 def retryTransaction(self, transaction_id): 398 params = {'Action': 'RetryTransaction', 399 'OriginalTransactionId': transaction_id} 400 return self.execute(params) 394 401 395 402 def settle(self, -
trunk/fpys/tests/client_test.py
r40 r42 105 105 assert response.success == False 106 106 assert response.errors[0]['errorCode'] == "InvalidParams" 107 108 def test_discardResults(): 109 """Test DiscardResults""" 110 response = fps_client.discardResults("135AHMQA9H3NEFJL73GQ33873PLPNGLQZP1") 111 assert response.success == True 107 112 108 113 def test_getPaymentInstruction(): … … 188 193 assert response.transaction.id == "134OLF7MHB2L4V9T54RHADQ9FCK5NLVZHDC" 189 194 195 # def test_retry(): 196 # response = fps_client.retryTransaction("123") 197 # assert response.success == True 198 190 199 def test_settle_over_amount(): 191 200 response = fps_client.settle("134OLF7MHB2L4V9T54RHADQ9FCK5NLVZHDC", -
trunk/fpys/tests/wsgi_responder.py
r40 r42 14 14 else: 15 15 response = """<ns0:CancelTokenResponse xmlns:ns0="http://fps.amazonaws.com/doc/2007-01-08/"><Status>Success</Status><RequestId>2a4e67a6-a499-4b3c-b9fa-efd97e117b13:0</RequestId></ns0:CancelTokenResponse>""" 16 return [response] 17 18 def DiscardResults(self, environ): 19 response = """<ns0:DiscardResultsResponse xmlns:ns0="http://fps.amazonaws.com/doc/2007-01-08/"><Status>Success</Status><RequestId>d80fd512-d5c9-4ee0-90fa-f2af1ac837a2:0</RequestId></ns0:DiscardResultsResponse>""" 16 20 return [response] 17 21 … … 79 83 return [response] 80 84 85 def RetryTransaction(self, environ): 86 response = """ """ 87 return [response] 88 81 89 def Settle(self, environ): 82 90 if environ['fps.params']['TransactionAmount.Amount'][0] == "100.00":
