Changeset 42

Show
Ignore:
Timestamp:
04/15/08 21:53:17 (4 years ago)
Author:
tim
Message:

DiscardResults? is implemented

Location:
trunk/fpys
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/fpys/client.py

    r41 r42  
    8383 
    8484        for name in ['CallerTokenId', 'SenderTokenId', 'RecipientTokenId', 'TokenId', 
    85                      'PaymentInstruction', 'AccountId', 'TokenFriendlyName']: 
     85                     'PaymentInstruction', 'AccountId', 'TokenFriendlyName', 'RequestId']: 
    8686            if document.find(name) is not None: 
    8787                attr_name = name[0].lower() + name[1:] 
     
    219219        return self.execute(params) 
    220220 
    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): 
    222227        pass 
    223228 
     
    390395        return self.execute(params) 
    391396 
    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) 
    394401 
    395402    def settle(self, 
  • trunk/fpys/tests/client_test.py

    r40 r42  
    105105    assert response.success == False 
    106106    assert response.errors[0]['errorCode'] == "InvalidParams" 
     107 
     108def test_discardResults(): 
     109    """Test DiscardResults""" 
     110    response = fps_client.discardResults("135AHMQA9H3NEFJL73GQ33873PLPNGLQZP1") 
     111    assert response.success == True 
    107112 
    108113def test_getPaymentInstruction(): 
     
    188193    assert response.transaction.id == "134OLF7MHB2L4V9T54RHADQ9FCK5NLVZHDC" 
    189194 
     195# def test_retry(): 
     196#     response = fps_client.retryTransaction("123") 
     197#     assert response.success == True 
     198 
    190199def test_settle_over_amount(): 
    191200    response = fps_client.settle("134OLF7MHB2L4V9T54RHADQ9FCK5NLVZHDC", 
  • trunk/fpys/tests/wsgi_responder.py

    r40 r42  
    1414        else: 
    1515            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>""" 
    1620        return [response] 
    1721 
     
    7983        return [response] 
    8084 
     85    def RetryTransaction(self, environ): 
     86        response = """ """ 
     87        return [response] 
     88 
    8189    def Settle(self, environ): 
    8290        if environ['fps.params']['TransactionAmount.Amount'][0] == "100.00":