package kz.com.aman.kassa.bank;

import android.widget.Toast;

import java.util.List;

import ru.m4bank.mpos.library.external.transactions.GetCardReaderInformationCallbackHandler;
import ru.m4bank.mpos.service.data.dynamic.objects.Reader;
import ru.m4bank.mpos.service.result.GetCardReaderInformationResult;
import timber.log.Timber;

public class GetCardReaderInformationCallbackHandlerImpl implements GetCardReaderInformationCallbackHandler {
    private final M4BankActivity activity;

    public GetCardReaderInformationCallbackHandlerImpl(M4BankActivity activity) {
        this.activity = activity;
    }

    @Override
    public void onCardReaderForTransactionGettingCompleted() {

    }

    @Override
    public void onNoBoundedDevicesFound() {

    }

    @Override
    public void onConnectingProcessStarted(String deviceName) {

    }

    @Override
    public void onDisconnectedEventReceivedOrCanNotEstablishConnection(boolean reconnectAvailable, String description) {

    }

    @Override
    public void onDeviceToUseSelectionRequested(List<Reader> deviceList) {

    }

    @Override
    public void notAuthorized() {

    }

    @Override
    public void onDeviceToConnectSelectionRequested(List<String> deviceList) {

    }

    @Override
    public void onCompleted(GetCardReaderInformationResult result) {
        activity.runOnUiThread(() -> Toast.makeText(activity, result.toString(), Toast.LENGTH_LONG).show());
        Timber.d("GetCardReaderInformationResult : " + result);
    }

    @Override
    public void onWrongApiCalled() {

    }
}
