Dynamicweb 8 Documentation
Capture Method
Example 

Performs capture on this order and stores the resulting OrderCaptureInfo on the order
Syntax
'Declaration
 
Public Function Capture() As OrderCaptureInfo
public OrderCaptureInfo Capture()

Return Value

Return the generated OrderCaptureInfo or null if capture is not supported
Example
class MyPage : System.Web.UI.Page
{
   private void AJAXCapture()
   {
       //Get OrderID
       string orderID = Base.Request("CaptureOrderID");
       if (string.IsNullOrEmpty(orderID))
       {
           return;
       }

       //Get Order
       Order order = Order.Create(orderID);
       if (string.IsNullOrEmpty(order.ID))
       {
           return;
       }

       //Capture
       OrderCaptureInfo result = order.Capture();

       //Write json
       if (result != null)
       {
           StringBuilder json = new StringBuilder();
           json.Append("{");
           json.AppendFormat("\"orderCaptureState\" : \"{0}\",", result.State.ToString());
           json.AppendFormat("\"orderCaptureInfoDate\" : \"{0}\",", result.CaptureTime.ToString("ddd, dd MMM yyyy HH:mm", Base.GetCulture(false)));
           json.AppendFormat("\"orderCaptureMessage\" : \"{0}\",", result.Message);
           json.AppendFormat("\"orderCaptureSupported\" : true");
           json.Append("}");

           //Write to response
           Response.Write(json.ToString());
       }
   }
}
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

Send Feedback