コード例 #1
0
        private void Students_PreparingCellForEdit(object sender, DataGridPreparingCellForEditEventArgs e)
        {
            if ((e.Row.Item as DataRowView).Row[e.Column.DisplayIndex] is Journal &&
                (DataContext as JournalPageVM).SelectedModule.IsClosed == 0)
            {
                (DataContext as JournalPageVM).BeforeCellChangedHandler(e);
            }
            else if (e.Column.Header.ToString() == Constants.BalanceColumnName)
            {
                Students.CancelEdit();
                var student = (e.Row.Item as DataRowView).Row[Constants.StudentColumnName] as Student;

                var paymentVM = new PaymentVM(student);
                DialogService.I.ShowDialog(paymentVM);
                Students.CancelEdit();
            }
            else if (e.Column.Header.ToString() == Constants.StudentColumnName &&
                     (DataContext as JournalPageVM).SelectedModule.IsClosed == 0)
            {
                Students.CancelEdit();
                var student = (e.Row.Item as DataRowView).Row[Constants.StudentColumnName] as Student;

                var docVM = new AddMedicalDocVM(student);
                DialogService.I.ShowDialog(docVM);
            }
            else
            {
                Students.CancelEdit();
            }
        }
コード例 #2
0
        public ActionResult Pay(string nonce, string newPaymentGuid = null)
        {
            var record = _paymentService.DecryptPaymentNonce(nonce);

            if (record == null)
            {
                Logger.Error("Error decrypting payment nonce.");
                return(new HttpUnauthorizedResult());
            }
            ContentItem item = null;

            if (record.ContentItemId > 0)
            {
                item = _orchardServices.ContentManager.Get(record.ContentItemId, VersionOptions.Latest);
            }
            PaymentVM model = new PaymentVM {
                Record      = record,
                PosList     = _posServices.ToList(),
                ContentItem = item
            };

            try {
                model.Record = _posServiceEmpty.StartPayment(model.Record, newPaymentGuid);
            }
            catch (Exception ex) {
                Logger.Error(ex, "Error starting payment.");
                return(new HttpUnauthorizedResult());
            }
            return(View("Pay", model));
        }
コード例 #3
0
ファイル: OrderRepo.cs プロジェクト: felky/Labb1
        public async Task AddOrder(PaymentVM pvm)
        {
            using (OrderServiceContext ctx = new OrderServiceContext())
            {
                Orders order = new Orders()
                {
                    OrderAdress = pvm.DeliveryAdress,
                    OrderDate   = DateTime.Now,
                    FirstName   = pvm.FirstName,
                    LastName    = pvm.LastName,
                    Email       = pvm.Email
                };

                ctx.Orders.Add(order);
                ctx.SaveChanges();

                foreach (Product p in pvm.Cart.Products)
                {
                    ctx.OrderLine.Add(new OrderLine()
                    {
                        ProductId = p.Id,
                        OrderId   = order.Id,
                        Total     = p.Price
                    });
                }

                System.Diagnostics.Debug.WriteLine("ORDER ADDED: " + order.ToString());
                await ctx.SaveChangesAsync();
            }
        }
コード例 #4
0
        public ActionResult Index(int pid = 0, string guid = "")
        {
            PaymentRecord payment;

            if (pid > 0)
            {
                payment = _posService.GetPaymentInfo(pid);
            }
            else
            {
                payment = _posService.GetPaymentInfo(guid);
            }
            pid = payment.Id;
            var settings = _orchardServices.WorkContext.CurrentSite.As <BraintreeSiteSettingsPart>();

            if (settings.CurrencyCode != payment.Currency)
            {
                //throw new Exception(string.Format("Invalid currency code. Valid currency is {0}.", settings.CurrencyCode));
                string error = string.Format("Invalid currency code. Valid currency is {0}.", settings.CurrencyCode);
                _posService.EndPayment(payment.Id, false, error, error);
                return(Redirect(_posService.GetPaymentInfoUrl(payment.Id)));
            }
            PaymentVM model = new PaymentVM();

            model.Record        = payment;
            model.TenantBaseUrl = Url.Action("Index").Replace("/Laser.Orchard.Braintree/Braintree", "");
            return(View("Index", model));
        }
コード例 #5
0
 public void WhenTheUserCancelsTheOrder()
 {
     var payment = new PaymentVM
     {
         BillingAddress = new Address
         {
             Address1 = "Address line 1",
             Address2 = "Address line 2",
             City     = "City",
             Country  = null,
             State    = "State",
             Zip      = "30345"
         },
         CreditCardNumber = "0000111122223333",
         CreditCardType   = "Visa",
         CVV             = "888",
         Email           = "*****@*****.**",
         ExpirationMonth = "1",
         ExpirationYear  = "2015",
         FirstName       = "SpecFlow",
         LastName        = "FlowSpec",
         NameOnCard      = "Name",
         SameAsBilling   = true,
         ShippingAddress = new Address
         {
             Address1 = "Address line 1",
             Address2 = "Address line 2",
             City     = "City",
             Country  = null,
             State    = "State",
             Zip      = "30345"
         }
     };
     //new OrderMediator().CancelOrder();
 }
コード例 #6
0
        public StatusCodeResult ProcessPayment(PaymentVM payment)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    //Convert Model to Actual Payment Model
                    Payment p = _mapper.Map <Payment>(payment);
                    _paymentService.ProcessPayment(p);

                    //Send when payment is processed
                    return(Ok());
                }
                else
                {
                    //Send when bad request
                    return(BadRequest());
                }
            }
            catch (Exception)
            {
                //Send when Internal Server Error
                return(new StatusCodeResult(500));
            }
        }
コード例 #7
0
        public ActionResult Edit([Bind(Prefix = "Payment")] Payment payment)
        {
            Payment dbPayment = UOW.Payments.GetById(payment.Id);

            if (dbPayment != null)
            {
                dbPayment.Amount      = payment.Amount;
                dbPayment.PaymentType = payment.PaymentType;
                dbPayment.PaymentDate = payment.PaymentDate;
                dbPayment.AccountId   = payment.AccountId;

                UOW.Commit();
                payment = dbPayment;
            }
            else
            {
                return(HttpNotFound());
            }
            PaymentVM vm = new PaymentVM
            {
                Payment  = payment,
                Accounts = UOW.Accounts.GetAll()
            };

            return(View(vm));
        }
コード例 #8
0
ファイル: AdminController.cs プロジェクト: zlokex/dotNettbank
        public ActionResult CreatePayment(PaymentVM form)
        {
            if (!checkSession())
            {
                return(RedirectToAction("Index", "Index"));
            }

            if (ModelState.IsValid)
            {
                DateTime today = DateTime.Now;
                Payment  p     = new Payment()
                {
                    DateAdded     = today,
                    DueDate       = today,
                    Amount        = form.Amount,
                    Message       = form.Message,
                    FromAccountNo = form.FromAccountNo,
                    ToAccountNo   = form.ToAccountNo,
                };

                if (_adminService.createPayment(p))
                {
                    return(Json(new { success = true }));
                }
            }

            return(PartialView("_CreatePaymentPartial", form));
        }
コード例 #9
0
        public ActionResult DirectRequest(FormCollection collection)
        {
            PaymentVM pvm   = (PaymentVM)TempData["payment"];
            bool      isnew = pvm.SelectedAlias.isnew;
            SortedDictionary <string, string> param = Check.BuildQueryFromForm(collection, isnew);

            string tohash = Check.StringToHash(param, "Mypassphraseissocool!");
            string hash   = Check.GetHash(tohash);

            param.Add("SHASIGN", hash);
            NameValueCollection query = Check.FromDicToCol(param);

            WebClient myWebClient = new WebClient();

            myWebClient.Headers["Content-Type"] = "application/x-www-form-urlencoded";

            try
            {
                byte[]    response = myWebClient.UploadValues("https://webdev.oglan.local/Ncol/Test/orderdirect.asp", query);
                string    res      = System.Text.Encoding.UTF8.GetString(response);
                XDocument document = XDocument.Parse(res);
                TempData["document"] = document;
                return(RedirectToAction("EncodeDirectPayment", "PostSale"));
            }
            catch (WebException e)
            {
            }
            return(RedirectToAction("Index", "Home"));
        }
コード例 #10
0
ファイル: Check.cs プロジェクト: Cornelion/UserStoriesTest
        public static void SetParameters(PaymentVM payment)
        {
            if (payment.SelectedAlias != null && !String.IsNullOrEmpty(payment.SelectedAlias.Name))
            {
                payment.Param.Add("ALIAS", payment.SelectedAlias.Name);
                payment.Param.Add("ALIASUSAGE", "Click_here_to_use_alias");
                //if (!payment.isdirectlink)
                //{
                //    payment.Param.Add("CARDNO", payment.SelectedAlias.CardNo);
                //    payment.Param.Add("ED", payment.SelectedAlias.Ed);
                //}
            }
            payment.Param.Add("AMOUNT", (payment.order.Total * 100).ToString("0"));


            payment.Param.Add("CURRENCY", "EUR");
            var orderId = DateTime.Now.ToString("ddhhMMss");

            payment.Param.Add("OPERATION", "RES");
            payment.Param.Add("ORDERID", orderId);
            payment.Param.Add("PSPID", "EPhilippeTest");
            if (payment.isdirectlink)
            {
                payment.Param.Add("PSWD", "N4t&1ytqE#");
                payment.Param.Add("USERID", "user-API");
            }
            else
            {
                payment.Param.Add("CN", payment.user.UserName);
                string sha = GetHash(StringToHash(payment.Param, "Mypassphraseissocool!"));
                payment.Param.Add("SHASIGN", sha);
            }
        }
コード例 #11
0
        public async Task Consume(ConsumeContext <PaymentError> context)
        {
            var message = context.Message;
            var id      = message.PaymentId.ToString();

            var paymentVm = new PaymentVM()
            {
                PaymentId     = message.PaymentId,
                OrderId       = message.OrderId,
                Amount        = message.Amount,
                CardNumber    = message.CardNumber,
                Currency      = message.Currency,
                MerchantId    = message.MerchantId,
                PaymentStatus = "System error",
                Cvv           = message.Cvv,
                ExpiryDate    = message.ExpiryDate
            };

            var paymentDoc = new DocumentBase <PaymentVM>()
            {
                VM = paymentVm
            };

            await repository.Upsert(id, paymentDoc);
        }
コード例 #12
0
        public ActionResult Index(int pid = 0, string guid = "")
        {
            PaymentRecord payment;

            if (pid > 0)
            {
                payment = _posService.GetPaymentInfo(pid);
            }
            else
            {
                payment = _posService.GetPaymentInfo(guid);
            }
            pid = payment.Id;
            var settings = _posService.GetSettings();

            if (settings.CurrencyCode != payment.Currency)
            {
                //throw new Exception(string.Format("Invalid currency code. Valid currency is {0}.", settings.CurrencyCode));
                string error = string.Format("Invalid currency code. Valid currency is {0}.", settings.CurrencyCode);
                _posService.EndPayment(payment.Id, false, error, error);
                return(Redirect(_posService.GetPaymentInfoUrl(payment.Id)));
            }
            PaymentVM model = new PaymentVM();

            model.Record = payment;
            // changed the path to a route, so I also change the replace
            model.TenantBaseUrl = Url.Action("Index").Replace("/payment/braintree", "");
            return(View("Index", model));
        }
コード例 #13
0
        public ActionResult SiparisiOnayla([Bind(Prefix = "Item1")] Order item, [Bind(Prefix = "Item2")] PaymentVM item2)
        {
            bool result = false;

            //Burada artık bir client olarak API'a istek göndermemiz lazım (API consume)..Bunun icin Microsoft.Asp.Net.WebApi.Client package'ini Nuget'tan indirmelisiniz.

            //Aynı zamanda System.Net.Http.DLL'ini Assembly'den (Referanslara giderek) engtegre etmelisiniz.
            using (HttpClient client = new HttpClient())
            {
                //http://localhost:57177/api/Payment/ReceivePayment

                client.BaseAddress = new Uri("http://localhost:57177/api/");
                Cart sepet = Session["scart"] as Cart;
                item2.PaymentPrice = sepet.TotalPrice.Value;



                var postTask = client.PostAsJsonAsync("Payment/ReceivePayment", item2);

                //Burada item2 nesnesini json olarak gönderiyoruz. Ve Base Adresimizin üzerine Payment/ReceivePayment'i ekliyoruz..

                HttpResponseMessage sonuc = postTask.Result;

                if (sonuc.IsSuccessStatusCode)
                {
                    result = true;
                }
                else
                {
                    result = false;
                }
            }

            if (result)
            {
                //AppUser kullanici = Session["member"] as AppUser;
                item.AppUserID = 7; //Order'in kim tarafından sipariş edildigini belirlersiniz
                oRep.Add(item);     //save edildiginde Order nesnesinin ID'si üretilir.

                Cart sepet = Session["scart"] as Cart;

                foreach (CartItem urun in sepet.Sepetim)
                {
                    OrderDetail od = new OrderDetail();
                    od.OrderID   = item.ID;
                    od.ProductID = urun.ID;
                    odRep.Add(od);
                }
                TempData["odeme"] = "Siparişiniz bize ulasmıstır..Tesekkür ederiz";
                return(RedirectToAction("ProductList"));
            }

            else
            {
                TempData["odeme"] = "Odeme ile ilgili bir sıkıntı olustu. Lütfen banka ile iletişime geciniz";
                return(RedirectToAction("ProductList"));
            }
        }
コード例 #14
0
ファイル: OrderMediator.cs プロジェクト: mmintz1/SWECapstone
        public bool CreateOrder(PaymentVM payment)
        {
            var success  = false;
            var mediator = new TicketMediator();
            var cart     = mediator.GetCart();

            foreach (var perf in cart.Performances)
            {
                var performance = mediator.GetPerformance(perf.PerformanceId);

                if (performance.AvailableTickets - perf.Quantity >= 0)
                {
                    success = true;

                    if (!success)
                    {
                        break;
                    }
                }
            }

            if (success)
            {
                using (var db = new ManagementToolProjectEntities())
                {
                    var date   = payment.ExpirationMonth + "/1/" + payment.ExpirationYear;
                    var expiry = DateTime.Parse(date);

                    var orderModel = new Order
                    {
                        FirstName       = payment.FirstName,
                        LastName        = payment.LastName,
                        BillingAdress   = payment.BillingAddress.Address1,
                        BillingCity     = payment.BillingAddress.City,
                        BillingState    = payment.BillingAddress.State,
                        BillingZipCode  = Convert.ToInt32(payment.BillingAddress.Zip),
                        ShippingAdress  = payment.ShippingAddress.Address1,
                        ShippingCity    = payment.ShippingAddress.City,
                        ShippingState   = payment.ShippingAddress.State,
                        ShippingZipCode = Convert.ToInt32(payment.ShippingAddress.Zip),
                        ExpirationDate  = expiry,
                        CreditCard      = payment.CreditCardNumber,
                        status          = 1
                    };

                    var order = db.Orders.Add(orderModel);
                    success = db.SaveChanges() > 0;

                    if (success)
                    {
                        AddPerformanceOrder(order.OrderId);
                    }
                }
            }

            return(success);
        }
コード例 #15
0
        public ActionResult Create()
        {
            PaymentVM vm = new PaymentVM
            {
                Accounts = UOW.Accounts.GetAll()
            };

            return(View("Edit", vm));
        }
コード例 #16
0
        public PlacanjePage(KorisnikPregled.PreglediVM pregled)
        {
            InitializeComponent();
            _pregled = pregled;
            var nav = new NavigationPage(new AboutPage());

            navigation     = nav.Navigation;
            BindingContext = model = new PaymentVM(_pregled, navigation);
        }
コード例 #17
0
        public List <PaymentVM> GetAllPayments()
        {
            List <PaymentVM> payments = new List <PaymentVM>();
            PaymentVM        payment  = null;

            try
            {
                string connString = ConfigurationManager.ConnectionStrings["Test"].ConnectionString;
                using (SqlConnection con = new SqlConnection(connString))
                {
                    con.Open();
                    SqlCommand    command = new SqlCommand();
                    StringBuilder builder = new StringBuilder();

                    builder.Append("SELECT Payments.Id, Payments.PatientID, Payments.AmountPaid, Patient.FirstName, Patient.LastName,Payments.Date, Payments.PaymentFor, Payments.PaymentMode, Employee.Name PaymentCapturedBy FROM dbo.Payments");
                    builder.Append("  INNER JOIN Employee ON Payments.CapturedBy = Employee.Id");
                    builder.Append("  INNER JOIN Patient ON Payments.PatientID = Patient.PatientID");

                    command.CommandText = builder.ToString();
                    command.Connection  = con;
                    using (SqlDataAdapter adapter = new SqlDataAdapter(command))
                    {
                        DataTable table = new DataTable();
                        adapter.Fill(table);

                        var records = table.Select();

                        foreach (var row in records)
                        {
                            payment                   = new PaymentVM();
                            payment.Id                = Convert.ToInt64(row["Id"]);
                            payment.PatientID         = row["PatientID"] as string;
                            payment.AmountPaid        = Convert.ToDecimal(row["AmountPaid"]);
                            payment.Date              = row["Date"] as string;
                            payment.PaymentCapturedBy = row["PaymentCapturedBy"] as string;
                            payment.PaymentFor        = row["PaymentFor"] as string;
                            payment.PaymentMode       = row["PaymentMode"] as string;
                            payment.PatientFullName   = row["FirstName"] as string + " " + row["LastName"] as string;;

                            payments.Add(payment);
                        }
                    }
                }
            }
            catch (SqlException oe)
            {
                ExceptionBag bag = new ExceptionBag();
                bag.Message            = oe.Message;
                bag.Date               = DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss");
                bag.ExecutingOperation = "GetAllPayments";
                bag.InnerException     = oe.InnerException == null ? string.Empty : oe.InnerException.ToString();
                ExceptionLogger.LogToFileAsync(bag);
            }

            return(payments);
        }
コード例 #18
0
        // GET: Payment
        public ActionResult Payment()
        {
            PaymentVM model = new PaymentVM()
            {
                users   = db.Users.ToList(),
                courses = db.Course.ToList()
            };

            return(View(model));
        }
コード例 #19
0
        public JsonResult GetPayment(int caseID)
        {
            var patientId = PaymentService.GetPatientId(caseID);
            var model     = new PaymentVM();

            model.Configuration  = PaymentManager.Configuration;
            model.PatientLogins  = PaymentService.GetPatientLogins(patientId);
            model.Data.PatientId = patientId;
            return(this.CamelCaseJson(model, JsonRequestBehavior.AllowGet));
        }
コード例 #20
0
        public static PaymentVM ConvertToVM(Payment payment)
        {
            var paymentModel = new PaymentVM()
            {
                Amount     = payment.Amount,
                MethodName = payment.MethodName
            };

            return(paymentModel);
        }
コード例 #21
0
        public IActionResult AddPayment(int id)
        {
            var       linkdetails = transactionLinkService.GetTransactionLink(id);
            var       transaction = transactionService.GetTransaction(linkdetails.TransactionID);
            PaymentVM payment     = new PaymentVM();

            payment.LinkID = linkdetails.Id;
            payment.Amount = transaction.Totalfee;
            return(View(payment));
        }
コード例 #22
0
        public ActionResult GetPayments(string accountNo)
        {
            if (Session["LoggedIn"] != null)
            {
                string birthID = Session["UserId"] as string;

                bool loggedIn = (bool)Session["LoggedIn"];
                if (!loggedIn)
                {
                    return(RedirectToAction("LoginBirth", "Home", new { area = "" }));
                }
                else
                {
                    // List of due payments
                    List <Payment> duePayments;

                    // Check if All ccounts/Alle kontoer option was selected:
                    if (accountNo == "Alle kontoer")
                    {
                        // If all accounts are chosen
                        string userBirthNo = Session["UserId"] as string;
                        // Get all due payments to user:
                        duePayments = bankService.getDuePaymentsByBirthNo(userBirthNo);
                    }
                    else
                    {
                        // If not, that means the user selected an account number, so get all due payments based on that accountNo:
                        duePayments = bankService.getDuePaymentsByAccountNo(accountNo);
                    }

                    // List of Payment view model:
                    List <PaymentVM> viewModels = new List <PaymentVM>();

                    foreach (var t in duePayments)
                    {
                        var viewModel = new PaymentVM()
                        {
                            PaymentID     = t.PaymentID,
                            DateAdded     = t.DateAdded,
                            DueDate       = t.DueDate,
                            Amount        = t.Amount,
                            Message       = t.Message,
                            FromName      = t.FromAccount.Owner.FirstName,
                            FromAccountNo = t.FromAccount.AccountNo,
                            ToName        = t.ToAccount.Owner.FirstName,
                            ToAccountNo   = t.ToAccount.AccountNo,
                        };
                        viewModels.Add(viewModel);
                    }

                    return(PartialView("PaymentsPartial", viewModels));
                }
            }
            return(RedirectToAction("LoginBirth", "Home", new { area = "" }));
        }
コード例 #23
0
        public PaymentPage(MAlbum album)
        {
            InitializeComponent();
            var nav = new NavigationPage(new AlbumPage());

            navigation     = nav.Navigation;
            BindingContext = model = new PaymentVM(navigation)
            {
                Album = album
            };
        }
コード例 #24
0
        public ActionResult PaymentSnimi(PaymentVM vm)
        {
            if (vm.selektovani == 0 || vm.selektovani == null)
            {
                return(RedirectToAction("CheckoutPayment"));
            }
            GlobalHelp.aktivnaNarudzba.NacinPlacanjaID = vm.selektovani;


            return(RedirectToAction("CheckoutReview"));
        }
コード例 #25
0
        public ActionResult Index()
        {
            var model = new PaymentVM
            {
                Configuration = _paymentManager.Configuration,
                ActivePlan    = _service.GetActivePlanByUser(AppService.Current.User.CurrentUser.ID),
                Patients      = _service.GetPatients(AppService.Current.User.CurrentUser.ID)
            };

            return(View("Index", model));
        }
コード例 #26
0
        public async Task <WrapperPaymentListVM> DeleteCustomerPayment(PaymentVM vm)
        {
            Task <List <Invoice> > paymentInvoiceListT = _repositoryWrapper
                                                         .Invoice
                                                         .FindAll()
                                                         .Include(x => x.InvoiceType)
                                                         .Where(x =>
                                                                x.InvoiceType.Name == TypeInvoice.ClientPayment.ToString() &&
                                                                x.ClientId == vm.ClientId &&
                                                                x.FactoryId == vm.FactoryId &&
                                                                vm.InvoiceId == x.Id)
                                                         .ToListAsync();

            Task <List <Income> > paymentIncomeListT = _repositoryWrapper
                                                       .Income
                                                       .FindAll()
                                                       .Where(x =>
                                                              x.ClientId == vm.ClientId &&
                                                              x.FactoryId == vm.FactoryId &&
                                                              x.InvoiceId == vm.InvoiceId)
                                                       .ToListAsync();

            Task <List <TblTransaction> > paymentTransactionListT = _repositoryWrapper
                                                                    .Transaction
                                                                    .FindAll()
                                                                    .Where(x =>
                                                                           x.ClientId == vm.ClientId &&
                                                                           x.FactoryId == vm.FactoryId &&
                                                                           x.InvoiceId == vm.InvoiceId)
                                                                    .ToListAsync();

            await Task.WhenAll(paymentInvoiceListT, paymentIncomeListT, paymentTransactionListT);


            _repositoryWrapper.Transaction.Delete(paymentTransactionListT.Result.FirstOrDefault());
            _repositoryWrapper.Invoice.Delete(paymentInvoiceListT.Result.FirstOrDefault());
            _repositoryWrapper.Income.Delete(paymentIncomeListT.Result.FirstOrDefault());

            Task <int> t1 = _repositoryWrapper.Transaction.SaveChangesAsync();
            Task <int> t2 = _repositoryWrapper.Invoice.SaveChangesAsync();
            Task <int> t3 = _repositoryWrapper.Income.SaveChangesAsync();

            await Task.WhenAll(t1, t2, t3);

            var item = new GetPaymentDataListVM();

            item.ClientId   = vm.ClientId;
            item.FactoryId  = vm.FactoryId;
            item.PageNumber = 1;
            item.PageSize   = 10;

            return(await GetCustomerPaymentList(item));
        }
コード例 #27
0
        public IActionResult PayInsert(IFormCollection form)
        {
            PaymentVM payment = JsonConvert.DeserializeObject <PaymentVM>(form["modelInfo"]);

            try
            {
                Payment dbpay = new Payment();
                dbpay.Amount        = payment.Amount;
                dbpay.AccountNumber = payment.AccountNumber;
                dbpay.BankName      = payment.BankName;
                dbpay.Description   = payment.Description;
                dbpay.LinkID        = payment.LinkID;
                dbpay.AddDate       = DateTime.Now;
                dbpay.Status        = 1;
                int i           = 0;
                var uploadFiles = Request.Form.Files;
                foreach (var file in uploadFiles)
                {
                    Guid   nameguid    = Guid.NewGuid();
                    string webrootpath = env.WebRootPath;
                    string filename    = nameguid.ToString();
                    string extension   = Path.GetExtension(file.FileName);
                    string foldername  = "TransactionImage";
                    filename = filename + extension;
                    string path = Path.Combine(webrootpath, foldername, filename);
                    using (var fileStream = new FileStream(path, FileMode.Create))
                    {
                        file.CopyTo(fileStream);
                    }
                    string pathName = Path.Combine(foldername, filename);
                    if (i == 0)
                    {
                        dbpay.DocumentsUrl = "~/TransactionImage/" + filename;
                    }
                    if (i == 1)
                    {
                        dbpay.DocumentsUrl2 = "~/TransactionImage/" + filename;
                    }
                    if (i == 2)
                    {
                        dbpay.DocumentsUrl3 = "~/TransactionImage/" + filename;
                    }

                    i++;
                }
                paymentService.InsertPayment(dbpay);
                return(Json(new { success = true }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, message = ex.Message }));
            }
        }
コード例 #28
0
        public ActionResult postCart(PaymentVM paymentVm)
        {
            // Get total
            ProductHelper productHelper = new ProductHelper();
            //Product product = productHelper.findProduct(paymentVm.product.id);
            //decimal total = product.total;

            //
            Order order = new Order
            {
                billingAddress   = paymentVm.order.billingAddress,
                billingAddress2  = paymentVm.order.billingAddress2,
                billingCity      = paymentVm.order.billingCity,
                billingCountry   = "US",
                billingFirstName = paymentVm.order.billingFirstName,
                billingLastName  = paymentVm.order.billingLastName,
                billingState     = paymentVm.order.billingState,
                billingZip       = paymentVm.order.billingZip,

                shippingAddress      = paymentVm.order.shippingAddress,
                shippingAddress2     = paymentVm.order.shippingAddress2,
                shippingCity         = paymentVm.order.shippingCity,
                shippingCountry      = "US",
                shippingFirstName    = paymentVm.order.shippingFirstName,
                shippingLastName     = paymentVm.order.shippingLastName,
                shippingState        = paymentVm.order.shippingState,
                shippingZip          = paymentVm.order.shippingZip,
                shippingEmailAddress = paymentVm.order.shippingEmailAddress,
                shipping             = 0.0m,

                creditCardNumber = paymentVm.order.creditCardNumber,
                expireMonth      = paymentVm.order.expireMonth,
                expireYear       = paymentVm.order.expireYear,
                cvv = paymentVm.order.cvv,

                orderTotal = paymentVm.product.total,

                phone             = paymentVm.user.phone,
                user              = paymentVm.user,
                nextRecurringDate = DateTime.Today.AddDays(1 - DateTime.Today.Day),

                subTotal = paymentVm.product.subtotal,
                salesTax = 0.00m,

                created = DateTime.Today.Date,
            };

            // Send order to LimeLight
            string json = JsonConvert.SerializeObject(order);

            return(RedirectToAction("Confirmation"));
        }
コード例 #29
0
        public PaymentPage(MEstate estate, int months)
        {
            _months = months;
            InitializeComponent();
            var nav = new NavigationPage(new MyEstatesPage());

            navigation     = nav.Navigation;
            BindingContext = model = new PaymentVM(navigation, estate, months)
            {
                Estate = estate,
                months = months
            };
        }
コード例 #30
0
        // GET: User/Payment
        public ActionResult Payment(int id)
        {
            var payment = db.Payments.Find(id);

            var model = new PaymentVM
            {
                price        = payment.price,
                addCharge    = payment.addCharge,
                Registration = payment.Registration
            };

            return(View(model));
        }