public ActionResult Edit(PaymentMethod paymentMethod) { paymentMethod.Update(); var method = db.Methods.First(x => x.Token == paymentMethod.PaymentMethodToken); method.MethodName = paymentMethod.Custom; method.HolderName = string.Format("{0} {1}", paymentMethod.FirstName, paymentMethod.LastName); db.Entry(method).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); }
public PaymentMethodPayload(PaymentMethod pm) { FirstName = pm.FirstName; LastName = pm.LastName; Address1 = pm.Address1; Address2 = pm.Address2; City = pm.City; State = pm.State; Zip = pm.Zip; CardNumber = pm.CardNumber; Cvv = pm.Cvv; ExpiryMonth = pm.ExpiryMonth; ExpiryYear = pm.ExpiryYear; Custom = pm.Custom; Sandbox = pm.Sandbox; }