Esempio n. 1
0
 public IHttpActionResult Getorders(VisaCheckOut.Models.VisaCheckoutInputs.OrdersInp.GetordersInp obj)
 {
     Models.DTO <VisaCheckOut.Models.VisaCheckoutOutputs.OrderOut.OrdersDTO> dto = new Models.DTO <Models.VisaCheckoutOutputs.OrderOut.OrdersDTO>();
     try
     {
         dto = ord.Getorders(obj);
     }
     catch (Exception ex)
     {
     }
     return(Ok(dto));
 }
        public async Task <IHttpActionResult> GetClientUsers([FromUri] string externalClientId)
        {
            Models.DTO <GetClientUsersDTO> dto = new Models.DTO <GetClientUsersDTO>();
            VisaCheckOut.Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput inp = new Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput();
            string useriD       = System.Web.HttpContext.Current.User.Identity.GetUserId();
            var    currentRoles = await this.AppUserManager.GetRolesAsync(useriD);

            inp.UserId   = useriD;
            inp.RoleName = currentRoles;
            try
            {
                dto = cum.GetClientUsers(externalClientId);
            }
            catch (Exception ex)
            {
            }
            return(Ok(dto));
        }
        public async Task <IHttpActionResult> UpdateClientProfile([FromUri] string externalClientId, [FromUri] string externalProfileId, VisaCheckOut.Models.VisaCheckoutInputs.ClientProfileManagementInp.UpdateClientProfileInp inp)
        {
            Models.DTO <VisaCheckOut.Models.VisaCheckoutOutputs.ClientProfileManagementOut.UpdateClientProfileDTO> dto = new Models.DTO <Models.VisaCheckoutOutputs.ClientProfileManagementOut.UpdateClientProfileDTO>();
            VisaCheckOut.Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput inps = new Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput();
            string useriD       = System.Web.HttpContext.Current.User.Identity.GetUserId();
            var    currentRoles = await this.AppUserManager.GetRolesAsync(useriD);

            inps.UserId   = useriD;
            inps.RoleName = currentRoles;
            try
            {
                if (inp != null)
                {
                    dto = usermgt.UpdateClientProfile(externalClientId, externalProfileId, inp);
                }
            }
            catch (Exception ex)
            {
            }
            return(Ok(dto));
        }
        public IHttpActionResult GetSpecificClientProfile([FromUri] string externalClientId, [FromUri] string externalProfileId)
        {
            Models.DTO <VisaCheckOut.Models.VisaCheckoutOutputs.ClientProfileManagementOut.GetSpecificClientProfileDTO> dto = new Models.DTO <Models.VisaCheckoutOutputs.ClientProfileManagementOut.GetSpecificClientProfileDTO>();

            try
            {
                dto = usermgt.GetSpecificClientProfile(externalClientId, externalProfileId);
            }
            catch (Exception ex)
            {
            }
            return(Ok(dto));
        }
        public async Task <IHttpActionResult> GetClientProfiles([FromUri] string externalClientId)
        {
            VisaCheckOut.Models.DTO <VisaCheckOut.Models.VisaCheckoutOutputs.ClientProfileManagementOut.GetClientProfilesDTO> dto = new Models.DTO <Models.VisaCheckoutOutputs.ClientProfileManagementOut.GetClientProfilesDTO>();
            VisaCheckOut.Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput inp = new Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput();
            string useriD       = System.Web.HttpContext.Current.User.Identity.GetUserId();
            var    currentRoles = await this.AppUserManager.GetRolesAsync(useriD);

            inp.UserId   = useriD;
            inp.RoleName = currentRoles;
            try
            {
                dto = usermgt.GetClientProfiles(externalClientId);
            }
            catch (Exception ex)
            {
            }
            return(Ok(dto.response.profiles.OrderByDescending(a => a.created)));
        }
Esempio n. 6
0
        public async Task <IHttpActionResult> UpdateUser([FromUri] string username, VisaCheckOut.Models.VisaCheckoutInputs.UserManagementInp.CreateUserInp inp)
        {
            Models.DTO <VisaCheckOut.Models.VisaCheckoutOutputs.UserManagementOut.CreateUserDTO> res  = new Models.DTO <Models.VisaCheckoutOutputs.UserManagementOut.CreateUserDTO>();
            VisaCheckOut.Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput           inps = new Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput();
            string useriD       = System.Web.HttpContext.Current.User.Identity.GetUserId();
            var    currentRoles = await this.AppUserManager.GetRolesAsync(useriD);

            inps.UserId   = useriD;
            inps.RoleName = currentRoles;
            try
            {
                res = usermgt.UpdateUser(username, inp);
            }
            catch (Exception ex)
            {
            }
            return(Ok(res));
        }
        public DTO <PINDTO> Pin(Models.Input <PIN> obj)
        {
            Models.DTO <PINDTO> dto = new Models.DTO <PINDTO>();
            PINDTO resp             = new PINDTO();

            dto.objname = "Pin";
            try
            {
                /* Check required parameters */
                if (string.IsNullOrEmpty(obj.input.username) || string.IsNullOrEmpty(obj.input.password) || string.IsNullOrEmpty(obj.input.authkey) || string.IsNullOrEmpty(obj.input.msisdn))
                {
                    dto.status = new Models.Status(800);
                    return(dto);
                }

                if (!(string.IsNullOrEmpty(obj.input.PaymentID)))
                {
                    obj.input.service = getService(Convert.ToInt32(obj.input.PaymentID));
                }

                Authentication ar   = new Authentication();
                string         hash = ar.UserAuth(obj.input.msisdn, obj.input.service);

                string     uri    = ConfigurationManager.AppSettings["oneglobalDOB"].ToString();
                string     url    = uri + "/Pin";
                HttpClient client = new HttpClient();
                client.BaseAddress = new Uri(url);
                if (url != null)
                {
                    try
                    {
                        JavaScriptSerializer jdes = new JavaScriptSerializer();
                        var reqObj = new PIN();

                        reqObj.username = obj.input.username;
                        reqObj.password = obj.input.password;
                        reqObj.authkey  = obj.input.authkey;
                        reqObj.service  = obj.input.service;
                        reqObj.hash     = hash;
                        reqObj.msisdn   = obj.input.msisdn;
                        reqObj.language = obj.input.language;
                        reqObj.template = obj.input.template;
                        reqObj.appuser  = "******";

                        Input <PIN> inp = new Input <PIN>();
                        inp.input = reqObj;

                        client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                        client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");

                        HttpResponseMessage response = client.PostAsJsonAsync(url, inp).Result;

                        if (response.IsSuccessStatusCode)
                        {
                            if (response != null)
                            {
                                Task <String> ss     = response.Content.ReadAsStringAsync();
                                var           result = JsonConvert.DeserializeObject <Models.DTO <PINDTO> >(ss.Result);

                                if (result != null)
                                {
                                    dto.response = result.response;
                                    dto.status   = result.status;
                                    return(dto);
                                }
                            }
                        }
                    }
                    catch (HttpRequestException e)
                    {
                        Console.WriteLine(e.Message);
                    }
                }
            }
            catch (Exception ex)
            {
                dto.status = new Models.Status(1);
            }
            return(dto);
        }
Esempio n. 8
0
 public IHttpActionResult PaymentdataInfo([FromUri] string Callid)
 {
     Models.DTO <List <VisaCheckOut.Models.VisaCheckoutOutputs.GetPaymentDataOut.PaymentDataDTO> > dto = new Models.DTO <List <Models.VisaCheckoutOutputs.GetPaymentDataOut.PaymentDataDTO> >();
     try
     {
         dto = paymentdata.PaymentInfo(Callid);
     }
     catch (Exception ex)
     {
     }
     return(Ok(dto));
 }
Esempio n. 9
0
        public IHttpActionResult UpdateAPIKey([FromUri] string externalClientId, [FromUri] string key, [FromBody] VisaCheckOut.Models.VisaCheckoutInputs.KeyManagementInp.UpdateAPIKeyInp inp)
        {
            Models.DTO <VisaCheckOut.Models.VisaCheckoutOutputs.KeyManagementOut.UpdateAPIKeyDTO> dto = new Models.DTO <Models.VisaCheckoutOutputs.KeyManagementOut.UpdateAPIKeyDTO>();

            try
            {
                dto = keymgt.UpdateClientAPIKey(externalClientId, key, inp);
            }
            catch (Exception ex)
            {
            }
            return(Ok(dto));
        }
Esempio n. 10
0
        public async Task <IHttpActionResult> CreateClientAPIKey([FromUri] string externalClientId)
        {
            Models.DTO <Models.VisaCheckoutOutputs.KeyManagementOut.ClientAPIKeyDTO>   capikeys = new Models.DTO <Models.VisaCheckoutOutputs.KeyManagementOut.ClientAPIKeyDTO>();
            VisaCheckOut.Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput inp      = new Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput();
            string useriD       = System.Web.HttpContext.Current.User.Identity.GetUserId();
            var    currentRoles = await this.AppUserManager.GetRolesAsync(useriD);

            inp.UserId   = useriD;
            inp.RoleName = currentRoles;
            try
            {
                capikeys = keymgt.CreateClientAPIKey(externalClientId);
            }
            catch (Exception ex)
            {
            }
            return(Ok(capikeys));
        }
        public async Task <IHttpActionResult> UpdateAPIKey([FromUri] string apikey, [FromBody] VisaCheckOut.Models.VisaCheckoutInputs.KeyManagementInp.UpdateAPIKeyInp inps)
        {
            Models.DTO <VisaCheckOut.Models.VisaCheckoutOutputs.KeyManagementOut.UpdateAPIKeyDTO> dto = new Models.DTO <Models.VisaCheckoutOutputs.KeyManagementOut.UpdateAPIKeyDTO>();
            VisaCheckOut.Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput            inp = new Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput();
            string useriD       = System.Web.HttpContext.Current.User.Identity.GetUserId();
            var    currentRoles = await this.AppUserManager.GetRolesAsync(useriD);

            inp.UserId   = useriD;
            inp.RoleName = currentRoles;
            try
            {
                dto = keymgt.UpdateAPIKey(apikey, inps);
            }
            catch (Exception ex)
            {
            }
            return(Ok(dto));
        }
        public IHttpActionResult GetAPIKeyDetails([FromUri] string apikey)
        {
            Models.DTO <VisaCheckOut.Models.VisaCheckoutOutputs.KeyManagementOut.ClientAPIKeyDTO> res = new Models.DTO <Models.VisaCheckoutOutputs.KeyManagementOut.ClientAPIKeyDTO>();

            try
            {
                res = keymgt.GetAPIKeyDetails(apikey);
            }
            catch (Exception ex)
            {
            }
            return(Ok(res));
        }
 public IHttpActionResult GetSpecificCheckoutProfile([FromUri] string externalProfileID)
 {
     Models.DTO <VisaCheckOut.Models.VisaCheckoutOutputs.ProfileManagementOut.GetSpecificCheckoutProfileDTO> res = new Models.DTO <Models.VisaCheckoutOutputs.ProfileManagementOut.GetSpecificCheckoutProfileDTO>();
     try
     {
         res = profilemgt.GetSpecificCheckoutProfile(externalProfileID);
     }
     catch (Exception ex)
     {
     }
     return(Ok(res));
 }
        public async Task <IHttpActionResult> GetAllProfiles()
        {
            Models.DTO <VisaCheckOut.Models.VisaCheckoutOutputs.ProfileManagementOut.GetAllProfilesDTO> res = new Models.DTO <Models.VisaCheckoutOutputs.ProfileManagementOut.GetAllProfilesDTO>();
            VisaCheckOut.Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput inp = new Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput();
            string useriD       = System.Web.HttpContext.Current.User.Identity.GetUserId();
            var    currentRoles = await this.AppUserManager.GetRolesAsync(useriD);

            inp.UserId   = useriD;
            inp.RoleName = currentRoles;
            try
            {
                res = profilemgt.GetAllProfiles();
            }
            catch (Exception ex)
            {
            }
            return(Ok(res));
        }
Esempio n. 15
0
        public async Task <IHttpActionResult> Gettransactiondata()
        {
            Models.DTO <List <VisaCheckOut.Models.VisaCheckoutOutputs.GetPaymentDataOut.TransactionDTO> > dto = new Models.DTO <List <Models.VisaCheckoutOutputs.GetPaymentDataOut.TransactionDTO> >();
            VisaCheckOut.Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput inp = new Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput();
            string useriD       = System.Web.HttpContext.Current.User.Identity.GetUserId();
            var    currentRoles = await this.AppUserManager.GetRolesAsync(useriD);

            inp.UserId   = useriD;
            inp.RoleName = currentRoles;
            try
            {
                dto = paymentdata.Gettransactiondata(inp);
            }
            catch (Exception ex)
            {
            }
            return(Ok(dto));
        }
Esempio n. 16
0
        public async Task <IHttpActionResult> UpdateRelationship([FromUri] string externalclientId, VisaCheckOut.Models.VisaCheckoutInputs.RelationshipManagementInp.Update_RelationshipInp inp)
        {
            Models.DTO <VisaCheckOut.Models.VisaCheckoutOutputs.RelationshipManagementOut.GetRelationshipsDTO> dto = new Models.DTO <GetRelationshipsDTO>();
            VisaCheckOut.Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput inps = new Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput();
            string useriD       = System.Web.HttpContext.Current.User.Identity.GetUserId();
            var    currentRoles = await this.AppUserManager.GetRolesAsync(useriD);

            inps.UserId   = useriD;
            inps.RoleName = currentRoles;
            try
            {
                dto = relarionship.UpdateRelationship(externalclientId, inp);
            }
            catch (Exception ex)
            {
            }
            return(Ok(dto));
        }
Esempio n. 17
0
        public async Task <IHttpActionResult> CreateNewClient(VisaCheckOut.Models.VisaCheckoutInputs.RelationshipManagementInp.ClientOnboardingInp inp)
        {
            VisaCheckOut.Models.DTO <VisaCheckOut.Models.VisaCheckoutOutputs.RelationshipManagementOut.ClientOnboardingDTO> dto = new Models.DTO <ClientOnboardingDTO>();
            VisaCheckOut.Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput inps = new Models.VisaCheckoutInputs.RelationshipManagementInp.UserInput();
            string useriD       = System.Web.HttpContext.Current.User.Identity.GetUserId();
            var    currentRoles = await this.AppUserManager.GetRolesAsync(useriD);

            inps.UserId   = useriD;
            inps.RoleName = currentRoles;
            try
            {
                Errordetail err = new Errordetail();
                dto = relarionship.CreateNewClient(inp);
                if (dto.response.message == "Created")
                {
                    return(Ok(dto));
                }
            }
            catch (Exception ex)
            {
                return(Ok(dto));
            }
            return(Ok(dto));
        }
        public Models.DTO <Models.Outputs.OneInOutputs.SaveAddressDTO> SaveAddress(Models.OneinInput <Models.Inputs.OneInInputs.SaveAddress> obj)
        {
            Models.DTO <Models.Outputs.OneInOutputs.SaveAddressDTO> dto = new Models.DTO <Models.Outputs.OneInOutputs.SaveAddressDTO>();
            Models.Outputs.OneInOutputs.SaveAddressDTO resp             = new Models.Outputs.OneInOutputs.SaveAddressDTO();
            dto.objname = "SaveAddress";
            try
            {
                if (string.IsNullOrEmpty(obj.param.appusername) || string.IsNullOrEmpty(obj.param.apppassword) || string.IsNullOrEmpty(obj.param.username) || string.IsNullOrEmpty(obj.param.password))
                {
                    dto.status = new Models.Status(800);
                    return(dto);
                }

                string     uri    = ConfigurationManager.AppSettings["oneinapi"].ToString();
                string     url    = uri + "/SaveAddress";
                HttpClient client = new HttpClient();
                client.BaseAddress = new Uri(url);
                if (url != null)
                {
                    try
                    {
                        JavaScriptSerializer jdes = new JavaScriptSerializer();
                        var reqObj  = new Models.Inputs.OneInInputs.SaveAddress();
                        var reqAddr = new Models.Inputs.OneInInputs.Address();
                        var cominp  = new OneInCommonInputParams();
                        cominp.apppassword    = "******";
                        cominp.appusername    = "******";
                        cominp.deviceuniqueid = obj.param.deviceuniqueid;
                        cominp.username       = obj.param.username;
                        cominp.password       = obj.param.password;
                        cominp.os             = obj.param.os;

                        reqObj.userid = obj.input.userid;
                        reqObj.mobile = obj.input.mobile;

                        reqAddr.alias         = obj.input.address.alias;
                        reqAddr.addressfield1 = obj.input.address.addressfield1;
                        reqAddr.addressfield2 = obj.input.address.addressfield2;
                        reqAddr.country       = obj.input.address.country;
                        reqAddr.pincode       = obj.input.address.pincode;
                        reqObj.address        = reqAddr;

                        OneinInput <Models.Inputs.OneInInputs.SaveAddress> inp = new OneinInput <Models.Inputs.OneInInputs.SaveAddress>();
                        inp.input = reqObj;
                        inp.param = cominp;
                        client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                        client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
                        HttpResponseMessage response = client.PostAsJsonAsync(url, inp).Result;
                        if (response.IsSuccessStatusCode)
                        {
                            if (response != null)
                            {
                                Task <String> ss     = response.Content.ReadAsStringAsync();
                                var           result = JsonConvert.DeserializeObject <Models.DTO <Models.Outputs.OneInOutputs.SaveAddressDTO> >(ss.Result);

                                if (result != null)
                                {
                                    dto.response = result.response;
                                    dto.status   = result.status;
                                    return(dto);
                                }
                            }
                        }
                    }
                    catch (HttpRequestException e)
                    {
                        Console.WriteLine(e.Message);
                    }
                }
            }
            catch (Exception ex)
            {
                dto.status = new Models.Status(1);
            }
            return(dto);
        }