public ActionResult EditReceiptHeader(EditReceiptHeaderModel WebMerchant) { String MerchantID = GetFromMerchantIDCookie(); if (ModelState.IsValid) { // Attempt to update the merchant try { IMerchantService MerchantServiceInstance = new MerchantService(); bool updateStatus = MerchantServiceInstance.UpdateMerchant(MerchantID, WebMerchant); if (updateStatus == true) { ModelState.AddModelError("", "Updated!"); } else { ModelState.AddModelError("", "Failed to update the merchant"); } } catch (Exception Ex) { ModelState.AddModelError("", Common.StandardExceptionHandler(Ex, "Update Merchant Header", Request.Form)); Log.BadData(Request.UserHostAddress, Request.Url.ToString(), Request.Form); } } return(View(WebMerchant)); }
public void TestRenameMerchant() { var m = _merchantService.GetMerchant(); Assert.IsTrue(m != null); var updated = _merchantService.UpdateMerchant(new MerchantOptions() { Name = "the new merchant name", ContactName = m.ContactName, ContactEmail = m.ContactEmail, ContactPhone = m.ContactPhone, Address1 = m.Address1, Address2 = m.Address2, City = m.City, State = m.State, PostalCode = m.PostalCode, Country = m.Country, Timezone = m.Timezone, ApiAllowedIpAddressRanges = m.ApiAllowedIpAddressRanges }); Assert.AreEqual("the new merchant name", updated.Name); }