// GET: ApplicationTypes
        public Object PaymentDetails([FromBody] RazorPaymentcs Payment)
        {
            string             sJSONResponse  = "";
            DataTable          dt_AppType     = new DataTable();
            string             ServerDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
            int                a             = 0;
            string             AppType_Query = "";
            PaymentDetailsPost Pdetails      = new PaymentDetailsPost();

            try
            {
                cnn.Open();
                AppType_Query = "insert into PaymentGateway(GatewayProviderName,OrderId,BranchCode,MobileNo,ModeOfPayment,Amount,Currency,receipt,payment_capture,notes,TransactionDate,Signature,CreatedOn,CreatedBy,IsDeleted,IsActive) values('" + Payment.GatewayProviderName + "','" + Payment.OrderId + "','" + Payment.BranchCode + "','" + Payment.MobileNo + "','" + Payment.ModeOfPayment + "','" + Payment.Amount + "','" + Payment.Currency + "','" + Payment.receipt + "','" + Payment.payment_capture + "','" + Payment.notes + "','" + Payment.TransactionDate + "','" + Payment.Signature + "','" + ServerDateTime + "','" + Payment.CreatedBy + "',1,0)  SELECT @@IDENTITY;";
                SqlCommand tm_cmd = new SqlCommand(AppType_Query, cnn);
                a = Convert.ToInt32(tm_cmd.ExecuteScalar());
                Pdetails.status        = "Success";
                Pdetails.transactionId = a;
            }
            catch (Exception ex)
            {
                Pdetails.status = "Fail";
            }
            finally
            {
                cnn.Close();
            }

            sJSONResponse = JsonConvert.SerializeObject(Pdetails);

            return(sJSONResponse);
        }
Пример #2
0
        public Object PaymentDetails([FromBody] RazorPaymentcs Payment)
        {
            string             sJSONResponse  = "";
            DataTable          dt_AppType     = new DataTable();
            string             ServerDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
            int                a             = 0;
            string             AppType_Query = "";
            PaymentDetailsPost Pdetails      = new PaymentDetailsPost();

            try
            {
                cnn.Open();
                AppType_Query = "update PaymentGateway set payment_capture='" + Payment.payment_capture + "',TransactionStatus='" + Payment.TransactionStatus + "',receipt='" + Payment.receipt + "',notes='" + Payment.notes + "',Signature='" + Payment.Signature + "' where OrderId='" + Payment.OrderId + "'  SELECT @@IDENTITY; ";
                SqlCommand tm_cmd = new SqlCommand(AppType_Query, cnn);
                a = Convert.ToInt32(tm_cmd.ExecuteScalar());
                Pdetails.status        = "success";
                Pdetails.transactionId = Payment.TransactionId;
            }
            catch (Exception ex)
            {
                Pdetails.status = "Fail";
            }
            finally
            {
                cnn.Close();
            }

            sJSONResponse = JsonConvert.SerializeObject(Pdetails);

            return(sJSONResponse);
        }
Пример #3
0
        public Object GetMerchantKeyByBranchCode([FromBody] RazorPaymentcs Order)
        {
            //merchant
            string                sJSONResponse  = "";
            DataTable             dt_AppType     = new DataTable();
            string                ServerDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
            MerchantDetailsOutput mdopt          = new MerchantDetailsOutput();

            List <MerchantDetails> mdetails = new List <MerchantDetails>();
            ArrayList MerchantDetails       = GetMarchantKey(Order.BranchCode);

            try
            {
                mdetails.Add(new MerchantDetails {
                    MerchantKey = MerchantDetails[0].ToString(), MerchantSecretKey = MerchantDetails[1].ToString()
                });

                mdopt.value  = mdetails;
                mdopt.status = "success";
            }
            catch (Exception ex)
            {
                mdopt.status = "fail";
            }
            finally
            {
                cnn.Close();
            }

            sJSONResponse = JsonConvert.SerializeObject(mdopt);

            return(sJSONResponse);
        }
Пример #4
0
        public Object GetOrderId1([FromBody] RazorPaymentcs Order)
        {
            string            sJSONResponse  = "";
            DataTable         dt_AppType     = new DataTable();
            string            ServerDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
            int               a             = 0;
            string            AppType_Query = "";
            PaymentDetailsGet Pdetails      = new PaymentDetailsGet();

            string ReceiptNos = ReceiptNo();

            try
            {
                Dictionary <string, object> input = new Dictionary <string, object>();
                input.Add("amount", Order.Amount); // this amount should be same as transaction amount
                input.Add("currency", Order.Currency);
                input.Add("receipt", ReceiptNos);
                input.Add("payment_capture", 1);



                // string key = "rzp_live_1FlbqBOlw7TqHA";
                //string secret = "6UJyvn78r9xNlbckRZZDvqEZ";

                string key    = "rzp_test_51inWTBswRzU37";
                string secret = "u8dI6qRiT8bpvNIdTqvju7bQ";

                RazorpayClient client = new RazorpayClient(key, secret);

                Razorpay.Api.Order order = client.Order.Create(input);
                orderId = order["id"].ToString();

                cnn.Open();
                AppType_Query = "insert into PaymentGateway(GatewayProviderName,OrderId,BranchCode,MobileNo,ModeOfPayment,Amount,Currency,receipt,TransactionDate,CreatedOn,CreatedBy,IsDeleted,IsActive) values('GPN001','" + orderId + "','Brc1101','" + Order.MobileNo + "','OnLine','" + Order.Amount + "','INR','" + ReceiptNos + "','" + Order.TransactionDate + "','" + ServerDateTime + "','" + Order.MobileNo + "',0,1)  SELECT @@IDENTITY;";
                SqlCommand tm_cmd = new SqlCommand(AppType_Query, cnn);
                a = Convert.ToInt32(tm_cmd.ExecuteScalar());

                Pdetails.status  = "success";
                Pdetails.orderId = orderId;
            }
            catch (Exception ex)
            {
                Pdetails.status = "Fail";
            }
            finally
            {
                cnn.Close();
            }

            sJSONResponse = JsonConvert.SerializeObject(Pdetails);

            return(sJSONResponse);
        }
        public Object GetPaymentDetails([FromBody] RazorPaymentcs Payment)
        {
            GetApplicationInfoFail gaif = new GetApplicationInfoFail();

            var json = (object)null;

            try
            {
                DataSet   ds_custdet1         = new DataSet();
                DataTable dt_ApplicationTypes = new DataTable();
                string    query = "select AppTypeId,AppTypeName from ApplicationTypes";

                using (SqlDataAdapter da_custdet = new SqlDataAdapter(query, cnn))
                {
                    da_custdet.Fill(ds_custdet1);
                }
                if (ds_custdet1.Tables[0].Rows.Count > 0)
                {
                    json = Json(Payment, JsonRequestBehavior.AllowGet);
                }
                else
                {
                    gaif.Status   = "Sucess";
                    gaif.Messsage = "No Data";

                    json = Json(gaif, JsonRequestBehavior.AllowGet);
                }
            }
            catch (Exception ec)
            {
                gaif.Status   = "Sucess";
                gaif.Messsage = "Internal Server Error";

                json = Json(gaif, JsonRequestBehavior.AllowGet);
            }
            return(json);
        }