Beispiel #1
0
        public IHttpActionResult walletpay(dynamic data)
        {
            string           serialized_data = JsonConvert.SerializeObject(data);
            MakePaymentModel rootobj         = JsonConvert.DeserializeObject <MakePaymentModel>(serialized_data);

            Decryptdatamodel decryptModel = new Decryptdatamodel();

            decryptModel.encryprtext = rootobj.encryptedData;
            decryptModel.key         = "3fee5395f01bee349feed65629bd442a";
            decryptModel.Ivval       = rootobj.iv;


            string mappath   = HttpContext.Current.Server.MapPath("MakePayment");
            Task   WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_ReportLog_Exception(mappath, JsonConvert.SerializeObject(rootobj)));

            string       result = EncryptDecryptAlgoritham.DecryptStringAES(decryptModel.encryprtext, decryptModel.key, decryptModel.Ivval);
            paymentModel obj    = JsonConvert.DeserializeObject <paymentModel>(result);

            if (rootobj.type == "TA")
            {
                return(Ok(_Hel.TAWalletMakePayment(obj, rootobj.otp)));
            }
            else if (rootobj.type == "WONE")
            {
                return(Ok(_Hel.walletOnemakePayment(obj)));
            }
            else
            {
                return(Ok("WONE"));
            }
        }
Beispiel #2
0
        public IHttpActionResult OrderDetails(dynamic data)
        {
            dynamic objdata = new ExpandoObject();

            try
            {
                //    byte[] dataArray = Convert.FromBase64String(data);
                //    string decodedString = Encoding.UTF8.GetString(dataArray);
                string           serialized_data = JsonConvert.SerializeObject(data);
                MakePaymentModel rootobj         = JsonConvert.DeserializeObject <MakePaymentModel>(serialized_data);

                //     encryptedData = encryptedData.Replace(' ', '+');
                Decryptdatamodel decryptModel = new Decryptdatamodel();
                decryptModel.encryprtext = rootobj.encryptedData;
                decryptModel.key         = "3fee5395f01bee349feed65629bd442a";
                decryptModel.Ivval       = rootobj.iv;

                string mappath   = HttpContext.Current.Server.MapPath("OrderDetails");
                Task   WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_ReportLog_Exception(mappath, JsonConvert.SerializeObject(decryptModel)));

                string       result = EncryptDecryptAlgoritham.DecryptStringAES(decryptModel.encryprtext, decryptModel.key, decryptModel.Ivval);
                paymentModel obj    = JsonConvert.DeserializeObject <paymentModel>(result);

                return(Ok(_Hel.OrderDetails(obj)));
            }
            catch (Exception ex)
            {
                objdata.status = 500;
                objdata.result = ex.Message.ToString();
            }
            return(Ok(objdata));
        }