|
@ -4,6 +4,7 @@ import com.gmeremit.online.gmeremittance_native.R; |
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.model.accountlisting.AutoDebitAccount; |
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.model.accountlisting.AutoDebitAccount; |
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.model.accountlisting.InboundAccount; |
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.model.accountlisting.InboundAccount; |
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.model.accountlisting.KoreanBankDTO; |
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.model.accountlisting.KoreanBankDTO; |
|
|
|
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.model.bankaccountvalidation.BankInfo; |
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.model.inboundaccountmanage.InboundAccountAddRequestBody; |
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.model.inboundaccountmanage.InboundAccountAddRequestBody; |
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.view.inboundaccountmanage.InboundAddAccountConfirmFragment; |
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.view.inboundaccountmanage.InboundAddAccountConfirmFragment; |
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.view.inboundaccountmanage.InboundAddAccountPennyTestFragment; |
|
|
import com.gmeremit.online.gmeremittance_native.accountmanage.view.inboundaccountmanage.InboundAddAccountPennyTestFragment; |
|
@ -32,7 +33,7 @@ public class InboundAccountAddV2Presenter extends BasePresenter implements Inbou |
|
|
private final InboundAccountAddV2InteractorInterface.InboundAccountAddV2GatewayInterface gateway; |
|
|
private final InboundAccountAddV2InteractorInterface.InboundAccountAddV2GatewayInterface gateway; |
|
|
private final CompositeDisposable compositeDisposable; |
|
|
private final CompositeDisposable compositeDisposable; |
|
|
private InboundAccountAddRequestBody pennyTestRequestBody; |
|
|
private InboundAccountAddRequestBody pennyTestRequestBody; |
|
|
private List<KoreanBankDTO> availableKoreanBankList; |
|
|
|
|
|
|
|
|
private List<BankInfo> availableKoreanBankList; |
|
|
private BehaviorSubject<InboundAddAccountConfirmFragment.InboundAddAccountViewDTO> addAcountDataSubject; |
|
|
private BehaviorSubject<InboundAddAccountConfirmFragment.InboundAddAccountViewDTO> addAcountDataSubject; |
|
|
private BehaviorSubject<InboundAddAccountPennyTestFragment.InboundPennyTestViewDTO> pennyTestDataSubject; |
|
|
private BehaviorSubject<InboundAddAccountPennyTestFragment.InboundPennyTestViewDTO> pennyTestDataSubject; |
|
|
|
|
|
|
|
@ -105,12 +106,12 @@ public class InboundAccountAddV2Presenter extends BasePresenter implements Inbou |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<KoreanBankDTO> getKoreanBankList() { |
|
|
|
|
|
|
|
|
public List<BankInfo> getKoreanBankList() { |
|
|
return availableKoreanBankList; |
|
|
return availableKoreanBankList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void updateBank(KoreanBankDTO selectedBank) { |
|
|
|
|
|
|
|
|
public void updateBank(BankInfo selectedBank) { |
|
|
this.pennyTestRequestBody.setBankName(selectedBank.getBankName()); |
|
|
this.pennyTestRequestBody.setBankName(selectedBank.getBankName()); |
|
|
this.pennyTestRequestBody.setBankCode(selectedBank.getBankCode()); |
|
|
this.pennyTestRequestBody.setBankCode(selectedBank.getBankCode()); |
|
|
validateForm1(); |
|
|
validateForm1(); |
|
@ -157,7 +158,7 @@ public class InboundAccountAddV2Presenter extends BasePresenter implements Inbou |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void onBankDetailValidated() { |
|
|
public void onBankDetailValidated() { |
|
|
requestForPennyTest("Y"); |
|
|
|
|
|
|
|
|
requestForPennyTest("N"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public class PennyTestRequestObserver extends GenericApiObserverResponseV2<MessageResponseDataModel> { |
|
|
public class PennyTestRequestObserver extends GenericApiObserverResponseV2<MessageResponseDataModel> { |
|
@ -166,7 +167,7 @@ public class InboundAccountAddV2Presenter extends BasePresenter implements Inbou |
|
|
protected void onSuccess(GenericResponseDataModel<MessageResponseDataModel> t) { |
|
|
protected void onSuccess(GenericResponseDataModel<MessageResponseDataModel> t) { |
|
|
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { |
|
|
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { |
|
|
InboundAddAccountPennyTestFragment.InboundPennyTestViewDTO pennyTestViewDTO = new InboundAddAccountPennyTestFragment.InboundPennyTestViewDTO(pennyTestRequestBody.getBankName(), pennyTestRequestBody.getBankCode(), pennyTestRequestBody.getAccountNo(), getStringfromStringId(R.string.pennytest_information_text)); |
|
|
InboundAddAccountPennyTestFragment.InboundPennyTestViewDTO pennyTestViewDTO = new InboundAddAccountPennyTestFragment.InboundPennyTestViewDTO(pennyTestRequestBody.getBankName(), pennyTestRequestBody.getBankCode(), pennyTestRequestBody.getAccountNo(), getStringfromStringId(R.string.pennytest_information_text)); |
|
|
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.SUCCESS, alertType -> { |
|
|
|
|
|
|
|
|
view.showPopUpMessage(getStringfromStringId(R.string.pennytest_information_text), CustomAlertDialog.AlertType.SUCCESS, alertType -> { |
|
|
pennyTestDataSubject.onNext(pennyTestViewDTO); |
|
|
pennyTestDataSubject.onNext(pennyTestViewDTO); |
|
|
view.showPennyTestScreen(); |
|
|
view.showPennyTestScreen(); |
|
|
}); |
|
|
}); |
|
@ -220,16 +221,16 @@ public class InboundAccountAddV2Presenter extends BasePresenter implements Inbou |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public class KoreanBankListObserver extends GenericApiObserverResponseV2<List<KoreanBankDTO>> { |
|
|
|
|
|
|
|
|
public class KoreanBankListObserver extends GenericApiObserverResponseV2<List<BankInfo>> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected Type getDataType() { |
|
|
protected Type getDataType() { |
|
|
return TypeToken.getParameterized(List.class, KoreanBankDTO.class).getType(); |
|
|
|
|
|
|
|
|
return TypeToken.getParameterized(List.class, BankInfo.class).getType(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected void onSuccess(GenericResponseDataModel<List<KoreanBankDTO>> t) { |
|
|
|
|
|
|
|
|
protected void onSuccess(GenericResponseDataModel<List<BankInfo>> t) { |
|
|
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { |
|
|
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { |
|
|
availableKoreanBankList = t.getData(); |
|
|
availableKoreanBankList = t.getData(); |
|
|
} else { |
|
|
} else { |
|
|