Interface IGatewayCallBack
- Namespace
- Dynamicweb.Ecommerce.Orders.Gateways
- Assembly
- Dynamicweb.Ecommerce.dll
Implement this interface in your GatewayProvider to fully control the callback
public interface IGatewayCallBack
Examples
public void ProcessGatewayCallBack()
{
Get orderID
String orderID = HttpContext.Current.Request("_OID_");
if( String.IsNullOrEmpty(orderID) ) {
LogError("OrderID (_OID_) is null or empty");
return;
}
Get order
Order order = order.Create(orderID);
if( String.IsNullOrEmpty(order.Id) ) {
LogError(String.Format("OrderID returned from gateway is '{0}', but no order by that ID exists", orderID));
return;
}
Get transaction number
String transactionNumber = HttpContext.Current.Request("transact");
if( String.IsNullOrEmpty(transactionNumber) ) {
LogError("gateway returned no transaction number");
return;
}
Log event
LogEvent("gateway callback. OrderID: '{0}', transaction number: '{1}'", orderID, transactionNumber);
Set complete
SetOrderComplete(order, transactionNumber, "");
}
Methods
ProcessGatewayCallBack()
void ProcessGatewayCallBack()