Search in sources :

Example 1 with NotificationSyncRequest

use of com.fitpay.android.paymentdevice.events.NotificationSyncRequest in project fitpay-android-sdk by fitpay.

the class DeviceService method syncData.

/**
 * @param user        current user with hypermedia data
 * @param device      device object with hypermedia data
 * @param connector   payment device connector
 * @param syncRequest data provided in sync request
 * Sync data between FitPay server and payment device
 * <p>
 * This is an asynchronous operation.
 */
public void syncData(@NonNull User user, @NonNull Device device, @NonNull IPaymentDeviceConnector connector, @NonNull NotificationSyncRequest syncRequest) {
    if (null == syncRequest.getSyncInfo()) {
        FPLog.d(TAG, "NotificationSyncRequest did not contain sync info.");
    }
    if (syncManager != null) {
        SyncRequest request = new SyncRequest.Builder().setSyncId(null != syncRequest.getSyncInfo() ? syncRequest.getSyncInfo().getSyncId() : null).setUser(user).setDevice(device).setConnector(connector).setSyncInfo(syncRequest.getSyncInfo()).build();
        syncManager.add(request);
    } else {
        Log.e(TAG, "syncManager is null");
    }
}
Also used : SyncRequest(com.fitpay.android.paymentdevice.models.SyncRequest) NotificationSyncRequest(com.fitpay.android.paymentdevice.events.NotificationSyncRequest)

Example 2 with NotificationSyncRequest

use of com.fitpay.android.paymentdevice.events.NotificationSyncRequest in project fitpay-android-sdk by fitpay.

the class DeviceService method syncData.

/**
 * @param user   current user with hypermedia data
 * @param device device object with hypermedia data
 * Sync data between FitPay server and payment device
 * <p>
 * This is an asynchronous operation.
 */
public void syncData(@NonNull User user, @NonNull Device device) {
    this.user = user;
    this.device = device;
    syncData(user, device, paymentDeviceConnector, new NotificationSyncRequest());
}
Also used : NotificationSyncRequest(com.fitpay.android.paymentdevice.events.NotificationSyncRequest)

Aggregations

NotificationSyncRequest (com.fitpay.android.paymentdevice.events.NotificationSyncRequest)2 SyncRequest (com.fitpay.android.paymentdevice.models.SyncRequest)1