diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 0d5af72e..2bf13b47 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/presenter/KYCV3ViewModel.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/presenter/KYCV3ViewModel.java index 7dcf4f2f..c480aa4e 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/presenter/KYCV3ViewModel.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/presenter/KYCV3ViewModel.java @@ -188,9 +188,9 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter @Override public void onCustomerDetailFormReady(CustomerDetailFragment.Form1ViewBindings form1ViewBindings, CustomerDetailFragment.Form2ViewBindings form2ViewBindings, CustomerDetailFragment.Form3ViewBindings form3ViewBindings) { - if (customerDetailViewSubscriptions != null && !customerDetailViewSubscriptions.isDisposed()) - customerDetailViewSubscriptions.dispose(); - +// if (customerDetailViewSubscriptions != null && !customerDetailViewSubscriptions.isDisposed()) +// customerDetailViewSubscriptions.dispose(); +// alternateIDImageRequiredLiveData.setValue(false); this.customerDetailViewSubscriptions.add( diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/gateway/topup/LocalTopUpGateway.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/gateway/topup/LocalTopUpGateway.java index cdfe3290..e4f0473c 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/gateway/topup/LocalTopUpGateway.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/gateway/topup/LocalTopUpGateway.java @@ -16,7 +16,6 @@ public class LocalTopUpGateway extends PrivilegedGateway implements LocalTopUpIn JsonObject jsonObject=new JsonObject(); jsonObject.addProperty("GetcardType",cardType); jsonObject.addProperty("PhoneNo",topUpMobileNumber); - return HttpClientV2.getInstance().getLocalTopUpRelatedData(auth,jsonObject); } diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/presenter/topup/LocalTopUpPresenter.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/presenter/topup/LocalTopUpPresenter.java index c01eff9d..371e0649 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/presenter/topup/LocalTopUpPresenter.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/presenter/topup/LocalTopUpPresenter.java @@ -79,7 +79,7 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres this.fixedTopup = new MutableLiveData<>(); this.selectedPaymentSourceLiveData = new MutableLiveData<>(); this.selectedPaymentSourceBalanceLiveData = new MutableLiveData<>(); - countDownRemainingValue=-1; + countDownRemainingValue = -1; } @Override @@ -126,8 +126,8 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres private void fetchLocalTopUpData() { this.compositeDisposable.add( Observable.zip( - getLocalTopUpOnBasisCardType(REGULAR_CARD_TYPE, userMsisdn).onErrorReturnItem(new LocalTopUpResponseDTO()), - getLocalTopUpOnBasisCardType(FIXED_CARD_TYPE, userMsisdn).onErrorReturnItem(new LocalTopUpResponseDTO()), + getLocalTopUpOnBasisCardType(REGULAR_CARD_TYPE, userMsisdn), + getLocalTopUpOnBasisCardType(FIXED_CARD_TYPE, userMsisdn), getPaymentSourcesList(), LocalTopUpRelatedData::new) .subscribeOn(Schedulers.io()) @@ -141,14 +141,6 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres ); } - private void loadDummyData() { - String type1 = "{\"CardListType\":\"1\",\"ButtonsGrid\":[{\"Price\":\"10000\"},{\"Price\":\"20000\"},{\"Price\":\"30000\"},{\"Price\":\"40000\"},{\"Price\":\"50000\"},{\"Price\":\"10000000\"}],\"CountryPriceCode\":null,\"CardInfo\":null}"; - String type2 = "{\"CardListType\":\"6\",\"ButtonsGrid\":null,\"CountryPriceCode\":null,\"CardInfo\":[{\"CardCode\":null,\"CardName\":\"AimPlus \",\"FacePrice\":null,\"SubInfo\":[{\"Mvno_code\":\"1\",\"Sale_price\":\"10000\",\"Card_type\":\"FLAT_005\",\"Product_name\":\"AimPlus (10,000)\",\"Face_price\":\"10000\",\"Product_type\":\"FLAT\",\"Plan_info\":null,\"Card_name\":\"AimPlus (10,000)\",\"Telecom_code\":\"\"},{\"Mvno_code\":\"1\",\"Sale_price\":\"20000\",\"Card_type\":\"FLAT_005\",\"Product_name\":\"AimPlus (20,000)\",\"Face_price\":\"20000\",\"Product_type\":\"FLAT\",\"Plan_info\":null,\"Card_name\":\"AimPlus (20,000)\",\"Telecom_code\":\"\"},{\"Mvno_code\":\"1\",\"Sale_price\":\"25000\",\"Card_type\":\"FLAT_005\",\"Product_name\":\"AimPlus (25,000)\",\"Face_price\":\"2500000\",\"Product_type\":\"FLAT\",\"Plan_info\":null,\"Card_name\":\"AimPlus (2,500,000)\",\"Telecom_code\":\"\"}],\"Promotion_price\":null}]}"; - regularTopup.setValue(HttpClientV2.getDeserializer().fromJson(type1, LocalTopUpResponseDTO.class)); - fixedTopup.setValue(HttpClientV2.getDeserializer().fromJson(type2, LocalTopUpResponseDTO.class)); - } - - @Override public void onRegularTopUpDenoSelected(ButtonsGrid selectedAmount) { regularTopUpValidator.isDenoValid(selectedAmount); @@ -221,14 +213,10 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres this.selectedPaymentSource = paymentSource; this.userCurrentBalance = null; selectedPaymentSourceLiveData.setValue(this.selectedPaymentSource.toString()); - if("wallet".equalsIgnoreCase(paymentSource.getType())) - { + if ("wallet".equalsIgnoreCase(paymentSource.getType())) { String walletBalance = gateway.getUserCurrentBalance(); - if (walletBalance != null && walletBalance.length() > 0) - { -// userCurrentBalance=Utils.formatCurrencyWithoutTruncatingDecimal(walletBalance); - //TODO Dummy - userCurrentBalance="20000"; + if (walletBalance != null && walletBalance.length() > 0) { + userCurrentBalance = Utils.formatCurrencyWithoutTruncatingDecimal(walletBalance); updateBalance(userCurrentBalance); } } @@ -255,23 +243,23 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres view.promptBiometricAuthDialog(new TransactionBiometricPromptDialog.BiometricPromptResultListener() { @Override public void onBiometricAuthSuccess(String password) { - prepareAndPerformRegularTopUpTxn(password,true); + prepareAndPerformRegularTopUpTxn(password, true); } }); } else { view.promptPassword(new PasswordPromptListener() { - @Override - public void onPasswordSubmit(String password) { - prepareAndPerformRegularTopUpTxn(password,false); + @Override + public void onPasswordSubmit(String password) { + prepareAndPerformRegularTopUpTxn(password, false); - } + } - @Override - public void onCancelled() { + @Override + public void onCancelled() { - } - }, countDownRemainingValue, + } + }, countDownRemainingValue, selectedPaymentSource.getKftcAccountId(), regularTopUpValidator.selectedDeno.getPrice(), selectedPaymentSource.getType() @@ -300,22 +288,22 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres view.promptBiometricAuthDialog(new TransactionBiometricPromptDialog.BiometricPromptResultListener() { @Override public void onBiometricAuthSuccess(String password) { - prepareAndPerformFixedTopUpTxn(password,true); + prepareAndPerformFixedTopUpTxn(password, true); } }); } else { view.promptPassword(new PasswordPromptListener() { - @Override - public void onPasswordSubmit(String password) { - prepareAndPerformFixedTopUpTxn(password,false); - } + @Override + public void onPasswordSubmit(String password) { + prepareAndPerformFixedTopUpTxn(password, false); + } - @Override - public void onCancelled() { + @Override + public void onCancelled() { - } - }, countDownRemainingValue, + } + }, countDownRemainingValue, selectedPaymentSource.getKftcAccountId(), productPrice, selectedPaymentSource.getType()); @@ -337,22 +325,22 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres view.promptBiometricAuthDialog(new TransactionBiometricPromptDialog.BiometricPromptResultListener() { @Override public void onBiometricAuthSuccess(String password) { - prepareAndPerformDataTopUpTxn(password,true); + prepareAndPerformDataTopUpTxn(password, true); } }); } else { view.promptPassword(new PasswordPromptListener() { - @Override - public void onPasswordSubmit(String password) { - prepareAndPerformDataTopUpTxn(password,false); - } + @Override + public void onPasswordSubmit(String password) { + prepareAndPerformDataTopUpTxn(password, false); + } - @Override - public void onCancelled() { + @Override + public void onCancelled() { - } - }, countDownRemainingValue, + } + }, countDownRemainingValue, selectedPaymentSource.getKftcAccountId(), dataTopUpValidator.selectedCarrierPlan.getFacePrice(), selectedPaymentSource.getType()); @@ -380,7 +368,7 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres performLocalTopupTxn(localTopUpTxnRequestBodyDTO); } - private void prepareAndPerformFixedTopUpTxn(String password,boolean isBiometricUsed) { + private void prepareAndPerformFixedTopUpTxn(String password, boolean isBiometricUsed) { LocalTopUpTxnRequestBodyDTO localTopUpTxnRequestBodyDTO = new LocalTopUpTxnRequestBodyDTO(); localTopUpTxnRequestBodyDTO.setBuyType(FIXED_CARD_TYPE); @@ -636,7 +624,8 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres regularTopup.setValue(o.regularDTO); fixedTopup.setValue(o.fixedDTO); updatePaymentSourceData(o.paymentSourceList); - loadDummyData(); + regularTopUpValidator.validateAll(); + fixedTopUpValidator.validateAll(); view.showTopUpScreens(true); } @@ -670,11 +659,8 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres selectedPaymentSource = paymentSource; selectedPaymentSourceLiveData.setValue(selectedPaymentSource.getBankName()); String walletBalance = gateway.getUserCurrentBalance(); - if (walletBalance != null && walletBalance.length() > 0) - { -// userCurrentBalance=Utils.formatCurrencyWithoutTruncatingDecimal(walletBalance); - //TODO Dummy - userCurrentBalance="45000"; + if (walletBalance != null && walletBalance.length() > 0) { + userCurrentBalance = Utils.formatCurrencyWithoutTruncatingDecimal(walletBalance); updateBalance(userCurrentBalance); } return; @@ -689,8 +675,6 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres } - - public class LocalTopUpTransactionObserver extends GenericApiObserverResponseV2 { @Override protected Type getDataType() { @@ -734,19 +718,15 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres @Override protected void onSuccess(GenericResponseDataModel t) { - //TODO Dummy - updateBalance("40000"); - regularTopUpValidator.validateAll(); - fixedTopUpValidator.validateAll(); -// if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { -// updateBalance(t.getData().getBalanceAmt()); -// regularTopUpValidator.validateAll(); -// fixedTopUpValidator.validateAll(); -//// dataTopUpValidator.validateAll(); -// } else { -// view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, null); -// } + if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { + updateBalance(t.getData().getBalanceAmt()); + regularTopUpValidator.validateAll(); + fixedTopUpValidator.validateAll(); +// dataTopUpValidator.validateAll(); + } else { + view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, null); + } } @Override diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/view/topup/ConfirmRechargePaymentBottomSheetDialog.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/view/topup/ConfirmRechargePaymentBottomSheetDialog.java index a903d047..c57c997a 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/view/topup/ConfirmRechargePaymentBottomSheetDialog.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/view/topup/ConfirmRechargePaymentBottomSheetDialog.java @@ -88,7 +88,6 @@ public class ConfirmRechargePaymentBottomSheetDialog extends BottomSheetDialogFr View v = inflater.inflate(R.layout.confirm_recharge_payment_bottom_sheet, container, false); ButterKnife.bind(this, v); - //TODO Waihat requirement solti haru ko. if (!"wallet".equalsIgnoreCase(paymentSource.getType())) { dedcutedWalletAmount = null; accountBalance = null;