From 6113db56c3158a1a45489b167f81574966c38e11 Mon Sep 17 00:00:00 2001 From: Soft Solution Zone Date: Fri, 20 Oct 2023 18:54:09 +0530 Subject: [PATCH] new changes with eko bbps --- .../{ => ekoaeps}/SSZAePSHomeActivity.java | 0 .../SSZAePSManageDeviceFragment.java | 0 .../SSZAePSSearchCashOutFragment.java | 0 .../SSZAePSSectionsPagerAdapter.java | 0 .../ekoaeps/ekyc/EkoEKYCBiometricDialog.java | 178 ++++++ .../ekyc/EkoEKYCOtpVerificationDialog.java | 104 ++++ .../ekoaeps/ekyc/EkoEKYCSuccessDialog.java | 67 +++ .../FingpayAePSBiometricFragment.java | 0 .../FingpayAePSBiometricPagerAdapter.java | 0 .../FingpayAePSHomeActivity.java | 0 .../FingpayAePSManageDeviceFragment.java | 0 .../FingpayAePSSearchCashOutFragment.java | 0 .../FingpayAePSSectionsPagerAdapter.java | 0 .../ekoekyc/EKYCBiometricRequestModal.java | 76 +++ .../ekoekyc/EKYCRequestOTPModal.java | 40 ++ .../ekoekyc/EKYCRequestOtpResponseData.java | 39 ++ .../ekoekyc/EKYCResponseModal.java | 38 ++ .../ekoekyc/EKYCVerifyOTPModal.java | 48 ++ .../ekoekyc/UserOtpVerifyData.java | 19 + .../paysprint/PaysprintTwoFactorRequest.java | 52 ++ .../PaysprintTwoFactorRequestData.java | 70 +++ .../paysprint/PaysprintTwoFactorResponse.java | 35 ++ .../PaysprintTwoFactorResponseData.java | 25 + .../paysprint/PSAePSTwoFactorFragment.java | 420 ++++++++++++++ .../layout/eko_aeps_biometric_kyc_frag.xml | 106 ++++ .../res/layout/eko_ekyc_otp_verification.xml | 49 ++ .../res/layout/eko_ekyc_status_dialog.xml | 52 ++ .../res/layout/ps_aeps_two_factor_frag.xml | 176 ++++++ .../agent/ekobbps/BillPayCategoryAdapter.java | 105 ++++ .../ekobbps/BillPayCategoryDialogFrag.java | 94 +++ .../agent/ekobbps/BillPayLocationAdapter.java | 105 ++++ .../ekobbps/BillPayLocationDialogFrag.java | 96 ++++ .../agent/ekobbps/BillPayOperatorAdapter.java | 105 ++++ .../ekobbps/BillPayOperatorDialogFrag.java | 96 ++++ .../agent/ekobbps/BillPaymentActivity.java | 537 ++++++++++++++++++ .../ekobbps/BillPaymentReceiptActivity.java | 170 ++++++ .../agent/ekobbps/EkoEditBoxAdapter.java | 82 +++ .../model/ekobbps/BillPayMainRequest.java | 49 ++ .../model/ekobbps/FetchBillRequest.java | 42 ++ .../model/ekobbps/FetchBillResponse.java | 72 +++ .../network/model/ekobbps/FetchDetails.java | 154 +++++ .../network/model/ekobbps/InvalidParam.java | 17 + .../agent/network/model/ekobbps/Operator.java | 83 +++ .../model/ekobbps/OperatorCategory.java | 34 ++ .../ekobbps/OperatorCategoryResponse.java | 29 + .../model/ekobbps/OperatorLocation.java | 27 + .../ekobbps/OperatorLocationResponse.java | 29 + .../model/ekobbps/OperatorParameter.java | 59 ++ .../model/ekobbps/OperatorParameterData.java | 43 ++ .../ekobbps/OperatorParametersResponse.java | 27 + .../model/ekobbps/OperatorResponse.java | 41 ++ .../network/model/ekobbps/PayBillData.java | 94 +++ .../network/model/ekobbps/PayBillReceipt.java | 335 +++++++++++ .../network/model/ekobbps/PayBillRequest.java | 52 ++ .../model/ekobbps/PayBillResponse.java | 61 ++ ...Response.java => EMIOperatorResponse.java} | 0 .../res/layout/eko_bbps_payment_activity.xml | 205 +++++++ .../eko_bbps_payment_bank_search_item.xml | 10 + .../layout/eko_bbps_payment_edit_box_item.xml | 16 + .../layout/eko_bbps_payment_txn_reciept.xml | 465 +++++++++++++++ .../res/layout/eko_bbps_search_dialog.xml | 43 ++ 61 files changed, 4971 insertions(+) rename aepssdkssz/src/main/java/com/aepssdkssz/{ => ekoaeps}/SSZAePSHomeActivity.java (100%) rename aepssdkssz/src/main/java/com/aepssdkssz/{ => ekoaeps}/SSZAePSManageDeviceFragment.java (100%) rename aepssdkssz/src/main/java/com/aepssdkssz/{ => ekoaeps}/SSZAePSSearchCashOutFragment.java (100%) rename aepssdkssz/src/main/java/com/aepssdkssz/{ => ekoaeps}/SSZAePSSectionsPagerAdapter.java (100%) create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/ekyc/EkoEKYCBiometricDialog.java create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/ekyc/EkoEKYCOtpVerificationDialog.java create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/ekyc/EkoEKYCSuccessDialog.java rename aepssdkssz/src/main/java/com/aepssdkssz/{ => fingpay}/FingpayAePSBiometricFragment.java (100%) rename aepssdkssz/src/main/java/com/aepssdkssz/{ => fingpay}/FingpayAePSBiometricPagerAdapter.java (100%) rename aepssdkssz/src/main/java/com/aepssdkssz/{ => fingpay}/FingpayAePSHomeActivity.java (100%) rename aepssdkssz/src/main/java/com/aepssdkssz/{ => fingpay}/FingpayAePSManageDeviceFragment.java (100%) rename aepssdkssz/src/main/java/com/aepssdkssz/{ => fingpay}/FingpayAePSSearchCashOutFragment.java (100%) rename aepssdkssz/src/main/java/com/aepssdkssz/{ => fingpay}/FingpayAePSSectionsPagerAdapter.java (100%) create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCBiometricRequestModal.java create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCRequestOTPModal.java create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCRequestOtpResponseData.java create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCResponseModal.java create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCVerifyOTPModal.java create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/UserOtpVerifyData.java create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorRequest.java create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorRequestData.java create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorResponse.java create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorResponseData.java create mode 100644 aepssdkssz/src/main/java/com/aepssdkssz/paysprint/PSAePSTwoFactorFragment.java create mode 100644 aepssdkssz/src/main/res/layout/eko_aeps_biometric_kyc_frag.xml create mode 100644 aepssdkssz/src/main/res/layout/eko_ekyc_otp_verification.xml create mode 100644 aepssdkssz/src/main/res/layout/eko_ekyc_status_dialog.xml create mode 100644 aepssdkssz/src/main/res/layout/ps_aeps_two_factor_frag.xml create mode 100644 app/src/main/java/in/msmartpay/agent/ekobbps/BillPayCategoryAdapter.java create mode 100644 app/src/main/java/in/msmartpay/agent/ekobbps/BillPayCategoryDialogFrag.java create mode 100644 app/src/main/java/in/msmartpay/agent/ekobbps/BillPayLocationAdapter.java create mode 100644 app/src/main/java/in/msmartpay/agent/ekobbps/BillPayLocationDialogFrag.java create mode 100644 app/src/main/java/in/msmartpay/agent/ekobbps/BillPayOperatorAdapter.java create mode 100644 app/src/main/java/in/msmartpay/agent/ekobbps/BillPayOperatorDialogFrag.java create mode 100644 app/src/main/java/in/msmartpay/agent/ekobbps/BillPaymentActivity.java create mode 100644 app/src/main/java/in/msmartpay/agent/ekobbps/BillPaymentReceiptActivity.java create mode 100644 app/src/main/java/in/msmartpay/agent/ekobbps/EkoEditBoxAdapter.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/BillPayMainRequest.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/FetchBillRequest.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/FetchBillResponse.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/FetchDetails.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/InvalidParam.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/Operator.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/OperatorCategory.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/OperatorCategoryResponse.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/OperatorLocation.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/OperatorLocationResponse.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/OperatorParameter.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/OperatorParameterData.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/OperatorParametersResponse.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/OperatorResponse.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/PayBillData.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/PayBillReceipt.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/PayBillRequest.java create mode 100644 app/src/main/java/in/msmartpay/agent/network/model/ekobbps/PayBillResponse.java rename app/src/main/java/in/msmartpay/agent/network/model/post/{OperatorResponse.java => EMIOperatorResponse.java} (100%) create mode 100644 app/src/main/res/layout/eko_bbps_payment_activity.xml create mode 100644 app/src/main/res/layout/eko_bbps_payment_bank_search_item.xml create mode 100644 app/src/main/res/layout/eko_bbps_payment_edit_box_item.xml create mode 100644 app/src/main/res/layout/eko_bbps_payment_txn_reciept.xml create mode 100644 app/src/main/res/layout/eko_bbps_search_dialog.xml diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/SSZAePSHomeActivity.java b/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/SSZAePSHomeActivity.java similarity index 100% rename from aepssdkssz/src/main/java/com/aepssdkssz/SSZAePSHomeActivity.java rename to aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/SSZAePSHomeActivity.java diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/SSZAePSManageDeviceFragment.java b/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/SSZAePSManageDeviceFragment.java similarity index 100% rename from aepssdkssz/src/main/java/com/aepssdkssz/SSZAePSManageDeviceFragment.java rename to aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/SSZAePSManageDeviceFragment.java diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/SSZAePSSearchCashOutFragment.java b/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/SSZAePSSearchCashOutFragment.java similarity index 100% rename from aepssdkssz/src/main/java/com/aepssdkssz/SSZAePSSearchCashOutFragment.java rename to aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/SSZAePSSearchCashOutFragment.java diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/SSZAePSSectionsPagerAdapter.java b/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/SSZAePSSectionsPagerAdapter.java similarity index 100% rename from aepssdkssz/src/main/java/com/aepssdkssz/SSZAePSSectionsPagerAdapter.java rename to aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/SSZAePSSectionsPagerAdapter.java diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/ekyc/EkoEKYCBiometricDialog.java b/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/ekyc/EkoEKYCBiometricDialog.java new file mode 100644 index 0000000..c63d306 --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/ekyc/EkoEKYCBiometricDialog.java @@ -0,0 +1,178 @@ +package com.aepssdkssz.ekoaeps.ekyc; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; +import androidx.fragment.app.FragmentManager; + +import com.google.android.material.textfield.TextInputLayout; + +import java.util.Objects; + +import in.msmartpay.agent.R; +import in.msmartpay.agent.network.NetworkConnection; +import in.msmartpay.agent.network.RetrofitClient; +import in.msmartpay.agent.network.model.MainResponse2; +import in.msmartpay.agent.network.model.aeps.onboard.UserRegisterRequest; +import in.msmartpay.agent.utility.Keys; +import in.msmartpay.agent.utility.L; +import in.msmartpay.agent.utility.ProgressDialogFragment; +import in.msmartpay.agent.utility.Util; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class UserRegistrationDialog extends DialogFragment { + + private RegisterListener listener; + private String number, fName, lName, mName; + + public void setListener(RegisterListener listener) { + this.listener = listener; + } + + @Override + public int getTheme() { + return R.style.DialogTheme; + } + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + return inflater.inflate(R.layout.activate_register, container, false); + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + TextView tv_toolbar_title = view.findViewById(R.id.tv_toolbar_title); + TextView tv_done = view.findViewById(R.id.tv_done); + ImageView iv_close = view.findViewById(R.id.iv_close); + Button btn_register = view.findViewById(R.id.btn_register); + TextInputLayout til_firstName, til_lastName, til_middleName, til_mob; + til_firstName = view.findViewById(R.id.til_firstName); + til_middleName = view.findViewById(R.id.til_middleName); + til_lastName = view.findViewById(R.id.til_lastName); + til_mob = view.findViewById(R.id.til_mob); + + try { + String agentName=Util.LoadPrefData(requireActivity(), Keys.AGENT_NAME); + String agentNameArr[] = new String[0]; + if(agentName!=null){ + agentNameArr=agentName.split(" "); + } + if(agentNameArr.length==1){ + til_firstName.getEditText().setText(agentNameArr[0]); + + }else if(agentNameArr.length==2){ + til_firstName.getEditText().setText(agentNameArr[0]); + til_lastName.getEditText().setText(agentNameArr[1]); + }else if(agentNameArr.length==3){ + til_firstName.getEditText().setText(agentNameArr[0]); + til_middleName.getEditText().setText(agentNameArr[1]); + til_lastName.getEditText().setText(agentNameArr[2]); + } + }catch (Exception e){ + + } + + + Util.hideView(tv_done); + + tv_toolbar_title.setText("User On board"); + + Bundle bundle = getArguments(); + if (bundle != null) { + number = bundle.getString(Keys.CUSTOMER_MOBILE); + Objects.requireNonNull(til_mob.getEditText()).setText(number); + } + iv_close.setOnClickListener(v -> { + dismiss(); + }); + + btn_register.setOnClickListener(v -> { + fName = Objects.requireNonNull(til_firstName.getEditText()).getText().toString().trim(); + lName = Objects.requireNonNull(til_lastName.getEditText()).getText().toString().trim(); + mName = Objects.requireNonNull(til_middleName.getEditText()).getText().toString().trim(); + if (fName.isEmpty()) { + L.toastS(requireActivity(), "Enter First Name"); + }/* else if (lName.isEmpty()) { + L.toastS(requireActivity(), "Enter Last Name"); + } */else { + register(); + } + }); + + } + + private void register() { + if (NetworkConnection.isConnectionAvailable(requireActivity())) { + ProgressDialogFragment pd = ProgressDialogFragment.newInstance("Loading. Please wait...", "User On Boarding..."); + ProgressDialogFragment.showDialog(pd, getChildFragmentManager()); + + UserRegisterRequest registerRequest = new UserRegisterRequest(); + registerRequest.setAgentID(Util.LoadPrefData(requireActivity(), Keys.AGENT_ID)); + registerRequest.setKey(Util.LoadPrefData(requireActivity(), Keys.TXN_KEY)); + registerRequest.setFirstname(fName); + registerRequest.setM_name(mName); + registerRequest.setLastname(lName); + registerRequest.setMobile(number); + + RetrofitClient.getClient(requireActivity()) + .activateRegister(registerRequest).enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + pd.dismiss(); + try { + if (response.isSuccessful() && response.body() != null) { + MainResponse2 res = response.body(); + if ("0".equalsIgnoreCase(res.getStatus())) { + String userCode = res.getUserCode(); + Util.SavePrefData(requireActivity(),Keys.USER_CODE,userCode); + UserSuccessDialog.showDialog(requireActivity().getSupportFragmentManager()); + dismiss(); + } else { + L.toastS(requireActivity(), res.getMessage()); + } + } + } catch (Exception e) { + L.toastS(requireActivity(), "Parser Error : " + e.getLocalizedMessage()); + L.m2("Parser Error", e.getLocalizedMessage()); + } + } + + @Override + public void onFailure(Call call, Throwable t) { + L.toastS(requireActivity(), "Error : " + t.getLocalizedMessage()); + pd.dismiss(); + } + }); + } + } + + public interface RegisterListener { + void onRegister(); + } + + public static UserRegistrationDialog newInstance(String number) { + Bundle args = new Bundle(); + UserRegistrationDialog fragment = new UserRegistrationDialog(); + args.putString(Keys.CUSTOMER_MOBILE, number); + fragment.setArguments(args); + // fragment.setListener(listener); + return fragment; + } + + public static void showDialog(FragmentManager manager, String number) { + UserRegistrationDialog dialog = UserRegistrationDialog.newInstance(number); + dialog.show(manager, "Show Dialog"); + } +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/ekyc/EkoEKYCOtpVerificationDialog.java b/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/ekyc/EkoEKYCOtpVerificationDialog.java new file mode 100644 index 0000000..c0dbc63 --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/ekyc/EkoEKYCOtpVerificationDialog.java @@ -0,0 +1,104 @@ +package com.aepssdkssz.ekoaeps.ekyc; + +import android.content.Context; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; +import androidx.fragment.app.FragmentManager; + +import com.aepssdkssz.util.Utility; +import com.google.android.material.textfield.TextInputLayout; + +import java.util.Objects; + +import com.aepssdkssz.R; + +public class EkoEKYCRequestOTPDialog extends DialogFragment { + + private String otp = ""; + private Context context; + private ProgressDialogFragment pd; + private UserNumberVerifyListener listener; + private boolean isGenerateOtp; + private String number, name; + + public void setListener(UserNumberVerifyListener listener) { + this.listener = listener; + } + + @Override + public int getTheme() { + return R.style.DialogTheme; + } + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + return inflater.inflate(R.layout.eko_ekyc_request_otp, container, false); + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + context = requireActivity(); + TextView tv_toolbar_title = view.findViewById(R.id.tv_toolbar_title); + TextView tv_done = view.findViewById(R.id.tv_done); + ImageView iv_close = view.findViewById(R.id.iv_close); + + Utility.hideView(tv_done); + tv_toolbar_title.setText("e-KYC OTP Verification"); + + Button btn_send = view.findViewById(R.id.btn_send); + TextInputLayout til_number = view.findViewById(R.id.til_number); + + + Bundle bundle = getArguments(); + if (bundle != null) { + number = bundle.getString(Keys.CUSTOMER_MOBILE); + til_number.getEditText().setText(number); + til_number.getEditText().setFocusable(false); + til_number.getEditText().setFocusableInTouchMode(false); + } + + + iv_close.setOnClickListener(v -> { + dismiss(); + }); + + btn_send.setOnClickListener(v -> { + number = Objects.requireNonNull(til_number.getEditText()).getText().toString().trim(); + if (number.isEmpty() || number.length()<10) { + L.toastS(context, "Enter Number"); + } else { + UserVerifyOtpDialog.showDialog(requireActivity().getSupportFragmentManager(), number); + dismiss(); + } + }); + } + + public interface UserNumberVerifyListener { + void onNumberVerify(); + } + + public static EkoEKYCRequestOTPDialog newInstance(String number) { + Bundle args = new Bundle(); + EkoEKYCRequestOTPDialog fragment = new EkoEKYCRequestOTPDialog(); + args.putString(Keys.CUSTOMER_MOBILE, number); + fragment.setArguments(args); + // fragment.setListener(listener); + return fragment; + } + + public static void showDialog(FragmentManager manager, String number) { + EkoEKYCRequestOTPDialog dialog = EkoEKYCRequestOTPDialog.newInstance(number); + dialog.show(manager, "Show Dialog"); + } +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/ekyc/EkoEKYCSuccessDialog.java b/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/ekyc/EkoEKYCSuccessDialog.java new file mode 100644 index 0000000..1ccacf9 --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/ekoaeps/ekyc/EkoEKYCSuccessDialog.java @@ -0,0 +1,67 @@ +package com.aepssdkssz.ekoaeps.ekyc; + +import android.content.Intent; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; +import androidx.fragment.app.FragmentManager; + +import in.msmartpay.agent.R; +import in.msmartpay.agent.utility.Util; + +public class UserSuccessDialog extends DialogFragment { + + @Override + public int getTheme() { + return R.style.DialogTheme; + } + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + return inflater.inflate(R.layout.activate_success, container, false); + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + TextView tv_toolbar_title = view.findViewById(R.id.tv_toolbar_title); + TextView tv_done = view.findViewById(R.id.tv_done); + ImageView iv_close = view.findViewById(R.id.iv_close); + Button btn_aeps_activate = view.findViewById(R.id.btn_aeps_activate); + tv_toolbar_title.setText("Onboard Success"); + Util.hideView(tv_done); + + iv_close.setOnClickListener(v -> { + dismiss(); + }); + btn_aeps_activate.setOnClickListener(v -> { + startActivity(new Intent(requireActivity(),ActivateAepsActivity.class)); + dismiss(); + }); + + + } + + public static UserSuccessDialog newInstance() { + Bundle args = new Bundle(); + UserSuccessDialog fragment = new UserSuccessDialog(); + fragment.setArguments(args); + // fragment.setListener(listener); + return fragment; + } + + public static void showDialog(FragmentManager manager) { + UserSuccessDialog dialog = UserSuccessDialog.newInstance(); + dialog.show(manager, "Show Dialog"); + } +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/FingpayAePSBiometricFragment.java b/aepssdkssz/src/main/java/com/aepssdkssz/fingpay/FingpayAePSBiometricFragment.java similarity index 100% rename from aepssdkssz/src/main/java/com/aepssdkssz/FingpayAePSBiometricFragment.java rename to aepssdkssz/src/main/java/com/aepssdkssz/fingpay/FingpayAePSBiometricFragment.java diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/FingpayAePSBiometricPagerAdapter.java b/aepssdkssz/src/main/java/com/aepssdkssz/fingpay/FingpayAePSBiometricPagerAdapter.java similarity index 100% rename from aepssdkssz/src/main/java/com/aepssdkssz/FingpayAePSBiometricPagerAdapter.java rename to aepssdkssz/src/main/java/com/aepssdkssz/fingpay/FingpayAePSBiometricPagerAdapter.java diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/FingpayAePSHomeActivity.java b/aepssdkssz/src/main/java/com/aepssdkssz/fingpay/FingpayAePSHomeActivity.java similarity index 100% rename from aepssdkssz/src/main/java/com/aepssdkssz/FingpayAePSHomeActivity.java rename to aepssdkssz/src/main/java/com/aepssdkssz/fingpay/FingpayAePSHomeActivity.java diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/FingpayAePSManageDeviceFragment.java b/aepssdkssz/src/main/java/com/aepssdkssz/fingpay/FingpayAePSManageDeviceFragment.java similarity index 100% rename from aepssdkssz/src/main/java/com/aepssdkssz/FingpayAePSManageDeviceFragment.java rename to aepssdkssz/src/main/java/com/aepssdkssz/fingpay/FingpayAePSManageDeviceFragment.java diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/FingpayAePSSearchCashOutFragment.java b/aepssdkssz/src/main/java/com/aepssdkssz/fingpay/FingpayAePSSearchCashOutFragment.java similarity index 100% rename from aepssdkssz/src/main/java/com/aepssdkssz/FingpayAePSSearchCashOutFragment.java rename to aepssdkssz/src/main/java/com/aepssdkssz/fingpay/FingpayAePSSearchCashOutFragment.java diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/FingpayAePSSectionsPagerAdapter.java b/aepssdkssz/src/main/java/com/aepssdkssz/fingpay/FingpayAePSSectionsPagerAdapter.java similarity index 100% rename from aepssdkssz/src/main/java/com/aepssdkssz/FingpayAePSSectionsPagerAdapter.java rename to aepssdkssz/src/main/java/com/aepssdkssz/fingpay/FingpayAePSSectionsPagerAdapter.java diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCBiometricRequestModal.java b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCBiometricRequestModal.java new file mode 100644 index 0000000..670d618 --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCBiometricRequestModal.java @@ -0,0 +1,76 @@ +package com.aepssdkssz.network.model.aepstransaction.ekoekyc; + +import com.google.gson.annotations.SerializedName; + +public class EKYCVerifyOTPModal { + + @SerializedName("customer_id") + private String agentRegisteredMobile; + @SerializedName("user_code") + private String ekoUserCode; + @SerializedName("aadhar") + private String agentAadhaarNumber; + private String latlong; + @SerializedName("otp") + private String otp; + @SerializedName("otp_ref_id") + private String otpRefId; + @SerializedName("reference_tid") + private String referenceTid; + + public String getOtp() { + return otp; + } + + public void setOtp(String otp) { + this.otp = otp; + } + + public String getOtpRefId() { + return otpRefId; + } + + public void setOtpRefId(String otpRefId) { + this.otpRefId = otpRefId; + } + + public String getReferenceTid() { + return referenceTid; + } + + public void setReferenceTid(String referenceTid) { + this.referenceTid = referenceTid; + } + + public String getAgentRegisteredMobile() { + return agentRegisteredMobile; + } + + public void setAgentRegisteredMobile(String agentRegisteredMobile) { + this.agentRegisteredMobile = agentRegisteredMobile; + } + + public String getEkoUserCode() { + return ekoUserCode; + } + + public void setEkoUserCode(String ekoUserCode) { + this.ekoUserCode = ekoUserCode; + } + + public String getAgentAadhaarNumber() { + return agentAadhaarNumber; + } + + public void setAgentAadhaarNumber(String agentAadhaarNumber) { + this.agentAadhaarNumber = agentAadhaarNumber; + } + + public String getLatlong() { + return latlong; + } + + public void setLatlong(String latlong) { + this.latlong = latlong; + } +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCRequestOTPModal.java b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCRequestOTPModal.java new file mode 100644 index 0000000..2f39947 --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCRequestOTPModal.java @@ -0,0 +1,40 @@ +package in.msmartpay.agent.network.model.aeps.onboard; + +public class UserRequest { + String Key; + String AgentID; + String Mobile; + String OTP; + + public String getKey() { + return Key; + } + + public void setKey(String key) { + Key = key; + } + + public String getAgentID() { + return AgentID; + } + + public void setAgentID(String agentID) { + AgentID = agentID; + } + + public String getMobile() { + return Mobile; + } + + public void setMobile(String mobile) { + Mobile = mobile; + } + + public String getOTP() { + return OTP; + } + + public void setOTP(String OTP) { + this.OTP = OTP; + } +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCRequestOtpResponseData.java b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCRequestOtpResponseData.java new file mode 100644 index 0000000..1a25c36 --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCRequestOtpResponseData.java @@ -0,0 +1,39 @@ + +package com.aepssdkssz.network.model.aepstransaction.ekoekyc; + +import com.google.gson.annotations.SerializedName; + +public class EKYCRequestOtpData { + + @SerializedName("user_code") + private String userCode; + @SerializedName("reference_tid") + private String referenceTid; + + @SerializedName("otp_ref_id") + private String otpRefId; + + public String getUserCode() { + return userCode; + } + + public void setUserCode(String userCode) { + this.userCode = userCode; + } + + public String getReferenceTid() { + return referenceTid; + } + + public void setReferenceTid(String referenceTid) { + this.referenceTid = referenceTid; + } + + public String getOtpRefId() { + return otpRefId; + } + + public void setOtpRefId(String otpRefId) { + this.otpRefId = otpRefId; + } +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCResponseModal.java b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCResponseModal.java new file mode 100644 index 0000000..774c8eb --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCResponseModal.java @@ -0,0 +1,38 @@ + +package com.aepssdkssz.network.model.aepstransaction.ekoekyc; + +import com.google.gson.annotations.SerializedName; + +public class EKYCRequestOTPResponse { + + @SerializedName("data") + private EKYCRequestOtpResponseData data; + @SerializedName("status") + private String status; + @SerializedName("message") + private String message; + + public EKYCRequestOtpResponseData getData() { + return data; + } + + public void setData(EKYCRequestOtpResponseData data) { + this.data = data; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCVerifyOTPModal.java b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCVerifyOTPModal.java new file mode 100644 index 0000000..fd9b02a --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/EKYCVerifyOTPModal.java @@ -0,0 +1,48 @@ +package com.aepssdkssz.network.model.aepstransaction.ekoekyc; + +import com.google.gson.annotations.SerializedName; + +public class EKYCRequestOTPModal { + + @SerializedName("customer_id") + private String agentRegisteredMobile; + + @SerializedName("user_code") + private String ekoUserCode; + + @SerializedName("aadhar") + private String agentAadhaarNumber; + private String latlong; + + public String getAgentRegisteredMobile() { + return agentRegisteredMobile; + } + + public void setAgentRegisteredMobile(String agentRegisteredMobile) { + this.agentRegisteredMobile = agentRegisteredMobile; + } + + public String getEkoUserCode() { + return ekoUserCode; + } + + public void setEkoUserCode(String ekoUserCode) { + this.ekoUserCode = ekoUserCode; + } + + public String getAgentAadhaarNumber() { + return agentAadhaarNumber; + } + + public void setAgentAadhaarNumber(String agentAadhaarNumber) { + this.agentAadhaarNumber = agentAadhaarNumber; + } + + public String getLatlong() { + return latlong; + } + + public void setLatlong(String latlong) { + this.latlong = latlong; + } +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/UserOtpVerifyData.java b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/UserOtpVerifyData.java new file mode 100644 index 0000000..8213cc5 --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/aepstransaction/ekoekyc/UserOtpVerifyData.java @@ -0,0 +1,19 @@ + +package in.msmartpay.agent.network.model.aeps.onboard; + +import com.google.gson.annotations.SerializedName; + +public class UserOtpVerifyData { + + @SerializedName("csp_id") + private String mCspId; + + public String getCspId() { + return mCspId; + } + + public void setCspId(String cspId) { + mCspId = cspId; + } + +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorRequest.java b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorRequest.java new file mode 100644 index 0000000..4a757e8 --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorRequest.java @@ -0,0 +1,52 @@ +package in.aepssdkssz.network.model.paysprint; + + +import com.google.gson.annotations.SerializedName; + +import in.aepssdkssz.network.model.aepstransaction.PaysprintAepsRequestData; + +public class PaysprintTwoFactorRequest { + + @SerializedName("AgentID") + private String agentId; + @SerializedName("Key") + private String txnKey; + + @SerializedName("bankPipe") + private String bankPipe; + + public String getBankPipe() { + return bankPipe; + } + + public void setBankPipe(String bankPipe) { + this.bankPipe = bankPipe; + } + + private PaysprintTwoFactorRequestData data; + + public String getAgentId() { + return agentId; + } + + public void setAgentId(String agentId) { + this.agentId = agentId; + } + + public String getTxnKey() { + return txnKey; + } + + public void setTxnKey(String txnKey) { + this.txnKey = txnKey; + } + + public PaysprintTwoFactorRequestData getData() { + return data; + } + + public void setData(PaysprintTwoFactorRequestData data) { + this.data = data; + } + +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorRequestData.java b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorRequestData.java new file mode 100644 index 0000000..ca97359 --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorRequestData.java @@ -0,0 +1,70 @@ +package in.aepssdkssz.network.model.paysprint; + +import java.io.Serializable; + +public class PaysprintTwoFactorRequestData implements Serializable { + + private String latitude; + private String longitude; + private String adhaarnumber; + private String mobilenumber; + private String ipaddress; + private String accessmodetype; + private String data; + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getAdhaarnumber() { + return adhaarnumber; + } + + public void setAdhaarnumber(String adhaarnumber) { + this.adhaarnumber = adhaarnumber; + } + + public String getMobilenumber() { + return mobilenumber; + } + + public void setMobilenumber(String mobilenumber) { + this.mobilenumber = mobilenumber; + } + + public String getIpaddress() { + return ipaddress; + } + + public void setIpaddress(String ipaddress) { + this.ipaddress = ipaddress; + } + + public String getAccessmodetype() { + return accessmodetype; + } + + public void setAccessmodetype(String accessmodetype) { + this.accessmodetype = accessmodetype; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorResponse.java b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorResponse.java new file mode 100644 index 0000000..5dbc28e --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorResponse.java @@ -0,0 +1,35 @@ +package in.aepssdkssz.network.model.paysprint; + +import com.google.gson.annotations.SerializedName; + +public class PaysprintTwoFactorResponse { + private String message; + @SerializedName("Status") + private String status; + + private PaysprintTwoFactorResponseData data; + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public PaysprintTwoFactorResponseData getData() { + return data; + } + + public void setData(PaysprintTwoFactorResponseData data) { + this.data = data; + } +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorResponseData.java b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorResponseData.java new file mode 100644 index 0000000..839a8d6 --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/network/model/paysprint/PaysprintTwoFactorResponseData.java @@ -0,0 +1,25 @@ +package in.aepssdkssz.network.model.paysprint; + +import com.google.gson.annotations.SerializedName; + +public class PaysprintTwoFactorResponseData { + + private String message; + private String errorcode; + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getErrorcode() { + return errorcode; + } + + public void setErrorcode(String errorcode) { + this.errorcode = errorcode; + } +} diff --git a/aepssdkssz/src/main/java/com/aepssdkssz/paysprint/PSAePSTwoFactorFragment.java b/aepssdkssz/src/main/java/com/aepssdkssz/paysprint/PSAePSTwoFactorFragment.java new file mode 100644 index 0000000..78936d8 --- /dev/null +++ b/aepssdkssz/src/main/java/com/aepssdkssz/paysprint/PSAePSTwoFactorFragment.java @@ -0,0 +1,420 @@ +package in.aepssdkssz; + +import android.annotation.SuppressLint; +import android.app.Dialog; +import android.app.ProgressDialog; +import android.content.Context; +import android.content.Intent; +import android.graphics.Color; +import android.graphics.drawable.ColorDrawable; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; +import android.view.inputmethod.InputMethodManager; +import android.widget.AdapterView; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RadioButton; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import com.aepssdkssz.R; +import com.chivorn.smartmaterialspinner.SmartMaterialSpinner; +import com.google.android.material.textfield.TextInputLayout; +import com.google.zxing.integration.android.IntentIntegrator; +import com.google.zxing.integration.android.IntentResult; + +import org.json.JSONException; +import org.json.JSONObject; +import org.json.XML; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import in.aepssdkssz.dialog.SSZAePSDeviceSearchDialogFrag; +import in.aepssdkssz.fingpay.model.FingpayUserRequest; +import in.aepssdkssz.fingpay.model.FingpayUserRequestData; +import in.aepssdkssz.fingpay.model.fingpayonboard.FingpayOnboardResponse; +import in.aepssdkssz.network.SSZAePSRetrofitClient; +import in.aepssdkssz.network.model.BiometricDevice; +import in.aepssdkssz.network.model.paysprint.PaysprintTwoFactorRequest; +import in.aepssdkssz.network.model.paysprint.PaysprintTwoFactorRequestData; +import in.aepssdkssz.network.model.paysprint.PaysprintTwoFactorResponse; +import in.aepssdkssz.util.Constants; +import in.aepssdkssz.util.DialogProgressFragment; +import in.aepssdkssz.util.Utility; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import static android.content.Context.INPUT_METHOD_SERVICE; + +/** + * A placeholder fragment containing a simple view. + */ +public class PSAePSTwoFactorFragment extends Fragment { + + private SmartMaterialSpinner sp_aeps_bank_type; + private Button kyc_btn_send; + private String source_ip="",xmlData="",twoFactorType="Registration",title="AePS Two Factor Registration"; + private String psTwofactorReg="0",psTwofactorAuth="0"; + private String biometricFormat; + private String device_type; + private StringBuilder reportData; + private BiometricDevice selectedBiometricDevice; + private ProgressDialog progressDialog; + private ImageView ssz_iv_fingerprint; + private List modelList; + private TextView cv_capture_score,tv_two_factor_title,tv_select_device; + private String aadhar_number, encodeFPTxnId, primaryKeyId,bankType=""; + private LinearLayout ll_select_device,ll_two_factor; + private TextInputLayout til_aadhar_number; + private RadioButton ssz_rb_morph; + private List bankTypeList; + + public static PSAePSTwoFactorFragment newInstance(int index) { + PSAePSTwoFactorFragment fragment = new PSAePSTwoFactorFragment(); + Bundle bundle = new Bundle(); + fragment.setArguments(bundle); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + + + } + + @Override + public View onCreateView( + @NonNull LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + return inflater.inflate(R.layout.ps_aeps_two_factor_frag, container, false); + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + initViews(view); + } + + private void initViews(View view) { + + ll_two_factor = view.findViewById(R.id.ll_two_factor); + ssz_iv_fingerprint= view.findViewById(R.id.ssz_iv_fingerprint); + cv_capture_score = view.findViewById(R.id.ssz_cv_capture_score); + kyc_btn_send = view.findViewById(R.id.kyc_btn_send); + sp_aeps_bank_type = view.findViewById(R.id.ssz_sp_aeps_bank_type); + ssz_rb_morph = view.findViewById(R.id.ssz_rb_morph); + til_aadhar_number = view.findViewById(R.id.til_aadhar_number); + tv_two_factor_title = view.findViewById(R.id.tv_two_factor_title); + ll_select_device = view.findViewById(R.id.ll_select_device); + tv_select_device = view.findViewById(R.id.tv_select_device); + + device_type = Utility.getData(requireActivity(),Constants.DEVICE_TYPE); + if(device_type!=null && !"".equalsIgnoreCase(device_type)) { + tv_select_device.setText(device_type); + Utility.setTextViewBG_TextColor(tv_select_device, true); + ssz_rb_morph.setText(device_type); + }else { + device_type="MANTRA"; + ssz_rb_morph.setText(device_type); + tv_select_device.setText(device_type); + Utility.setTextViewBG_TextColor(tv_select_device, true); + } + bankTypeList = Arrays.asList(getResources().getStringArray(R.array.ssz_ps_aeps_bank)); + sp_aeps_bank_type.setItem(bankTypeList); + sp_aeps_bank_type.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView parent, View view, int position, long id) { + if (position>-1){ + bankType = bankTypeList.get(position); + }else { + bankType=""; + } + } + + @Override + public void onNothingSelected(AdapterView parent) { + + } + }); + + ll_select_device.setOnClickListener(view17 -> { + SSZAePSDeviceSearchDialogFrag dialogFrag = SSZAePSDeviceSearchDialogFrag.newInstance(biometricDevice -> { + tv_select_device.setText(biometricDevice.getDevice_name()); + Utility.setTextViewBG_TextColor(tv_select_device, true); + device_type = biometricDevice.getDevice_type(); + ssz_rb_morph.setText(biometricDevice.getDevice_type()); + }); + dialogFrag.show(requireActivity().getSupportFragmentManager(), "Search Device"); + }); + + + kyc_btn_send.setOnClickListener(v -> { + + aadhar_number = Objects.requireNonNull(til_aadhar_number.getEditText()).getText().toString().trim(); + if( bankType==null || "".equalsIgnoreCase(bankType)){ + Utility.toast(requireActivity(),"Select provider bank type"); + } + else if(aadhar_number == null || "".equalsIgnoreCase(aadhar_number)){ + Utility.toast(requireActivity(),"Enter aadhaar number"); + }else if(device_type==null || "".equalsIgnoreCase(device_type)){ + Utility.toast(requireActivity(),"Select device type"); + }else { + captureFingurePrint(); + } + }); + Utility.showView(ll_two_factor); + psTwofactorReg = Utility.getData(requireActivity(),Constants.PS_TWO_FACTOR_REG); + psTwofactorAuth = Utility.getData(requireActivity(),Constants.PS_TWO_FACTOR_AUTH); + if("0".equalsIgnoreCase(psTwofactorReg)) { + title = "AePS Two Factor Registration"; + twoFactorType = "Registration"; + }else if("0".equalsIgnoreCase(psTwofactorAuth)) { + title = "AePS Two Factor Authentication"; + twoFactorType = "Authenticate"; + }else{ + title = "Daily KYC Already Completed"; + Utility.hideView(ll_two_factor); + } + tv_two_factor_title.setText(title); + } + + public void captureFingurePrint(){ + try { + Utility.setCaptureFingerED(ssz_iv_fingerprint, false); + + if (this.getActivity() != null) { + final Intent intent = ((SSZAePSHomeActivity) this.getActivity()).checkBiometricProvider(this.device_type, this.biometricFormat); + Utility.loge("Device App", Utility.getStringFromModel(intent)); + if (intent != null) { + this.startActivityForResult(intent, ((SSZAePSHomeActivity) this.getActivity()).getRequestCode()); + } + } else { + Utility.setCaptureFingerED(ssz_iv_fingerprint, true); + } + + } catch (Exception e) { + Utility.showMessageDialogue((Context) this.getActivity(), "EXCEPTION- " + e.getMessage(), "EXCEPTION"); + Utility.setCaptureFingerED(ssz_iv_fingerprint, true); + } + } + + public void onActivityResult(final int requestCode, final int resultCode, final Intent data) { + Utility.setCaptureFingerED(ssz_iv_fingerprint, true); + + final IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data); + if (result != null) { + + if (result.getContents() == null) { + Toast.makeText((Context) this.getActivity(), (CharSequence) "Result Not Found", Toast.LENGTH_LONG).show(); + } else { + try { + + final JSONObject jsonObjData = XML.toJSONObject(result.getContents()); + final JSONObject json = jsonObjData.getJSONObject("PrintLetterBarcodeData"); + final String uid = json.getString("uid"); + //this.etAadhaarNo.getEditText().setText((CharSequence)uid); + } catch (JSONException e) { + e.printStackTrace(); + Toast.makeText((Context) this.getActivity(), (CharSequence) "Invalid QR Code", Toast.LENGTH_LONG).show(); + } + } + } else { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == 1000) { + if (resultCode == -1) { + // this.fragmentBecameVisible(); + } + } else if (requestCode == 1100) { + if (this.getActivity() != null) { + final Intent intent = ((SSZAePSHomeActivity) this.getActivity()).verifyActivityResult(requestCode, data, this.biometricFormat); + if (intent != null) { + this.startActivityForResult(intent, ((SSZAePSHomeActivity) this.getActivity()).getRequestCode()); + } else { + Utility.toast(requireActivity(), "Some error occurred!"); + Utility.setCaptureFingerED(ssz_iv_fingerprint, true); + } + } + } else if (requestCode == 1200 || requestCode == 1500 || requestCode == 3500 || requestCode == 4500 || requestCode == 5500 || requestCode == 1300) { + final String pidData = data.getStringExtra("PID_DATA"); + if (pidData != null) { + + try { + final JSONObject jsonObjPidData = XML.toJSONObject(pidData); + xmlData=pidData; + jsonObjPidData.put("xmlData",pidData); + final JSONObject jsonPid = jsonObjPidData.getJSONObject("PidData"); + final JSONObject jsonResp = jsonPid.getJSONObject("Resp"); + + cv_capture_score.setText(jsonResp.optString("errInfo")+" Score is "+jsonResp.optString("qScore")+"%"); + cv_capture_score.setVisibility(View.VISIBLE); + final String errCode = jsonResp.getString("errCode"); + if (this.getActivity() != null) { + ((SSZAePSHomeActivity) this.getActivity()).updatePidJson(jsonObjPidData); + } + if (errCode.equals("0")) { + + doBiometricKyc(); + + } else if (jsonResp.has("errInfo")) { + final String errInfo = jsonResp.getString("errInfo"); + if (!TextUtils.isEmpty((CharSequence) errInfo)) { + Utility.toast(requireActivity(), errInfo); + } + } + } catch (JSONException e2) { + this.reportData.append("Excep message: "); + this.reportData.append(e2.getMessage()); + this.reportData.append(", Cause: "); + this.reportData.append(e2.getMessage()); + Utility.sendReportEmail((Context) this.getActivity(), "onActivityResultCW()", this.reportData.toString()); + this.reportData.setLength(0); + e2.printStackTrace(); + } + } else { + Utility.showMessageDialogue((Context) this.getActivity(), "Empty Response!", "PID DATA XML"); + } + } else if (resultCode == 0) { + Utility.showMessageDialogue((Context) this.getActivity(), "Scan Failed/Aborted!", "CAPTURE RESULT"); + Utility.setCaptureFingerED(ssz_iv_fingerprint, true); + } else { + Utility.showMessageDialogue((Context) this.getActivity(), "Please Connect Device", "RESULT"); + Utility.setCaptureFingerED(ssz_iv_fingerprint, true); + } + final View view = this.requireActivity().getCurrentFocus(); + hideKeyboard(view); + } + } + + private void doBiometricKyc() { + if (Utility.checkConnection(requireActivity())) { + DialogProgressFragment pd = DialogProgressFragment.newInstance("Loading. Please wait...", "Validating KYC..."); + DialogProgressFragment.showDialog(pd, getChildFragmentManager()); + PaysprintTwoFactorRequest req = new PaysprintTwoFactorRequest(); + req.setTxnKey(Utility.getData(requireActivity(), Constants.TOKEN)); + req.setAgentId(Utility.getData(requireActivity(), Constants.MERCHANT_ID)); + req.setBankPipe(bankType); + PaysprintTwoFactorRequestData data=new PaysprintTwoFactorRequestData(); + + data.setAdhaarnumber(aadhar_number); + data.setMobilenumber(Utility.getData(requireActivity(),Constants.MERCHANT_MOBILE)); + data.setAccessmodetype("APP"); + data.setData(xmlData); + data.setLongitude(Utility.getData(requireActivity(), Constants.LONGITUDE)); + data.setLatitude(Utility.getData(requireActivity(), Constants.LATITUDE)); + data.setIpaddress(Utility.getData(requireActivity(), Constants.SOURCE_IP)); + + req.setData(data); + + String url=""; + if("Registration".equalsIgnoreCase(twoFactorType)) { + url="aeps/kyc/Twofactorkyc/registration"; + }else{ + url="aeps/kyc/Twofactorkyc/authentication"; + } + + SSZAePSRetrofitClient.getClient(requireActivity()) + .psTwoFactorAuth(url,req).enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + try { + pd.dismiss(); + if (response.isSuccessful() && response.body() != null) { + PaysprintTwoFactorResponse res = response.body(); + if(res.getData()!=null) { + String errorcode=res.getData().getErrorcode(); + if("0".equalsIgnoreCase(errorcode)) { + if("Registration".equalsIgnoreCase(twoFactorType)) { + title = "AePS Two Factor Authentication"; + twoFactorType = "Authenticate"; + }else if("Authenticate".equalsIgnoreCase(twoFactorType)) { + title = "Notification"; + twoFactorType = "AePS"; + }else { + title = "AePS Two Factor Registration"; + twoFactorType = "Registration"; + } + }else { + if("Registration".equalsIgnoreCase(twoFactorType)) { + title = "AePS Two Factor Registration"; + twoFactorType = "Registration"; + }else if("Authenticate".equalsIgnoreCase(twoFactorType)) { + title = "AePS Two Factor Authentication"; + twoFactorType = "Authenticate"; + } + } + }else { + if("Registration".equalsIgnoreCase(twoFactorType)) { + title = "AePS Two Factor Registration"; + twoFactorType = "Registration"; + }else if("Authenticate".equalsIgnoreCase(twoFactorType)) { + title = "AePS Two Factor Authentication"; + twoFactorType = "Authenticate"; + } + } + showConfirmationDialog(res.getMessage(),res.getStatus()); + }else{ + Utility.toast(requireActivity(), "Technical failure"); + } + } catch (Exception e) { + Utility.toast(requireActivity(), "Parser Error : " + e.getLocalizedMessage()); + Utility.loge("Parser Error", e.getLocalizedMessage()); + } + } + + @Override + public void onFailure(Call call, Throwable t) { + Utility.toast(requireActivity(), "Error : " + t.getLocalizedMessage()); + pd.dismiss(); + } + }); + } + } + + //Confirmation Dialog + private void showConfirmationDialog(String msg,String statusCode) { + // TODO Auto-generated method stub + @SuppressLint("PrivateResource") final Dialog d = new Dialog(requireActivity(), R.style.AppCompatAlertDialogStyle); + d.setCancelable(false); + Objects.requireNonNull(d.getWindow()).requestFeature(Window.FEATURE_NO_TITLE); + d.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN); + d.setContentView(R.layout.ssz_aeps_confirmation_dialog); + d.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); + + final Button btnSubmit = d.findViewById(R.id.btn_push_submit); + final Button btnClosed = d.findViewById(R.id.close_push_button); + //Utility.hideView(btnClosed); + final TextView tvConfirmation = d.findViewById(R.id.tv_confirmation_dialog); + tvConfirmation.setText(msg); + + btnSubmit.setOnClickListener(v -> { + d.cancel(); + }); + btnClosed.setOnClickListener(v -> { + d.cancel(); + }); + d.show(); + } + + private void hideKeyboard(View view) { + if (view != null) { + final InputMethodManager imm = (InputMethodManager) this.requireActivity().getSystemService(INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(view.getWindowToken(), 0); + } + } + +} \ No newline at end of file diff --git a/aepssdkssz/src/main/res/layout/eko_aeps_biometric_kyc_frag.xml b/aepssdkssz/src/main/res/layout/eko_aeps_biometric_kyc_frag.xml new file mode 100644 index 0000000..cd87dbe --- /dev/null +++ b/aepssdkssz/src/main/res/layout/eko_aeps_biometric_kyc_frag.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +