Search in sources :

Example 1 with PaymentDevice

use of com.fitpay.android.api.models.device.PaymentDevice in project fitpay-android-sdk by fitpay.

the class Steps method getPaymentDevice.

public void getPaymentDevice() throws InterruptedException {
    Assert.assertNotNull(currentUser);
    final CountDownLatch latch = new CountDownLatch(1);
    currentUser.getPaymentDevice(new ApiCallback<Device>() {

        @Override
        public void onSuccess(Device result) {
            paymentDevice = result;
            latch.countDown();
        }

        @Override
        public void onFailure(@ResultCode.Code int errorCode, String errorMessage) {
            latch.countDown();
        }
    });
    latch.await(TIMEOUT, TimeUnit.SECONDS);
    Assert.assertNotNull("paymentDevice should not be null", paymentDevice);
}
Also used : PaymentDevice(com.fitpay.android.api.models.device.PaymentDevice) Device(com.fitpay.android.api.models.device.Device) CountDownLatch(java.util.concurrent.CountDownLatch)

Aggregations

Device (com.fitpay.android.api.models.device.Device)1 PaymentDevice (com.fitpay.android.api.models.device.PaymentDevice)1 CountDownLatch (java.util.concurrent.CountDownLatch)1