use of com.fitpay.android.api.callbacks.ResultProvidingCallback in project fitpay-android-sdk by fitpay.
the class TestActions method deleteUser.
@After
public void deleteUser() throws Exception {
if (null != this.user) {
final CountDownLatch latch = new CountDownLatch(1);
ResultProvidingCallback<Void> callback = new ResultProvidingCallback<>(latch);
this.user.deleteUser(callback);
latch.await(TIMEOUT, TimeUnit.SECONDS);
}
}
use of com.fitpay.android.api.callbacks.ResultProvidingCallback in project fitpay-android-sdk by fitpay.
the class TestActions method createDevice.
protected Device createDevice(User user, Device device) throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
ResultProvidingCallback<Device> callback = new ResultProvidingCallback<>(latch);
user.createDevice(device, callback);
latch.await(TIMEOUT, TimeUnit.SECONDS);
return callback.getResult();
}
use of com.fitpay.android.api.callbacks.ResultProvidingCallback in project fitpay-android-sdk by fitpay.
the class TestActions method getCreditCards.
protected Collections.CreditCardCollection getCreditCards(User user) throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
ResultProvidingCallback<Collections.CreditCardCollection> callback = new ResultProvidingCallback<>(latch);
user.getCreditCards(10, 0, callback);
latch.await(TIMEOUT, TimeUnit.SECONDS);
assertEquals("get credit cards had error code. (message: " + callback.getErrorMessage() + ")", -1, callback.getErrorCode());
return callback.getResult();
}
use of com.fitpay.android.api.callbacks.ResultProvidingCallback in project fitpay-android-sdk by fitpay.
the class TestActions method acceptTerms.
protected CreditCard acceptTerms(CreditCard creditCard) throws Exception {
final CountDownLatch latch = new CountDownLatch(2);
ResultProvidingCallback<CreditCard> callback = new ResultProvidingCallback<>(latch);
creditCard.acceptTerms(callback);
latch.await(TIMEOUT, TimeUnit.SECONDS);
CreditCard acceptedCard = callback.getResult();
if (acceptedCard == null) {
return null;
}
TestConstants.waitSomeActionsOnServer();
// getSelf
ResultProvidingCallback<CreditCard> callbackSelf = new ResultProvidingCallback<>(latch);
acceptedCard.self(callbackSelf);
latch.await(TIMEOUT, TimeUnit.SECONDS);
return callbackSelf.getResult();
}
use of com.fitpay.android.api.callbacks.ResultProvidingCallback in project fitpay-android-sdk by fitpay.
the class TestActions method getCardTransactions.
protected Collections.TransactionCollection getCardTransactions(CreditCard card) throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
ResultProvidingCallback<Collections.TransactionCollection> callback = new ResultProvidingCallback<>(latch);
card.getTransactions(10, 0, callback);
latch.await(TIMEOUT, TimeUnit.SECONDS);
assertEquals("get device transactions error code. (message: " + callback.getErrorMessage() + ")", -1, callback.getErrorCode());
return callback.getResult();
}
Aggregations