Search in sources :

Example 1 with A2AVerificationFailed

use of com.fitpay.android.webview.events.a2a.A2AVerificationFailed in project fitpay-android-sdk by fitpay.

the class RtmParserV5 method parseMessage.

@Override
public void parseMessage(RtmMessage msg) {
    switch(msg.getType()) {
        case RtmType.ID_VERIFICATION_REQUEST:
            RxBus.getInstance().post(new IdVerificationRequest(msg.getCallbackId()));
            break;
        case RtmType.SUPPORTS_ISSUER_APP_VERIFICATION:
            RxBus.getInstance().post(new RtmMessageResponse(msg.getCallbackId(), true, new A2AIssuerAppVerification(impl.supportsAppVerification()), RtmType.SUPPORTS_ISSUER_APP_VERIFICATION));
            break;
        case RtmType.APP_TO_APP_VERIFICATION:
            if (impl.supportsAppVerification()) {
                A2AVerificationRequest appToAppVerification = Constants.getGson().fromJson(msg.getData(), A2AVerificationRequest.class);
                appToAppVerification.setCallbackId(msg.getCallbackId());
                RxBus.getInstance().post(appToAppVerification);
            } else {
                RxBus.getInstance().post(new RtmMessageResponse(msg.getCallbackId(), false, new A2AVerificationFailed(A2AVerificationError.NOT_SUPPORTED), RtmType.APP_TO_APP_VERIFICATION));
            }
            break;
        default:
            super.parseMessage(msg);
    }
}
Also used : A2AVerificationRequest(com.fitpay.android.webview.events.a2a.A2AVerificationRequest) RtmMessageResponse(com.fitpay.android.webview.events.RtmMessageResponse) A2AVerificationFailed(com.fitpay.android.webview.events.a2a.A2AVerificationFailed) IdVerificationRequest(com.fitpay.android.webview.events.IdVerificationRequest) A2AIssuerAppVerification(com.fitpay.android.webview.models.a2a.A2AIssuerAppVerification)

Aggregations

IdVerificationRequest (com.fitpay.android.webview.events.IdVerificationRequest)1 RtmMessageResponse (com.fitpay.android.webview.events.RtmMessageResponse)1 A2AVerificationFailed (com.fitpay.android.webview.events.a2a.A2AVerificationFailed)1 A2AVerificationRequest (com.fitpay.android.webview.events.a2a.A2AVerificationRequest)1 A2AIssuerAppVerification (com.fitpay.android.webview.models.a2a.A2AIssuerAppVerification)1