@@ -184,12 +184,13 @@ async def test_list_transactions(self, extend):
184
184
185
185
# Verify response structure
186
186
assert isinstance (response , dict ), "Response should be a dictionary"
187
- assert "transactions" in response , "Response should contain 'transactions ' key"
188
- assert isinstance (response ["transactions" ], list ), "Transactions should be a list"
187
+ assert "transactions" in response [ "report" ] , "Response should contain 'report ' key"
188
+ assert isinstance (response ["report" ][ " transactions" ], list ), "Transactions should be a list"
189
189
190
190
# If there are transactions, verify their structure
191
- if response ["transactions" ]:
192
- transaction = response ["transactions" ][0 ]
191
+ if response ["report" ] and response ["report" ]['transactions' ]:
192
+ transactions = response ["report" ]['transactions' ]
193
+ transaction = transactions [0 ]
193
194
required_fields = ["id" , "status" , "virtualCardId" , "merchantName" , "type" , "authBillingAmountCents" ]
194
195
for field in required_fields :
195
196
assert field in transaction , f"Transaction should contain '{ field } ' field"
@@ -216,10 +217,11 @@ async def test_list_transactions_with_sorting(self, extend):
216
217
217
218
# Verify response contains transactions and basic structure
218
219
assert isinstance (response , dict ), f"Response for sort { sort_field } should be a dictionary"
219
- assert "transactions" in response , f"Response for sort { sort_field } should contain 'transactions' key"
220
+ assert "report" in response , f"Response for sort { sort_field } should contain 'report' key"
221
+ assert "transactions" in response ["report" ], f"Report should contain 'transactions' key"
220
222
221
223
# If we have enough data, test opposite sort direction for comparison
222
- if len (response ["transactions" ]) > 1 :
224
+ if len (response ["report" ][ " transactions" ]) > 1 :
223
225
# Determine the field name and opposite sort field
224
226
is_desc = sort_field .startswith ("-" )
225
227
field_name = sort_field [1 :] if is_desc else sort_field
@@ -232,8 +234,8 @@ async def test_list_transactions_with_sorting(self, extend):
232
234
)
233
235
234
236
# Get IDs in both sort orders for comparison
235
- sorted_ids = [tx ["id" ] for tx in response ["transactions" ]]
236
- opposite_sorted_ids = [tx ["id" ] for tx in opposite_response ["transactions" ]]
237
+ sorted_ids = [tx ["id" ] for tx in response ["report" ][ " transactions" ]]
238
+ opposite_sorted_ids = [tx ["id" ] for tx in opposite_response ["report" ][ " transactions" ]]
237
239
238
240
# If we have the same set of transactions in both responses,
239
241
# verify that different sort directions produce different orders
@@ -469,8 +471,9 @@ async def test_create_receipt_attachment(self, extend):
469
471
470
472
# Retrieve a valid transaction id from existing transactions
471
473
transactions_response = await extend .transactions .get_transactions (page = 0 , per_page = 1 )
472
- assert transactions_response .get ("transactions" ), "No transactions available for testing receipt attachment"
473
- transaction_id = transactions_response ["transactions" ][0 ]["id" ]
474
+ assert transactions_response ["report" ][
475
+ "transactions" ], "No transactions available for testing receipt attachment"
476
+ transaction_id = transactions_response ["report" ]["transactions" ][0 ]["id" ]
474
477
475
478
# Call the receipt attachment upload method
476
479
response = await extend .receipt_attachments .create_receipt_attachment (
0 commit comments