Dynamicweb.eCommerce.Orders Namespace > Order Class : Capture Method |
'Declaration
Public Function Capture() As OrderCaptureInfo
public OrderCaptureInfo Capture()
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()); } } }
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