Browse Source

Auth manager fixes

master
Preyea Regmi 4 years ago
parent
commit
b73eef46f0
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. 7
      app/src/main/java/com/gmeremit/online/gmeremittance_native/loginV2/presenter/LoginV2Presenter.java
  3. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/view/recipientaddeditV3/RecipientAddEditV3Activity.java
  4. 19
      app/src/main/java/com/gmeremit/online/gmeremittance_native/security/GMEAuthManager.java
  5. 7
      app/src/main/java/com/gmeremit/online/gmeremittance_native/security/auth/GMETxnOTPRequestBottomSheetDialog.java
  6. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/ApiEndpoints.java

BIN
.idea/caches/build_file_checksums.ser

7
app/src/main/java/com/gmeremit/online/gmeremittance_native/loginV2/presenter/LoginV2Presenter.java

@ -79,8 +79,10 @@ public class LoginV2Presenter extends BaseViewModel implements LoginV2PresenterI
}
private void mockValidUserLogin() {
// loginViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(true,null,"1234"));
// loginViewLiveData.setUserIdInputLiveData(new FormInputStateDTO<>(true,null,"subedi.msmanoj@gmail.com"));
loginViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(true,null,"1234"));
loginViewLiveData.setUserIdInputLiveData(new FormInputStateDTO<>(true,null,"subedi.msmanoj@gmail.com"));
loginViewLiveData.setUserIdInputLiveData(new FormInputStateDTO<>(true,null,"testsender@nepal.com"));
}
private void bindView(LoginViewLiveData.LoginViewBindings viewBindings) {
@ -176,7 +178,8 @@ public class LoginV2Presenter extends BaseViewModel implements LoginV2PresenterI
private class LoginValidator {
private String userId;
private String password="4d544b3132bd58cb051d2cc6dfb445ae958f618cf84ace71184d983d8921224fa415c0b754accb7b3c356eef919dd90d0742d250c3be868711de6df6ccdbc886055cca39ad12e1577a3e3c682a5ff6e63fd1eb15";
// private String password="4d544b3132bd58cb051d2cc6dfb445ae958f618cf84ace71184d983d8921224fa415c0b754accb7b3c356eef919dd90d0742d250c3be868711de6df6ccdbc886055cca39ad12e1577a3e3c682a5ff6e63fd1eb15";
private String password="7697882";
private boolean validateUserId(CharSequence userID) {
if (userID == null || userID.length() < 1) {

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/view/recipientaddeditV3/RecipientAddEditV3Activity.java

@ -20,7 +20,6 @@ import android.widget.TextView;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.BaseActivity;
import com.gmeremit.online.gmeremittance_native.customwidgets.GMEFormInputField;
import com.gmeremit.online.gmeremittance_native.customwidgets.common.GenericImageWithTextListingDialog;
import com.gmeremit.online.gmeremittance_native.customwidgets.common.GenericTextListingDialog;
import com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView;
@ -415,7 +414,6 @@ public class RecipientAddEditV3Activity extends BaseActivity implements Recipien
@Override
public void setSubmitButtonEnabled(boolean action) {
Log.d(TAG, "Button state enabled :" + action);
submitBtn.setEnabled(action);
}

19
app/src/main/java/com/gmeremit/online/gmeremittance_native/security/GMEAuthManager.java

@ -87,13 +87,18 @@ public class GMEAuthManager {
if (gmeTxnParam == null)
throw new IllegalArgumentException("Txn Param cannot be null");
if ("wallet".equalsIgnoreCase(gmeTxnParam.getPaymentSource()))
if (checkIfUserHasEnabledBiometric())
gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.BIOMETRIC);
else
gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.PASSWORD);
else if ("autodebit".equalsIgnoreCase(gmeTxnParam.getPaymentSource()))
gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.OTP);
if (checkIfUserHasEnabledBiometric())
gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.BIOMETRIC);
else
gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.PASSWORD);
// if ("wallet".equalsIgnoreCase(gmeTxnParam.getPaymentSource()))
// if (checkIfUserHasEnabledBiometric())
// gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.BIOMETRIC);
// else
// gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.PASSWORD);
// else if ("autodebit".equalsIgnoreCase(gmeTxnParam.getPaymentSource()))
// gmeTxnParam.setGmeTxnAuthType(GMETxnParam.GMETxnAuthType.OTP);
return this;

7
app/src/main/java/com/gmeremit/online/gmeremittance_native/security/auth/GMETxnOTPRequestBottomSheetDialog.java

@ -213,6 +213,7 @@ public class GMETxnOTPRequestBottomSheetDialog extends BottomSheetDialogFragment
}
private void init() {
compositeDisposable=new CompositeDisposable();
resendRequest.setVisibility(View.VISIBLE);
}
@ -269,6 +270,7 @@ public class GMETxnOTPRequestBottomSheetDialog extends BottomSheetDialogFragment
showPopUpMessage(response.getMsg(), CustomAlertDialog.AlertType.SUCCESS, alertType -> {
showResendRequestView(false);
startCountdownView(120000);
mockValidOTPEntry();
});
} else {
showPopUpMessage(response.getMsg(), CustomAlertDialog.AlertType.FAILED, alertType -> {
@ -296,6 +298,11 @@ public class GMETxnOTPRequestBottomSheetDialog extends BottomSheetDialogFragment
}
}
private void mockValidOTPEntry() {
if(listener!=null)
listener.onOTPSubmittedSucessfully("asdf");
}
public class OTPResendObserver extends GenericApiObserverResponseV2<MessageResponseDataModel> {

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/ApiEndpoints.java

@ -258,7 +258,7 @@ public interface ApiEndpoints {
@Headers("Content-Type: application/json")
Observable<ResponseBody> getCountryRelatedSericesV3(@Header("Authorization") String token, @Path("senderId") String senderId);
@POST(API_URL.DYNAMIC_FIELDS)
@GET(API_URL.DYNAMIC_FIELDS)
@Headers("Content-Type: application/json")
Observable<ResponseBody> getDynamicFields(@Header("Authorization") String token, @Path("senderId") String senderId,@Query("countryId") String countryId,@Query("serviceType") String serviceType);
// Observable<ResponseBody> getDynamicFields(@Header("Authorization") String token, @Path("senderId") String senderId,@Body() JsonObject json);

Loading…
Cancel
Save