use of com.stripe.model.Transfer in project stripe-java by stripe.
the class TransferTest method testTransferDestinationLoadedCorrectly.
@Test
public void testTransferDestinationLoadedCorrectly() throws StripeException {
Map<String, Object> transferParams = getTransferParams();
Transfer created = Transfer.create(transferParams);
assertEquals(transferParams.get("destination"), created.getDestination());
}
use of com.stripe.model.Transfer in project stripe-java by stripe.
the class TransferTest method testTransferCreate.
@Test
public void testTransferCreate() throws StripeException {
Map<String, Object> transferParams = getTransferParams();
Transfer createdTransfer = Transfer.create(transferParams);
assertEquals(transferParams.get("destination"), createdTransfer.getDestination());
}
use of com.stripe.model.Transfer in project stripe-java by stripe.
the class TransferTest method testTransferRetrieve.
@Test
public void testTransferRetrieve() throws StripeException {
Transfer createdTransfer = Transfer.create(getTransferParams());
Transfer retrievedTransfer = Transfer.retrieve(createdTransfer.getId());
assertEquals(createdTransfer.getDate(), retrievedTransfer.getDate());
assertEquals(createdTransfer.getId(), retrievedTransfer.getId());
}
use of com.stripe.model.Transfer in project stripe-java by stripe.
the class TransferTest method testTransferCancel.
@Test
public void testTransferCancel() throws StripeException {
Transfer created = Transfer.create(getTransferParams());
try {
// we expect an InvalidRequestException here (caught by JUnit),
// because in test mode, transfers are automatically sent.
created.cancel(RequestOptions.getDefault());
Assert.fail();
} catch (InvalidRequestException ire) {
// do nothing
}
}
use of com.stripe.model.Transfer in project stripe-java by stripe.
the class TransferTest method testTransferTransactions.
@Test
public void testTransferTransactions() throws StripeException {
Map<String, Object> transferParams = getTransferParams();
Transfer transfer = Transfer.create(transferParams);
HashMap<String, Object> params = new HashMap<String, Object>();
TransferTransactionCollection transactions = transfer.transactions(params, supportedRequestOptions);
// Test that requestOptions and requestParams are the same in returned transactions:
assertEquals(supportedRequestOptions, transactions.getRequestOptions());
assertEquals(params, transactions.getRequestParams());
}
Aggregations