use of com.stripe.model.BalanceTransactionCollection in project stripe-java by stripe.
the class BalanceTransactionTest method testBalanceTransactionRetrieval.
@Test
public void testBalanceTransactionRetrieval() throws StripeException {
Charge.create(defaultChargeParams);
BalanceTransactionCollection balanceTransactions = BalanceTransaction.all(null);
assertFalse(balanceTransactions.getData().isEmpty());
BalanceTransaction first = balanceTransactions.getData().get(0);
assertNotNull(first.getStatus());
HashMap<String, Object> fetchParams = new HashMap<String, Object>();
fetchParams.put("count", 2);
assertEquals(BalanceTransaction.all(fetchParams).getData().size(), 2);
BalanceTransaction retrieved = BalanceTransaction.retrieve(first.getId());
assertEquals(retrieved.getId(), first.getId());
assertEquals(retrieved.getSource(), first.getSource());
}
use of com.stripe.model.BalanceTransactionCollection in project stripe-java by stripe.
the class BalanceTransactionTest method testList.
@Test
public void testList() throws StripeException {
final Map<String, Object> params = new HashMap<>();
params.put("limit", 1);
final BalanceTransactionCollection balanceTransactions = BalanceTransaction.list(params);
assertNotNull(balanceTransactions);
verifyRequest(ApiResource.RequestMethod.GET, String.format("/v1/balance_transactions"), params);
}
Aggregations