|
|
@ -50,15 +50,15 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti |
|
|
|
|
|
|
|
@Override |
|
|
|
public void getDomesticRemitRelatedInfo() { |
|
|
|
compositeDisposable.add( |
|
|
|
this.gateway.getDomesticRelatedData(gateway.getAuth(), gateway.getUserIDNumber()) |
|
|
|
.doOnSubscribe(disposable -> view.showProgressBar(true, getStringfromStringId(R.string.processing_request_text))) |
|
|
|
.subscribeOn(Schedulers.io()) |
|
|
|
.observeOn(AndroidSchedulers.mainThread()) |
|
|
|
.doFinally(() -> view.showProgressBar(false, "")) |
|
|
|
.subscribeWith(new DomesticRelatedDataObserver()) |
|
|
|
); |
|
|
|
// mockDomesticRemitRelatedData(); |
|
|
|
// compositeDisposable.add( |
|
|
|
// this.gateway.getDomesticRelatedData(gateway.getAuth(), gateway.getUserIDNumber()) |
|
|
|
// .doOnSubscribe(disposable -> view.showProgressBar(true, getStringfromStringId(R.string.processing_request_text))) |
|
|
|
// .subscribeOn(Schedulers.io()) |
|
|
|
// .observeOn(AndroidSchedulers.mainThread()) |
|
|
|
// .doFinally(() -> view.showProgressBar(false, "")) |
|
|
|
// .subscribeWith(new DomesticRelatedDataObserver()) |
|
|
|
// ); |
|
|
|
mockDomesticRemitRelatedData(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -67,7 +67,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti |
|
|
|
|
|
|
|
domesticRemitDataValidator.setServiceCharge(serviceCharge); |
|
|
|
|
|
|
|
String messageServiceCharge = "Service charge: " + Utils.formatCurrencyWithoutTruncatingDecimal(serviceCharge) + " " + Constants.KRW_STRING; |
|
|
|
String messageServiceCharge = getStringfromStringId(R.string.service_charge_text)+": " + Utils.formatCurrencyWithoutTruncatingDecimal(serviceCharge) + " " + Constants.KRW_STRING; |
|
|
|
view.updateServiceCharge(messageServiceCharge); |
|
|
|
|
|
|
|
} |
|
|
@ -199,7 +199,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti |
|
|
|
DomesticReicipientInfoDTO data = gateway.getMockedDomesticRecipientInfo(view.getContext()); |
|
|
|
|
|
|
|
|
|
|
|
String message = "The provided account number is associated with name \"ooo\". Do you want to continue?"; |
|
|
|
String message = getStringfromStringId(R.string.check_recipient_name_text); |
|
|
|
String formattedMessage = message.replace("ooo", data.getRecipientName()); |
|
|
|
|
|
|
|
view.promptToConfirmRecipientName(getStringfromStringId(R.string.important_text),formattedMessage, new GenericPromptDialog.GenericDialogPromptListener() { |
|
|
@ -257,7 +257,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti |
|
|
|
|
|
|
|
domesticRemitDataValidator.setCurrentBalance(balance); |
|
|
|
|
|
|
|
view.showCurrentBalance("Available Balance: " + Utils.formatCurrencyWithoutTruncatingDecimal(balance) + " " + Constants.KRW_STRING); |
|
|
|
view.showCurrentBalance(getStringfromStringId(R.string.available_balance_text)+": " + Utils.formatCurrencyWithoutTruncatingDecimal(balance) + " " + Constants.KRW_STRING); |
|
|
|
view.showCheckBalanceButton(false); |
|
|
|
|
|
|
|
domesticRemitDataValidator.validateCurrentBalanceWithSendingAmount(); |
|
|
@ -341,7 +341,9 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti |
|
|
|
this.sendAmount = commaRemovedAmount; |
|
|
|
|
|
|
|
if (sendAmountFormatted < 10000) { |
|
|
|
view.setErrorOnWidgetAmount("Minimum sending amount should be at least 10,000 KRW"); |
|
|
|
String errorMessage=getStringfromStringId(R.string.amount_minimum_error_text); |
|
|
|
|
|
|
|
view.setErrorOnWidgetAmount(errorMessage.replace("ooo","10,000")); |
|
|
|
isValidSendAmount = false; |
|
|
|
} else { |
|
|
|
view.setErrorOnWidgetAmount(null); |
|
|
@ -356,7 +358,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti |
|
|
|
public void validateRecipientBank(DomesticBankDTO selectedReceiverBank) { |
|
|
|
this.selectedRecipientBank=selectedReceiverBank; |
|
|
|
if (selectedReceiverBank == null) { |
|
|
|
view.setErrorOnWidgetRecipientBank("Please select a bank"); |
|
|
|
view.setErrorOnWidgetRecipientBank(getStringfromStringId(R.string.bank_empty_error)); |
|
|
|
view.showSelectedRecipientBankNameAndIcon(null, 0); |
|
|
|
isValidRecipientBank = false; |
|
|
|
} else { |
|
|
@ -370,11 +372,11 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti |
|
|
|
|
|
|
|
public void validateRecipientBankAccNo(String bankAcNo) { |
|
|
|
if (bankAcNo == null || bankAcNo.length() < 1) { |
|
|
|
view.setErrorOnWidgetBankAccountNo("Bank account number cannot be empty"); |
|
|
|
view.setErrorOnWidgetBankAccountNo(getStringfromStringId(R.string.account_number_empty_error)); |
|
|
|
isValidBankAcNo = false; |
|
|
|
this.bankAcNo = null; |
|
|
|
} else if (bankAcNo.length() < 9) { |
|
|
|
view.setErrorOnWidgetBankAccountNo("Bank account number length must be greater than 9 digits"); |
|
|
|
view.setErrorOnWidgetBankAccountNo(getStringfromStringId(R.string.min_length_account_error_text)); |
|
|
|
isValidBankAcNo = false; |
|
|
|
this.bankAcNo = null; |
|
|
|
} else { |
|
|
@ -388,7 +390,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti |
|
|
|
|
|
|
|
public void validateRecipientFullName(String recipientFullName) { |
|
|
|
if (recipientFullName == null || recipientFullName.length() < 1) { |
|
|
|
view.setErrorOnWidgetFullName("Recipient name cannot be empty"); |
|
|
|
view.setErrorOnWidgetFullName(getStringfromStringId(R.string.empty_field_error_text)); |
|
|
|
isValidFullName = false; |
|
|
|
this.recipientFullName = null; |
|
|
|
} else { |
|
|
@ -428,7 +430,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti |
|
|
|
//Business requirement, not checking lower bound as it will be handled by server |
|
|
|
// else if (formattedCurrentBalance <=formattedServiceCharge || netSendingAmount > formattedCurrentBalance) |
|
|
|
else if (netSendingAmount > formattedCurrentBalance) { |
|
|
|
view.setErrorOnWidgetAmount("You don't have sufficient amount to do the transaction"); |
|
|
|
view.setErrorOnWidgetAmount(getStringfromStringId(R.string.insufficient_amount_error_text)); |
|
|
|
isValidSendAmount = false; |
|
|
|
} else { |
|
|
|
//User sending Amount is valid |
|
|
@ -480,12 +482,12 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti |
|
|
|
|
|
|
|
domesticRemitDataValidator.setServiceCharge(serviceCharge); |
|
|
|
|
|
|
|
String messageServiceCharge = "Service charge: " + Utils.formatCurrencyWithoutTruncatingDecimal(serviceCharge) + " " + Constants.KRW_STRING; |
|
|
|
String messageServiceCharge = getStringfromStringId(R.string.service_charge_text)+": " + Utils.formatCurrencyWithoutTruncatingDecimal(serviceCharge) + " " + Constants.KRW_STRING; |
|
|
|
view.updateServiceCharge(messageServiceCharge); |
|
|
|
|
|
|
|
if(t.getData().getAccountList()==null||t.getData().getAccountList().size()<1) |
|
|
|
{ |
|
|
|
String message="Please register an auto-debit account inorder to use this service."; |
|
|
|
String message=getStringfromStringId(R.string.doesnt_have_auto_debit_text); |
|
|
|
view.showPopUpMessage(message, CustomAlertDialog.AlertType.ALERT, alertType -> view.exitView()); |
|
|
|
} |
|
|
|
|
|
|
@ -519,7 +521,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti |
|
|
|
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { |
|
|
|
DomesticReicipientInfoDTO data = t.getData(); |
|
|
|
|
|
|
|
String message = "The provided account number is associated with name \"ooo\". Do you want to continue?"; |
|
|
|
String message = getStringfromStringId(R.string.check_recipient_name_text); |
|
|
|
String formattedMessage = message.replace("ooo", data.getRecipientName()); |
|
|
|
|
|
|
|
view.promptToConfirmRecipientName(getStringfromStringId(R.string.important_text),formattedMessage, new GenericPromptDialog.GenericDialogPromptListener() { |
|
|
@ -572,7 +574,7 @@ public class DomesticRemitPresenterImpl extends BasePresenter implements Domesti |
|
|
|
|
|
|
|
domesticRemitDataValidator.setCurrentBalance(balance); |
|
|
|
|
|
|
|
view.showCurrentBalance("Available Balance: " + Utils.formatCurrencyWithoutTruncatingDecimal(balance) + " " + Constants.KRW_STRING); |
|
|
|
view.showCurrentBalance(getStringfromStringId(R.string.available_balance_text)+": " + Utils.formatCurrencyWithoutTruncatingDecimal(balance) + " " + Constants.KRW_STRING); |
|
|
|
view.showCheckBalanceButton(false); |
|
|
|
|
|
|
|
domesticRemitDataValidator.validateCurrentBalanceWithSendingAmount(); |
|
|
|