public bool SendProductConversion(OnResponse response, ProductConversion productConversion)
        {
            if (loginResp == null)
            {
                return(false);
            }

            productConversion.uid = loginReq.uid;

            string uri             = "ProductConversion";
            var    ResponseHandler = new NorenApiResponse <ProductConversionResponse>(response);

            rClient.makeRequest(ResponseHandler, uri, productConversion.toJson(), getJKey);
            return(true);
        }
        public bool SendForgotPassword(OnResponse response, string endpoint, string user, string pan, string dob)
        {
            ForgotPassword forgotPassword = new ForgotPassword();

            forgotPassword.uid = user;
            forgotPassword.pan = pan;
            forgotPassword.dob = dob;

            string uri = "ForgotPassword";

            rClient.endPoint = endpoint;
            var ResponseHandler = new NorenApiResponse <ForgotPasswordResponse>(response);

            rClient.makeRequest(ResponseHandler, uri, forgotPassword.toJson());
            return(true);
        }
        public bool Changepwd(OnResponse response, Changepwd changepwd)
        {
            if (loginResp == null)
            {
                return(false);
            }


            changepwd.uid    = loginReq.uid;
            changepwd.oldpwd = ComputeSha256Hash(changepwd.oldpwd);
            string uri             = "Changepwd";
            var    ResponseHandler = new NorenApiResponse <ChangepwdResponse>(response);

            rClient.makeRequest(ResponseHandler, uri, changepwd.toJson());
            return(true);
        }
        /// <summary>
        /// Logout the current user
        /// </summary>
        /// <param name="response"></param>
        /// <returns></returns>
        public bool SendLogout(OnResponse response)
        {
            if (loginResp == null)
            {
                return(false);
            }

            LogoutMessage logout = new LogoutMessage();

            logout.uid = loginReq.uid;

            string uri             = "Logout";
            var    ResponseHandler = new NorenApiResponse <LogoutResponse>(response);

            rClient.makeRequest(ResponseHandler, uri, logout.toJson(), getJKey);
            return(true);
        }
        /// <summary>
        /// This should be the first request. No further requests to be sent before login success
        /// </summary>
        /// <param name="response"></param>
        /// <param name="endPoint"></param>
        /// <param name="login"></param>
        /// <returns></returns>
        public bool SendLogin(OnResponse response, string endPoint, LoginMessage login)
        {
            loginReq  = login;
            login.pwd = ComputeSha256Hash(login.pwd);


            login.appkey = ComputeSha256Hash(login.uid + "|" + login.appkey);

            rClient.endPoint = endPoint;
            string uri             = "QuickAuth";
            var    ResponseHandler = new NorenApiResponse <LoginResponse>(response);

            ResponseHandler.ResponseNotifyInstance += OnLoginResponseNotify;


            rClient.makeRequest(ResponseHandler, uri, login.toJson());
            return(true);
        }