|
@ -63,16 +63,8 @@ public class RecipientEditV3Presenter extends RecipientAddEditBaseV3Presenter im |
|
|
@Override |
|
|
@Override |
|
|
public void onCountryServiceSelected(CountryServiceModel selectedCountry) { |
|
|
public void onCountryServiceSelected(CountryServiceModel selectedCountry) { |
|
|
|
|
|
|
|
|
// validator.updateSelectedCountryServiceData(selectedCountry); |
|
|
|
|
|
// |
|
|
|
|
|
// view.updateValueToWidgetSelectedCountry(selectedCountry.getCountryName()); |
|
|
|
|
|
// view.showSelectedCountryFlag(CountryFlagMapper.getFlagFromCountryCode(selectedCountry.getCountryCode())); |
|
|
|
|
|
// |
|
|
|
|
|
// this.showMobilePrefixAndFlag(selectedCountry.getCountryCode()); |
|
|
|
|
|
// |
|
|
|
|
|
// flushCountryRelatedDataOnCountryServiceSelected(); |
|
|
|
|
|
|
|
|
|
|
|
flushCountryRelatedDataOnCountryServiceSelected(); |
|
|
|
|
|
|
|
|
validator.getRecipientDetail().updateSelectedCountry(validator.getSelectedCountryServiceData()); |
|
|
|
|
|
|
|
|
validator.updateSelectedCountryServiceData(selectedCountry); |
|
|
validator.updateSelectedCountryServiceData(selectedCountry); |
|
|
|
|
|
|
|
@ -95,23 +87,10 @@ public class RecipientEditV3Presenter extends RecipientAddEditBaseV3Presenter im |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void onServiceTypeSelected(ServiceTypeModel selectedServiceType) { |
|
|
public void onServiceTypeSelected(ServiceTypeModel selectedServiceType) { |
|
|
// validator.getRecipientDetail().updateSelectedCountry(validator.getSelectedCountryServiceData()); |
|
|
|
|
|
// validator.getRecipientDetail().setPaymentMethod(new PaymentMethodV3Model(selectedServiceType.getId(), selectedServiceType.getText(), selectedServiceType.getDescription(), selectedServiceType.getCurrency())); |
|
|
|
|
|
// |
|
|
|
|
|
// |
|
|
|
|
|
// view.updateValueToWidgetSelectedPaymentMethod(selectedServiceType.getDescription()); |
|
|
|
|
|
// |
|
|
|
|
|
// flushPaymentMethodRelatedDataOnServiceTypeSelected(); |
|
|
|
|
|
// |
|
|
|
|
|
// |
|
|
|
|
|
// //TODO Right now mock |
|
|
|
|
|
// getDynamicValidationAndDropDownList(validator.getSelectedCountryServiceData().getCountryId(),selectedServiceType.getId()); |
|
|
|
|
|
// mockDynamicValidationList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
flushPaymentMethodRelatedDataOnServiceTypeSelected(); |
|
|
|
|
|
|
|
|
// flushPaymentMethodRelatedDataOnServiceTypeSelected(); |
|
|
|
|
|
|
|
|
validator.getRecipientDetail().updateSelectedCountry(validator.getSelectedCountryServiceData()); |
|
|
|
|
|
validator.getRecipientDetail().setPaymentMethod(new PaymentMethodV3Model(selectedServiceType.getId(), selectedServiceType.getText(), selectedServiceType.getDescription(), selectedServiceType.getCurrency())); |
|
|
validator.getRecipientDetail().setPaymentMethod(new PaymentMethodV3Model(selectedServiceType.getId(), selectedServiceType.getText(), selectedServiceType.getDescription(), selectedServiceType.getCurrency())); |
|
|
|
|
|
|
|
|
view.updateValueToWidgetSelectedPaymentMethod(selectedServiceType.getDescription()); |
|
|
view.updateValueToWidgetSelectedPaymentMethod(selectedServiceType.getDescription()); |
|
@ -351,8 +330,8 @@ public class RecipientEditV3Presenter extends RecipientAddEditBaseV3Presenter im |
|
|
|
|
|
|
|
|
//Map existing data to view and validator |
|
|
//Map existing data to view and validator |
|
|
|
|
|
|
|
|
view.showCountrySelectionView(true); |
|
|
|
|
|
view.showPaymentSelectionView(true); |
|
|
|
|
|
|
|
|
// view.showCountrySelectionView(true); |
|
|
|
|
|
// view.showPaymentSelectionView(true); |
|
|
applyValidationRulesToView(data.getData().getValidationRuleList()); |
|
|
applyValidationRulesToView(data.getData().getValidationRuleList()); |
|
|
validator.validateAllRequiredFieldsExplicitly(); |
|
|
validator.validateAllRequiredFieldsExplicitly(); |
|
|
|
|
|
|
|
@ -389,9 +368,17 @@ public class RecipientEditV3Presenter extends RecipientAddEditBaseV3Presenter im |
|
|
protected void onSuccess(GenericResponseDataModel<List<CountryServiceModel>> t) { |
|
|
protected void onSuccess(GenericResponseDataModel<List<CountryServiceModel>> t) { |
|
|
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { |
|
|
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { |
|
|
validator.updateAvailableCountryServiceData(t.getData()); |
|
|
validator.updateAvailableCountryServiceData(t.getData()); |
|
|
|
|
|
seedExistingDatatoView(); |
|
|
if (validator.getRecipientDetail().getPaymentMethod() == null) { |
|
|
if (validator.getRecipientDetail().getPaymentMethod() == null) { |
|
|
//Since payment method is not available at the moment we cannot show his existing mapped data |
|
|
//Since payment method is not available at the moment we cannot show his existing mapped data |
|
|
view.showCountrySelectionView(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
view.updateValueToWidgetSelectedCountry(validator.getRecipientDetail().getCountry()); |
|
|
|
|
|
view.updateValueToWidgetSelectedPaymentMethod(""); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
view.showSelectedCountryFlag(CountryFlagMapper.getFlagFromCountryCode(validator.getRecipientDetail().getCountryCode())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
seedExistingDatatoView(); |
|
|
seedExistingDatatoView(); |
|
@ -400,6 +387,9 @@ public class RecipientEditV3Presenter extends RecipientAddEditBaseV3Presenter im |
|
|
getDynamicValidationAndDropDownList(countryId, serviceTypeID); |
|
|
getDynamicValidationAndDropDownList(countryId, serviceTypeID); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
view.showCountrySelectionView(true); |
|
|
|
|
|
view.showPaymentSelectionView(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, alertType -> view.exitView()); |
|
|
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, alertType -> view.exitView()); |
|
|