Dynamicweb 8 Documentation
UpdateGatewayResult() Method
Example 

Updates the gateway result.
Syntax
'Declaration
 
Public Overloads Sub UpdateGatewayResult() 
public void UpdateGatewayResult()
Example
class MyPage : System.Web.UI.Page
{
   private void SetOrderComplete(Dynamicweb.eCommerce.Orders.Order order)
   {
       //Set complete
       order.Complete = true;

       //Remove from stock
       Dynamicweb.eCommerce.Products.Product.UpdateStock(order, Dynamicweb.eCommerce.Products.Product.OrderStockOperator.Negative);

       //Remove all earlier gateway problems from this order
       order.GatewayTransactionProblems.Clear();

       //Save all posted info
       XmlDocument formXML = new XmlDocument();
       XmlElement rootNode = formXML.CreateElement("result");
       formXML.AppendChild(rootNode);
       foreach (string formKey in HttpContext.Current.Request.Form.Keys)
       {
           try
           {
               XmlElement node = formXML.CreateElement(XmlConvert.EncodeName(formKey));
               node.InnerText = HttpContext.Current.Request.Form[formKey];
               rootNode.AppendChild(node);
           }
           catch (Exception ex)
           {
               //
           }
       }
       order.GatewayResult = formXML.OuterXml;

       //Save
       order.UpdateGatewayResult();
       order.Save();
   }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Order Class
Order Members
Overload List

Send Feedback