Esempio n. 1
0
        private async Task <bool> GetDataFromMystifly(List <Domain.SelectFlightResponse> list, SelectFlightModel model)
        {
            var supplierAgencyDetails = supplierAgencyServices.GetSupplierRouteBySupplierCodeAndAgencyCode(model.CommonRequestFarePricer.Body.AirRevalidate.ARAgencyCode
                                                                                                           , model.CommonRequestFarePricer.Body.AirRevalidate.ARSupplierCode, "select/flights");
            List <SupplierAgencyDetails> supplierAgencyDetailslist = new List <SupplierAgencyDetails> {
                supplierAgencyDetails
            };

            model.CommonRequestFarePricer.SupplierAgencyDetails = supplierAgencyDetailslist;
            string cardType = bookingServices.GetPaymentCardType(model.CommonRequestFarePricer.Body.AirRevalidate.ARAgencyCode);

            model.CommonRequestFarePricer.Body.AirRevalidate.paymentCardType = cardType;

            string req    = JsonConvert.SerializeObject(model);
            var    result = await partnerClient.Getselectflight(supplierAgencyDetails.BaseUrl, supplierAgencyDetails.RequestUrl, model);

            string strData     = JsonConvert.SerializeObject(result.Data);
            string requestStr  = JsonConvert.SerializeObject(model);
            string responseStr = JsonConvert.SerializeObject(result);
            string agencyCode  = model.CommonRequestFarePricer.Body.AirRevalidate.ARAgencyCode;
            await supplierAgencyServices.SaveLog("Select-Flight", agencyCode, requestStr, responseStr);

            Domain.SelectFlightResponse partnerResponseEntity = JsonConvert.DeserializeObject <Domain.SelectFlightResponse>(strData);
            if (partnerResponseEntity != null)
            {
                list.Add(partnerResponseEntity);
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        private async Task <bool> GetDataFromMystifly(List <Domain.SelectFlightResponse> list, SelectFlightModel model)
        {
            var supplierAgencyDetails = supplierAgencyServices.GetSupplierRouteBySupplierCodeAndAgencyCode(model.CommonRequestFarePricer.Body.AirRevalidate.ARAgencyCode
                                                                                                           , model.CommonRequestFarePricer.Body.AirRevalidate.ARSupplierCode, "select/flights");

            //code to add supplier details in to request
            var allSupplierBasicDetails = await supplierAgencyServices.GetSupplierAgencyBasicDetailswithsuppliercode(model.CommonRequestFarePricer.Body.AirRevalidate.ARAgencyCode, "T", model.CommonRequestFarePricer.Body.AirRevalidate.ARSupplierCode);

            model.SupplierAgencyDetails = allSupplierBasicDetails;



            var result = await partnerClient.Getselectflight(supplierAgencyDetails.BaseUrl, supplierAgencyDetails.RequestUrl, model);

            string strData = JsonConvert.SerializeObject(result.Data);

            Domain.SelectFlightResponse partnerResponseEntity = JsonConvert.DeserializeObject <Domain.SelectFlightResponse>(strData);
            if (partnerResponseEntity != null)
            {
                list.Add(partnerResponseEntity);
                return(true);
            }
            return(false);
        }