|
|
@ -3,28 +3,14 @@ package com.gmeremit.online.gmeremittance_native.kycV2.presenter; |
|
|
|
import com.gmeremit.online.gmeremittance_native.base.BasePresenter; |
|
|
|
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog; |
|
|
|
import com.gmeremit.online.gmeremittance_native.kycV2.gateway.KYCV2Gateway; |
|
|
|
import com.gmeremit.online.gmeremittance_native.kycV2.model.KYCRelatedDataModel; |
|
|
|
import com.gmeremit.online.gmeremittance_native.kycV2.model.KYCRelatedDataResponse; |
|
|
|
import com.gmeremit.online.gmeremittance_native.kycV2.view.view1.KYCView1VModel; |
|
|
|
import com.gmeremit.online.gmeremittance_native.kycV2.view.view2.KYCView2VModel; |
|
|
|
import com.gmeremit.online.gmeremittance_native.kycV2.view.view3.KYCView3VModel; |
|
|
|
import com.gmeremit.online.gmeremittance_native.loginV2.gateway.LoginV2Gateway; |
|
|
|
import com.gmeremit.online.gmeremittance_native.loginV2.presenter.LoginV2InteractorInterface; |
|
|
|
import com.gmeremit.online.gmeremittance_native.loginV2.presenter.LoginV2PresenterInterface; |
|
|
|
import com.gmeremit.online.gmeremittance_native.recipientV2.gateway.RecipientAddV2Gateway; |
|
|
|
import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientadd.AddRecipientApiResponse; |
|
|
|
import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientadd.CountryDetailModel; |
|
|
|
import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientadd.DistrictDetailModel; |
|
|
|
import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientadd.ProvinceDetailModel; |
|
|
|
import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientadd.RecipientRelatedDataApiResponse; |
|
|
|
import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientadd.RecipientRelatedModel; |
|
|
|
import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientadd.RelationDetailModel; |
|
|
|
import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientadd.TransferDetailModel; |
|
|
|
import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientlisting.RecipientInfoModel; |
|
|
|
import com.gmeremit.online.gmeremittance_native.registerV2.presenter.RegisterV2PresenterInterface; |
|
|
|
import com.gmeremit.online.gmeremittance_native.utils.Constants; |
|
|
|
import com.gmeremit.online.gmeremittance_native.utils.https.GenericApiObserverResponse; |
|
|
|
|
|
|
|
import io.reactivex.Observable; |
|
|
|
import io.reactivex.android.schedulers.AndroidSchedulers; |
|
|
|
import io.reactivex.disposables.CompositeDisposable; |
|
|
|
import io.reactivex.schedulers.Schedulers; |
|
|
@ -45,17 +31,17 @@ public class KYCV2Presenter extends BasePresenter implements KYCV2PresenterInter |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean validateKYCView1(KYCView1VModel data) { |
|
|
|
return false; |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean validateKYCView2(KYCView2VModel data) { |
|
|
|
return false; |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean validateKYCView3(KYCView3VModel data) { |
|
|
|
return false; |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -82,17 +68,41 @@ public class KYCV2Presenter extends BasePresenter implements KYCV2PresenterInter |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void onSuccess(KYCRelatedDataResponse kycRelatedDataResponse) { |
|
|
|
|
|
|
|
if(kycRelatedDataResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) |
|
|
|
{ |
|
|
|
KYCRelatedDataModel data=kycRelatedDataResponse.getKycRelatedDataModel(); |
|
|
|
view.getView1Contract().setKycRelatedData(data.getNativeCountry(),data.getOccupation(),data.getProvinceList()); |
|
|
|
view.getView2Contract().setKycRelatedData(data.getBank(),data.getIdType(),data.getSourceOfFund()); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
view.showPopUpMessage(kycRelatedDataResponse.getMsg(), CustomAlertDialog.AlertType.FAILED, new CustomAlertDialog.CustomDialogActionListener() { |
|
|
|
@Override |
|
|
|
public void onCutomDialogActionPressed(CustomAlertDialog.AlertType alertType) { |
|
|
|
view.exitView(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onFailed(String message) { |
|
|
|
|
|
|
|
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, new CustomAlertDialog.CustomDialogActionListener() { |
|
|
|
@Override |
|
|
|
public void onCutomDialogActionPressed(CustomAlertDialog.AlertType alertType) { |
|
|
|
view.exitView(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void onConnectionNotEstablished(String message) { |
|
|
|
|
|
|
|
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, new CustomAlertDialog.CustomDialogActionListener() { |
|
|
|
@Override |
|
|
|
public void onCutomDialogActionPressed(CustomAlertDialog.AlertType alertType) { |
|
|
|
view.exitView(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |