- Timestamp:
- 04/16/08 23:54:32 (4 years ago)
- Location:
- trunk/fpys
- Files:
-
- 3 modified
-
client.py (modified) (2 diffs)
-
tests/client_test.py (modified) (11 diffs)
-
tests/wsgi_responder.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fpys/client.py
r44 r46 23 23 return 0 24 24 25 class Token(object): 26 def __init__(self, document=None): 27 if document is not None: 28 document = ET.ElementTree(document) 29 self.document = document 30 31 for name in ['TokenId', 'FriendlyName', 'Status', 32 'DateInstalled', 'CallerInstalled', 33 'CallerReference', 'TokenType', 34 'OldTokenId']: 35 if document.find(name) is not None: 36 attr_name = name[0].lower() + name[1:] 37 setattr(self, attr_name, document.find(name).text) 38 39 if hasattr(self, 'dateInstalled'): 40 # TODO this is a little less than ideal 41 # we truncate the milliseconds and time zone info 42 di = self.dateInstalled 43 di = di[0:di.find(".")] 44 self.dateInstalled = datetime.strptime(di, 45 "%Y-%m-%dT%H:%M:%S") 46 47 class Transaction(object): 48 def __init__(self, transaction_element): 49 for element in transaction_element.getchildren(): 50 attr_name = element.tag[0].lower() + element.tag[1:] 51 setattr(self, attr_name, element.text) 52 53 class TransactionResponse(object): 54 def __init__(self, id=None, status=None): 55 self.id = id 56 self.status = status 25 def attr_name_from_tag(tag_name): 26 # some tag names have an XML namespace that we 27 # aren't really concerned with. This strips them: 28 tag_name = tag_name[tag_name.find("}")+1:] 29 # Then we lowercase the first letter 30 return tag_name[0].lower() + tag_name[1:] 57 31 58 32 class FPSResponse(object): 59 def __init__(self, document=None): 60 if document is not None: 61 document = ET.ElementTree(document) 62 log.debug(ET.tostring(document.getroot())) 63 self.document = document 64 65 if document.find("RequestId"): 66 self.requestId = document.find("RequestId").text 67 elif document.find("RequestID"): 68 self.requestId = document.find("RequestID").text 69 70 if document.find("Status") is not None: 71 if document.find("Status").text == "Success": 72 self.success = True 33 def __init__(self, element=None): 34 if element is not None: 35 if isinstance(element, str): 36 element = ET.fromstring(element) 37 self.element = element 38 39 for child in element.getchildren(): 40 if len(child.getchildren()) ==0: 41 value = child.text 42 if child.tag.find("Date") >= 0: 43 # TODO this is a little less than ideal 44 # we truncate the milliseconds and time zone info 45 value = value[0:value.find(".")] 46 value = datetime.strptime(value, 47 "%Y-%m-%dT%H:%M:%S") 48 if child.tag == "Amount": 49 value = float(child.text) 50 if child.tag.find("Size") >= 0: 51 value = int(child.text) 52 setattr(self, attr_name_from_tag(child.tag), value) 73 53 else: 74 self.success = False 75 self.errors = [] 76 77 for error in document.findall("//Errors/Errors"): 78 err = {} 79 err['type'] = error.find("ErrorType").text 80 err['retriable'] = error.find("IsRetriable").text 81 if err['retriable'] == "False": 82 err['retriable'] = False 83 else: 84 err['retriable'] = True 85 err['errorCode'] = error.find("ErrorCode").text 86 err['reason'] = error.find("ReasonText").text 87 self.errors.append(err) 88 89 90 for name in ['CallerTokenId', 'SenderTokenId', 'RecipientTokenId', 'TokenId', 91 'PaymentInstruction', 'AccountId', 'TokenFriendlyName', 'RequestId']: 92 if document.find(name) is not None: 93 attr_name = name[0].lower() + name[1:] 94 setattr(self, attr_name, document.find(name).text) 95 96 if document.find("Token"): 97 self.token = Token(document.find("Token")) 98 99 if document.find("Transaction"): 100 self.transaction = Transaction(document.find("Transaction")) 101 102 if document.find("AccountBalance"): 103 self.balances = {} 104 for bal in ['TotalBalance', 'PendingInBalance', 'PendingOutBalance', 105 'DisburseBalance', 'RefundBalance']: 106 self.balances[bal] = (float(document.find("//" + bal).find("Amount").text), 107 document.find("//" + bal).find("CurrencyCode").text) 108 109 # Hackish at best... 110 root_tag = document.getroot().tag 111 for tag_name in ["PayResponse", "RefundResponse", "ReserveResponse", 112 "RetryTransactionResponse", "SettleResponse"]: 113 if self.success and root_tag.find(tag_name) >= 0: 114 self.transaction = TransactionResponse() 115 self.transaction.id = document.find("//TransactionId").text 116 self.transaction.status = document.find("//Status").text 117 54 if child.tag == "Errors" and child.getchildren()[0].tag == "Errors": 55 self.errors = [] 56 for e in child.getchildren(): 57 self.errors.append(FPSResponse(e)) 58 elif child.tag =="Transactions": 59 if not hasattr(self, "transactions"): 60 self.transactions = [] 61 self.transactions.append(FPSResponse(child)) 62 else: 63 setattr(self, attr_name_from_tag(child.tag), FPSResponse(child)) 64 65 if hasattr(self, "status"): 66 self.success = (self.status == "Success") 67 if hasattr(self, "transactionResponse"): 68 setattr(self, "transaction", self.transactionResponse) 69 delattr(self, "transactionResponse") 118 70 119 71 class FlexiblePaymentClient(object): … … 234 186 return self.execute(params) 235 187 236 def getAccountActivity(self): 237 pass 188 def getAccountActivity(self, start_date, end_date=None, 189 operation=None, payment_method=None, 190 max_batch_size=None, response_group="Detail", 191 sort_order="Descending", role=None, 192 status=None): 193 params = {'Action': 'GetAccountActivity', 194 'StartDate': start_date, 195 'ResponseGroup': response_group, 196 'SortOrderByDate': sort_order, 197 } 198 # TODO 199 # these blocks of if statements sprinkled throughout 200 # the client strike me as ugly 201 if end_date is not None: 202 params['EndDate'] = end_date 203 if operation is not None: 204 params['Operation'] = operation 205 if max_batch_size is not None: 206 params['MaxBatchSize'] = max_batch_size 207 if role is not None: 208 params['Role'] = role 209 if status is not None: 210 params['Status'] = status 211 212 return self.execute(params) 238 213 239 214 def getAccountBalance(self): -
trunk/fpys/tests/client_test.py
r44 r46 46 46 def test_getAccountBalance(): 47 47 response = fps_client.getAccountBalance() 48 assert 16.5 == response. balances['TotalBalance'][0]48 assert 16.5 == response.accountBalance.totalBalance.amount 49 49 50 50 # def test_getDebtBalance(): … … 78 78 assert response.success == False 79 79 assert len(response.errors) == 1 80 assert response.errors[0] ['errorCode']== "DuplicateRequest"80 assert response.errors[0].errorCode == "DuplicateRequest" 81 81 82 82 def test_installPaymentInstructionInvalid(): … … 90 90 assert response.success == False 91 91 assert len(response.errors) == 2 92 assert response.errors[0] ['reason'].startswith("Parse errors")92 assert response.errors[0].reasonText.startswith("Parse errors") 93 93 94 94 … … 104 104 response = fps_client.cancelToken(token_id) 105 105 assert response.success == False 106 assert response.errors[0] ['errorCode']== "InvalidParams"106 assert response.errors[0].errorCode == "InvalidParams" 107 107 108 108 def test_discardResults(): … … 110 110 response = fps_client.discardResults("135AHMQA9H3NEFJL73GQ33873PLPNGLQZP1") 111 111 assert response.success == True 112 113 def test_getAccountActivity(): 114 response = fps_client.getAccountActivity("2008-04-13") 115 assert response.success == True 116 assert response.responseBatchSize == 8 117 trans = response.transactions[0] 118 assert trans.transactionParts.feePaid.amount == 0.0 119 assert trans.callerTokenId == "Z34XMGF4GCILGV7EV2D45DDO4Q6WXEJZ9175UNR5I9LFEC1H8MMX3R6NBJUJH8MQ" 120 assert trans.operation == "Pay" 121 assert trans.dateReceived.month == 4 112 122 113 123 def test_getPaymentInstruction(): … … 144 154 response = fps_client.getTokenUsage("Z74XLGQ4GSIKGV2ES2DQ5GDOCQZWXIJV9195JNRZIVLFSC1H84M33RDN3JUGHFM5") 145 155 assert response.success == False 146 assert response.errors[0] ['errorCode']== 'InvalidTokenType'156 assert response.errors[0].errorCode == 'InvalidTokenType' 147 157 148 158 def test_getTokenUsageUnrestricted(): … … 172 182 caller_reference="FPeS Invoice 37") 173 183 assert response.success == True 174 assert response.transaction. id == "133I77HJS56JVM7M54OZIRITRVLUT5F227U"184 assert response.transaction.transactionId == "133I77HJS56JVM7M54OZIRITRVLUT5F227U" 175 185 assert response.transaction.status == "Initiated" 176 186 … … 189 199 assert response.success == True 190 200 assert response.transaction.status == "Initiated" 191 assert response.transaction. id == "134P2CRSN5JFN3KDV3RKPKVQ3OG4H67PPR8"201 assert response.transaction.transactionId == "134P2CRSN5JFN3KDV3RKPKVQ3OG4H67PPR8" 192 202 193 203 def test_reserve(): … … 199 209 assert response.success == True 200 210 assert response.transaction.status == "Initiated" 201 assert response.transaction. id == "134OLF7MHB2L4V9T54RHADQ9FCK5NLVZHDC"211 assert response.transaction.transactionId == "134OLF7MHB2L4V9T54RHADQ9FCK5NLVZHDC" 202 212 203 213 def test_retry(): … … 211 221 assert response.success == False 212 222 assert 1 == len(response.errors) 213 assert response.errors[0] ['errorCode']== 'SettleAmountGreaterThanReserveAmount'223 assert response.errors[0].errorCode == 'SettleAmountGreaterThanReserveAmount' 214 224 215 225 def test_settle(): … … 217 227 "19.95") 218 228 assert response.success == True 219 assert response.transaction. id == "134OLF7MHB2L4V9T54RHADQ9FCK5NLVZHDC"220 assert response.transaction.status == "Initiated" 221 222 229 assert response.transaction.transactionId == "134OLF7MHB2L4V9T54RHADQ9FCK5NLVZHDC" 230 assert response.transaction.status == "Initiated" 231 232 -
trunk/fpys/tests/wsgi_responder.py
r44 r46 18 18 def DiscardResults(self, environ): 19 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>""" 20 return [response] 21 22 def GetAccountActivity(self, environ): 23 response = """<ns0:GetAccountActivityResponse xmlns:ns0="http://fps.amazonaws.com/doc/2007-01-08/"><ResponseBatchSize>8</ResponseBatchSize><Transactions><TransactionId>135AHMQA9H3NEFJL73GQ33873PLPNGLQZP1</TransactionId><CallerTransactionDate>2008-04-15T19:43:01.000-07:00</CallerTransactionDate><DateReceived>2008-04-15T19:41:09.000-07:00</DateReceived><DateCompleted>2008-04-15T19:41:10.000-07:00</DateCompleted><TransactionAmount><CurrencyCode>USD</CurrencyCode><Amount>1.000000</Amount></TransactionAmount><Operation>Pay</Operation><Status>Success</Status><ErrorCode /><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Recipient</Role><Name>Timothy P. Freund</Name><Reference /><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></FeePaid></TransactionParts><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Caller</Role><Name>Timothy P. Freund</Name><Reference>FPeS Invoice #10</Reference><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.000000</Amount></FeePaid></TransactionParts><PaymentMethod>CC</PaymentMethod><SenderName>Kate M DeHaven</SenderName><CallerName>Timothy P. Freund</CallerName><RecipientName>Timothy P. Freund</RecipientName><Fees><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></Fees><Balance><CurrencyCode>USD</CurrencyCode><Amount>32.000000</Amount></Balance><CallerTokenId>Z34XMGF4GCILGV7EV2D45DDO4Q6WXEJZ9175UNR5I9LFEC1H8MMX3R6NBJUJH8MQ</CallerTokenId><SenderTokenId>2446UQQZ1KJ6RPCB7CM774RH1TCAP7GA2VU9ATJ345N7JFGLXLEP3Y2HTDBRXRGR</SenderTokenId><RecipientTokenId>ZS4X4GK4GDIFGVDED2DF54DOTQAWX8JC91I5UNR7I4LFFCUH8KM53RKNDJUMHFM3</RecipientTokenId></Transactions><Transactions><TransactionId>135AHMQA9H3NEFJL73GQ33873PLPNGLQZP1</TransactionId><CallerTransactionDate>2008-04-15T19:43:01.000-07:00</CallerTransactionDate><DateReceived>2008-04-15T19:41:09.000-07:00</DateReceived><DateCompleted>2008-04-15T19:41:10.000-07:00</DateCompleted><TransactionAmount><CurrencyCode>USD</CurrencyCode><Amount>1.000000</Amount></TransactionAmount><Operation>Pay</Operation><Status>Initiated</Status><ErrorCode /><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Recipient</Role><Name>Timothy P. Freund</Name><Reference /><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></FeePaid></TransactionParts><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Caller</Role><Name>Timothy P. Freund</Name><Reference>FPeS Invoice #10</Reference><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.000000</Amount></FeePaid></TransactionParts><PaymentMethod>CC</PaymentMethod><SenderName>Kate M DeHaven</SenderName><CallerName>Timothy P. Freund</CallerName><RecipientName>Timothy P. Freund</RecipientName><Fees><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></Fees><Balance><CurrencyCode>USD</CurrencyCode><Amount>31.100000</Amount></Balance><CallerTokenId>Z34XMGF4GCILGV7EV2D45DDO4Q6WXEJZ9175UNR5I9LFEC1H8MMX3R6NBJUJH8MQ</CallerTokenId><SenderTokenId>2446UQQZ1KJ6RPCB7CM774RH1TCAP7GA2VU9ATJ345N7JFGLXLEP3Y2HTDBRXRGR</SenderTokenId><RecipientTokenId>ZS4X4GK4GDIFGVDED2DF54DOTQAWX8JC91I5UNR7I4LFFCUH8KM53RKNDJUMHFM3</RecipientTokenId></Transactions><Transactions><TransactionId>135AHLZE376U9LN9H5U51LUNOFHZD93243A</TransactionId><CallerTransactionDate>2008-04-15T19:42:02.000-07:00</CallerTransactionDate><DateReceived>2008-04-15T19:40:10.000-07:00</DateReceived><DateCompleted>2008-04-15T19:40:11.000-07:00</DateCompleted><TransactionAmount><CurrencyCode>USD</CurrencyCode><Amount>1.000000</Amount></TransactionAmount><Operation>Pay</Operation><Status>Success</Status><ErrorCode /><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Caller</Role><Name>Timothy P. Freund</Name><Reference>FPeS Invoice #9</Reference><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.000000</Amount></FeePaid></TransactionParts><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Recipient</Role><Name>Timothy P. Freund</Name><Reference /><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></FeePaid></TransactionParts><PaymentMethod>CC</PaymentMethod><SenderName>Kate M DeHaven</SenderName><CallerName>Timothy P. Freund</CallerName><RecipientName>Timothy P. Freund</RecipientName><Fees><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></Fees><Balance><CurrencyCode>USD</CurrencyCode><Amount>31.100000</Amount></Balance><CallerTokenId>Z34XMGF4GCILGV7EV2D45DDO4Q6WXEJZ9175UNR5I9LFEC1H8MMX3R6NBJUJH8MQ</CallerTokenId><SenderTokenId>2S46PQMZ1GJERPPBPCM47KRHETFAPJG42VR9UTJ34DN7SF3LXLEV3Y2HIDBEXXGQ</SenderTokenId><RecipientTokenId>Z64XUGL4G8IQGV3EE2DB5NDOAQSWXUJ591G5JNRAIPLF9C4H8PMM3RLNBJUTHEMF</RecipientTokenId></Transactions><Transactions><TransactionId>135AHLZE376U9LN9H5U51LUNOFHZD93243A</TransactionId><CallerTransactionDate>2008-04-15T19:42:02.000-07:00</CallerTransactionDate><DateReceived>2008-04-15T19:40:10.000-07:00</DateReceived><DateCompleted>2008-04-15T19:40:10.000-07:00</DateCompleted><TransactionAmount><CurrencyCode>USD</CurrencyCode><Amount>1.000000</Amount></TransactionAmount><Operation>Pay</Operation><Status>Initiated</Status><ErrorCode /><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Recipient</Role><Name>Timothy P. Freund</Name><Reference /><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></FeePaid></TransactionParts><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Caller</Role><Name>Timothy P. Freund</Name><Reference>FPeS Invoice #9</Reference><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.000000</Amount></FeePaid></TransactionParts><PaymentMethod>CC</PaymentMethod><SenderName>Kate M DeHaven</SenderName><CallerName>Timothy P. Freund</CallerName><RecipientName>Timothy P. Freund</RecipientName><Fees><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></Fees><Balance><CurrencyCode>USD</CurrencyCode><Amount>30.200000</Amount></Balance><CallerTokenId>Z34XMGF4GCILGV7EV2D45DDO4Q6WXEJZ9175UNR5I9LFEC1H8MMX3R6NBJUJH8MQ</CallerTokenId><SenderTokenId>2S46PQMZ1GJERPPBPCM47KRHETFAPJG42VR9UTJ34DN7SF3LXLEV3Y2HIDBEXXGQ</SenderTokenId><RecipientTokenId>Z64XUGL4G8IQGV3EE2DB5NDOAQSWXUJ591G5JNRAIPLF9C4H8PMM3RLNBJUTHEMF</RecipientTokenId></Transactions><Transactions><TransactionId>135AGBRAU5BK1UG76DOTQVT7T7E9O521PNP</TransactionId><CallerTransactionDate>2008-04-15T19:19:33.000-07:00</CallerTransactionDate><DateReceived>2008-04-15T19:17:41.000-07:00</DateReceived><DateCompleted>2008-04-15T19:17:42.000-07:00</DateCompleted><TransactionAmount><CurrencyCode>USD</CurrencyCode><Amount>1.000000</Amount></TransactionAmount><Operation>Pay</Operation><Status>Success</Status><ErrorCode /><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Caller</Role><Name>Timothy P. Freund</Name><Reference>FPeS Invoice #8</Reference><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.000000</Amount></FeePaid></TransactionParts><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Recipient</Role><Name>Timothy P. Freund</Name><Reference /><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></FeePaid></TransactionParts><PaymentMethod>CC</PaymentMethod><SenderName>Kate M DeHaven</SenderName><CallerName>Timothy P. Freund</CallerName><RecipientName>Timothy P. Freund</RecipientName><Fees><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></Fees><Balance><CurrencyCode>USD</CurrencyCode><Amount>30.200000</Amount></Balance><CallerTokenId>Z34XMGF4GCILGV7EV2D45DDO4Q6WXEJZ9175UNR5I9LFEC1H8MMX3R6NBJUJH8MQ</CallerTokenId><SenderTokenId>2646UQHZ1SJTRPPBRCM97GRH3TKAPAG22VA9BTJ64BN7RF9LXEEV3Y8H9DBTXUGQ</SenderTokenId><RecipientTokenId>Z24XLGL4G3IPGVKEB2DC5KDO4Q8WX6JZ91T5HNRIIPLFUCUH8RMU3RDNUJUCHSMT</RecipientTokenId></Transactions><Transactions><TransactionId>135AGBRAU5BK1UG76DOTQVT7T7E9O521PNP</TransactionId><CallerTransactionDate>2008-04-15T19:19:33.000-07:00</CallerTransactionDate><DateReceived>2008-04-15T19:17:41.000-07:00</DateReceived><DateCompleted>2008-04-15T19:17:42.000-07:00</DateCompleted><TransactionAmount><CurrencyCode>USD</CurrencyCode><Amount>1.000000</Amount></TransactionAmount><Operation>Pay</Operation><Status>Initiated</Status><ErrorCode /><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Caller</Role><Name>Timothy P. Freund</Name><Reference>FPeS Invoice #8</Reference><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.000000</Amount></FeePaid></TransactionParts><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Recipient</Role><Name>Timothy P. Freund</Name><Reference /><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></FeePaid></TransactionParts><PaymentMethod>CC</PaymentMethod><SenderName>Kate M DeHaven</SenderName><CallerName>Timothy P. Freund</CallerName><RecipientName>Timothy P. Freund</RecipientName><Fees><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></Fees><Balance><CurrencyCode>USD</CurrencyCode><Amount>29.300000</Amount></Balance><CallerTokenId>Z34XMGF4GCILGV7EV2D45DDO4Q6WXEJZ9175UNR5I9LFEC1H8MMX3R6NBJUJH8MQ</CallerTokenId><SenderTokenId>2646UQHZ1SJTRPPBRCM97GRH3TKAPAG22VA9BTJ64BN7RF9LXEEV3Y8H9DBTXUGQ</SenderTokenId><RecipientTokenId>Z24XLGL4G3IPGVKEB2DC5KDO4Q8WX6JZ91T5HNRIIPLFUCUH8RMU3RDNUJUCHSMT</RecipientTokenId></Transactions><Transactions><TransactionId>135AG22NH61N3AKG7OQVRIRK3PB17338IRE</TransactionId><CallerTransactionDate>2008-04-15T19:15:00.000-07:00</CallerTransactionDate><DateReceived>2008-04-15T19:12:21.000-07:00</DateReceived><DateCompleted>2008-04-15T19:12:22.000-07:00</DateCompleted><TransactionAmount><CurrencyCode>USD</CurrencyCode><Amount>1.000000</Amount></TransactionAmount><Operation>Pay</Operation><Status>Success</Status><ErrorCode /><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Recipient</Role><Name>Timothy P. Freund</Name><Reference /><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></FeePaid></TransactionParts><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Caller</Role><Name>Timothy P. Freund</Name><Reference>FPeS Invoice #41</Reference><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.000000</Amount></FeePaid></TransactionParts><PaymentMethod>CC</PaymentMethod><SenderName>Kate M DeHaven</SenderName><CallerName>Timothy P. Freund</CallerName><RecipientName>Timothy P. Freund</RecipientName><Fees><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></Fees><Balance><CurrencyCode>USD</CurrencyCode><Amount>29.300000</Amount></Balance><CallerTokenId>Z34XMGF4GCILGV7EV2D45DDO4Q6WXEJZ9175UNR5I9LFEC1H8MMX3R6NBJUJH8MQ</CallerTokenId><SenderTokenId>2646RQUZ1EJIRPBB1CMU74RHAT9AP5G32VG9DTJQ47N7JFSLXGE53YFH3DBDXLGG</SenderTokenId><RecipientTokenId>Z74X7GZ4G7ILGVIEC2DA5SDOTQCWX6J491D5BNR7IQLF7CAH8NMB3RZNIJUJHJME</RecipientTokenId></Transactions><Transactions><TransactionId>135AG22NH61N3AKG7OQVRIRK3PB17338IRE</TransactionId><CallerTransactionDate>2008-04-15T19:15:00.000-07:00</CallerTransactionDate><DateReceived>2008-04-15T19:12:21.000-07:00</DateReceived><DateCompleted>2008-04-15T19:12:21.000-07:00</DateCompleted><TransactionAmount><CurrencyCode>USD</CurrencyCode><Amount>1.000000</Amount></TransactionAmount><Operation>Pay</Operation><Status>Initiated</Status><ErrorCode /><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Caller</Role><Name>Timothy P. Freund</Name><Reference>FPeS Invoice #41</Reference><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.000000</Amount></FeePaid></TransactionParts><TransactionParts><AccountId>JMXHWUQJONDR53DM28EHVCGFILGI4RGNX541Z9</AccountId><Role>Recipient</Role><Name>Timothy P. Freund</Name><Reference /><Description /><FeePaid><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></FeePaid></TransactionParts><PaymentMethod>CC</PaymentMethod><SenderName>Kate M DeHaven</SenderName><CallerName>Timothy P. Freund</CallerName><RecipientName>Timothy P. Freund</RecipientName><Fees><CurrencyCode>USD</CurrencyCode><Amount>0.100000</Amount></Fees><Balance><CurrencyCode>USD</CurrencyCode><Amount>28.400000</Amount></Balance><CallerTokenId>Z34XMGF4GCILGV7EV2D45DDO4Q6WXEJZ9175UNR5I9LFEC1H8MMX3R6NBJUJH8MQ</CallerTokenId><SenderTokenId>2646RQUZ1EJIRPBB1CMU74RHAT9AP5G32VG9DTJQ47N7JFSLXGE53YFH3DBDXLGG</SenderTokenId><RecipientTokenId>Z74X7GZ4G7ILGVIEC2DA5SDOTQCWX6J491D5BNR7IQLF7CAH8NMB3RZNIJUJHJME</RecipientTokenId></Transactions><Status>Success</Status><RequestId>04e90391-43f1-4607-a09e-b2e3ee0121b2:0</RequestId></ns0:GetAccountActivityResponse>""" 20 24 return [response] 21 25 … … 105 109 response_headers = [('Content-type', 'text/plain')] 106 110 start_response(status, response_headers) 107 print "intercepted"108 111 print environ 109 112
