package kz.com.aman.kassa.bank;

import android.widget.Toast;

import ru.m4bank.mpos.library.external.configuration.SendRegisterRequestCallbackHandler;
import ru.m4bank.mpos.service.result.SendRegisterRequestExternalResult;

public class SendRegisterRequestCallbackHandlerImpl implements SendRegisterRequestCallbackHandler {
    private final M4BankActivity activity;

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

    @Override
    public void onCompleted(SendRegisterRequestExternalResult result) {
        activity.runOnUiThread(() -> Toast.makeText(activity, result.getResultType() + " " + result.getRequestCode() + " " + result.getStatus(), Toast.LENGTH_SHORT).show());
    }

    @Override
    public void onWrongApiCalled() {
        activity.runOnUiThread(() -> Toast.makeText(activity, "Wrong method has been called", Toast.LENGTH_SHORT).show());
    }
}
