Browse Source

Full name explicitly made uppercase, location removed country city and special char, driving license format made similar to national id card

master
Preyea Regmi 5 years ago
parent
commit
e83c02ff95
  1. 14
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/presenter/KYCV3ViewModel.java
  2. 3
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/view/personal/CustomerDetailFragment.java
  3. 19
      app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/RxUtils.java
  4. 1
      app/src/main/res/layout/fragment_kyc_customer_detail.xml

14
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/presenter/KYCV3ViewModel.java

@ -341,6 +341,8 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
args -> args ->
{ {
boolean result = ((boolean) args[0]) && ((boolean) args[1]) && ((boolean) args[2]) && ((boolean) args[3]) && ((boolean) args[4]); boolean result = ((boolean) args[0]) && ((boolean) args[1]) && ((boolean) args[2]) && ((boolean) args[3]) && ((boolean) args[4]);
Log.d(TAG, "Form 2 valid: " + result);
customerDetailForm2Button.setValue(result); customerDetailForm2Button.setValue(result);
log("Alternate ID Related Field Valid : " + ((boolean) args[3])); log("Alternate ID Related Field Valid : " + ((boolean) args[3]));
log("Passport Related Field Valid : " + ((boolean) args[4])); log("Passport Related Field Valid : " + ((boolean) args[4]));
@ -810,6 +812,8 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
public boolean validateBankAccountNo(String bankAccNo) { public boolean validateBankAccountNo(String bankAccNo) {
if (kycRelatedDataDTO.getPrimaryInformation() == null) if (kycRelatedDataDTO.getPrimaryInformation() == null)
kycRelatedDataDTO.setPrimaryInformation(new PrimaryInformationDTO()); kycRelatedDataDTO.setPrimaryInformation(new PrimaryInformationDTO());
@ -827,6 +831,8 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
public boolean validatePassportNo(String passportNo) { public boolean validatePassportNo(String passportNo) {
if (validator.getKycRelatedDataDTO().isUserOfKoreanNative())
return true;
if (kycRelatedDataDTO.getPrimaryInformation() == null) if (kycRelatedDataDTO.getPrimaryInformation() == null)
kycRelatedDataDTO.setPrimaryInformation(new PrimaryInformationDTO()); kycRelatedDataDTO.setPrimaryInformation(new PrimaryInformationDTO());
@ -846,6 +852,8 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
public boolean validatePassportIssuedDate(String passportIssuedDate) { public boolean validatePassportIssuedDate(String passportIssuedDate) {
if (validator.getKycRelatedDataDTO().isUserOfKoreanNative())
return true;
if (kycRelatedDataDTO.getPrimaryInformation() == null) if (kycRelatedDataDTO.getPrimaryInformation() == null)
kycRelatedDataDTO.setPrimaryInformation(new PrimaryInformationDTO()); kycRelatedDataDTO.setPrimaryInformation(new PrimaryInformationDTO());
@ -864,6 +872,8 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
public boolean validatePassportExpiryDate(String passportExpiryDate) { public boolean validatePassportExpiryDate(String passportExpiryDate) {
if (validator.getKycRelatedDataDTO().isUserOfKoreanNative())
return true;
if (kycRelatedDataDTO.getPrimaryInformation() == null) if (kycRelatedDataDTO.getPrimaryInformation() == null)
kycRelatedDataDTO.setPrimaryInformation(new PrimaryInformationDTO()); kycRelatedDataDTO.setPrimaryInformation(new PrimaryInformationDTO());
@ -972,7 +982,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
if (alternateIdNumber == null || alternateIdNumber.length() == 0) { if (alternateIdNumber == null || alternateIdNumber.length() == 0) {
view.getCustomerDetailViewContract().enableAlternateIdFocusChangeAndImeOptionListener(false); view.getCustomerDetailViewContract().enableAlternateIdFocusChangeAndImeOptionListener(false);
result = false; result = false;
} else if (alternateIdNumber.length() > 25) {
} else if (alternateIdNumber.length() != ID_CARD_VALID_LENGTH) {
view.getCustomerDetailViewContract().enableAlternateIdFocusChangeAndImeOptionListener(false); view.getCustomerDetailViewContract().enableAlternateIdFocusChangeAndImeOptionListener(false);
customerDetailErrorLiveDataDTO.setValueToAnotherIdNoError("Invalid Driving License Card"); customerDetailErrorLiveDataDTO.setValueToAnotherIdNoError("Invalid Driving License Card");
result = false; result = false;
@ -1032,7 +1042,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
kycRelatedDataDTO.getPrimaryInformation().setAnotherIDType(val.getId()); kycRelatedDataDTO.getPrimaryInformation().setAnotherIDType(val.getId());
anotherIdPictureLabeliveData.setValue(getAnotherIdTranslatedLable(val.getText())); anotherIdPictureLabeliveData.setValue(getAnotherIdTranslatedLable(val.getText()));
if (ID_TYPE_ALIEN_REGISTRATION_CARD.equalsIgnoreCase(val.getText()) || ID_TYPE_NATIONAL_ID_CARD.equalsIgnoreCase(val.getText())) {
if (ID_TYPE_ALIEN_REGISTRATION_CARD.equalsIgnoreCase(val.getText()) || ID_TYPE_NATIONAL_ID_CARD.equalsIgnoreCase(val.getText())||ID_TYPE_DRIVING_LICENSE.equalsIgnoreCase(val.getText())) {
view.getCustomerDetailViewContract().updateAnotherIdNumberMask(1); view.getCustomerDetailViewContract().updateAnotherIdNumberMask(1);
} else { } else {
view.getCustomerDetailViewContract().updateAnotherIdNumberMask(0); view.getCustomerDetailViewContract().updateAnotherIdNumberMask(0);

3
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV3/view/personal/CustomerDetailFragment.java

@ -14,6 +14,7 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.provider.Settings; import android.provider.Settings;
import android.text.InputFilter;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -290,7 +291,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
private void performDefaultAction(Bundle savedInstance) { private void performDefaultAction(Bundle savedInstance) {
form2.setVisibility(GONE); form2.setVisibility(GONE);
form3.setVisibility(GONE); form3.setVisibility(GONE);
ed_firstname.setFilters(new InputFilter[] {new InputFilter.AllCaps()});
KYCV3ViewModel kycv3ViewModel = ViewModelProviders.of(getActivity()).get(KYCV3ViewModel.class); KYCV3ViewModel kycv3ViewModel = ViewModelProviders.of(getActivity()).get(KYCV3ViewModel.class);
subscribeToCustomerRelatedDataError(kycv3ViewModel); subscribeToCustomerRelatedDataError(kycv3ViewModel);

19
app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/RxUtils.java

@ -44,14 +44,27 @@ public class RxUtils {
Geocoder geocoder; Geocoder geocoder;
List<Address> addresses; List<Address> addresses;
geocoder = new Geocoder(activity, Locale.getDefault());
geocoder = new Geocoder(activity, new Locale("en"));
addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1); // Here 1 represent max location result to returned, by documents it recommended 1 to 5 addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1); // Here 1 represent max location result to returned, by documents it recommended 1 to 5
String address = ""; String address = "";
if (addresses.get(0).getAddressLine(0) != null)
if (addresses.get(0).getAddressLine(0) != null) {
address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex() address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()
address= address.replaceAll(",","");
if(addresses.get(0).getCountryName()!=null&& address.contains(addresses.get(0).getCountryName())) {
Log.d("RXGPS", "Selected Country: "+addresses.get(0).getCountryName());
address = address.replace(addresses.get(0).getCountryName(), "");
}
if(addresses.get(0).getLocality()!=null&& address.contains(addresses.get(0).getLocality())) {
Log.d("RXGPS", "Selected city: "+addresses.get(0).getLocality());
address = address.replace(addresses.get(0).getLocality(), "");
}
if(addresses.get(0).getPostalCode()!=null&& address.contains(addresses.get(0).getPostalCode())) {
Log.d("RXGPS", "Selected postal Code: "+addresses.get(0).getPostalCode());
address = address.replace(addresses.get(0).getPostalCode(), "");
}
}
return Observable.just(address); return Observable.just(address);
}).timeout(6000,TimeUnit.MILLISECONDS).onErrorResumeNext(Observable.error(new Throwable("Could not fetch location at the moment. Try again later."))); }).timeout(6000,TimeUnit.MILLISECONDS).onErrorResumeNext(Observable.error(new Throwable("Could not fetch location at the moment. Try again later.")));
} else } else

1
app/src/main/res/layout/fragment_kyc_customer_detail.xml

@ -53,6 +53,7 @@
android:id="@+id/ed_firstname" android:id="@+id/ed_firstname"
style="@style/editetxtsingleline" style="@style/editetxtsingleline"
android:layout_width="match_parent" android:layout_width="match_parent"
android:inputType="text|textCapCharacters"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:imeOptions="actionDone" android:imeOptions="actionDone"
app:maxLengthLimiter="100" /> app:maxLengthLimiter="100" />

Loading…
Cancel
Save