Пример #1
0
        /// <summary>
        /// Validate OTP by Request Id.
        /// </summary>
        public async Task <Response.OTPRespone> OTPValidateRequest(string requestid, Object payload)
        {
            HttpResponseMessage response = await Request("otp/requestid", payload, null, requestid, null, "validate");

            Response.OTPRespone otp = new OTPRespone();

            if ((int)response.StatusCode == 200)
            {
                otp = await response.Content.ReadAsAsync <Response.OTPRespone>();
            }

            otp.statuscode    = (int)response.StatusCode;
            otp.statusmessage = response.ReasonPhrase;
            return(otp);
        }
Пример #2
0
        /// <summary>
        /// Cancel OTP by Destination Id.
        /// </summary>
        public async Task <Response.OTPRespone> OTPCancelDestination(string destinationid)
        {
            HttpResponseMessage response = await Request("otp", null, null, destinationid, null, "cancel");

            Response.OTPRespone otp = new OTPRespone();

            if ((int)response.StatusCode == 200)
            {
                otp = await response.Content.ReadAsAsync <Response.OTPRespone>();
            }

            otp.statuscode    = (int)response.StatusCode;
            otp.statusmessage = response.ReasonPhrase;
            return(otp);
        }
Пример #3
0
        /// <summary>
        /// Sends an OTP message.
        /// </summary>
        public async Task <Response.OTPRespone> sendOTP(Object payload)
        {
            HttpResponseMessage response = await Request("otp", payload);

            Response.OTPRespone otp = new OTPRespone();

            if ((int)response.StatusCode == 200)
            {
                otp = await response.Content.ReadAsAsync <Response.OTPRespone>();
            }

            otp.statuscode    = (int)response.StatusCode;
            otp.statusmessage = response.ReasonPhrase;
            return(otp);
        }