Exemplo n.º 1
0
        public ActionResult Edit(PlanEditViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var planService = new StripePlanService();
            var options     = new StripePlanUpdateOptions
            {
                Name = model.Name,
                StatementDescriptor = model.StatementDescriptor
            };

            planService.Update(model.Id, options);

            return(RedirectToAction("Details", new { id = model.Id }));
        }
Exemplo n.º 2
0
        public ActionResult Edit(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var planService = new StripePlanService();
            var p           = planService.Get(id);
            var plan        = new PlanEditViewModel
            {
                Id   = p.Id,
                Name = p.Name,
                StatementDescriptor = p.StatementDescriptor
            };

            return(View(plan));
        }
Exemplo n.º 3
0
        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            PlanEditViewModel planEditViewModel = this.DataContext as PlanEditViewModel;

            planEditViewModel.LoadData();
        }