Table of Contents

Class DefaultCheckoutHandler

Namespace
Dynamicweb.Ecommerce.Cart
Assembly
Dynamicweb.Ecommerce.dll
The default checkout handler that is used if no checkout handler is selected on a payment.
[AddInActive(false)]
public class DefaultCheckoutHandler : CheckoutHandler, IRecurring, ICheckoutHandlerAction
Inheritance
DefaultCheckoutHandler
Implements
Inherited Members

Methods

Recurring(Order, Order)

Recurrings the specified order.
public void Recurring(Order order, Order initialOrder)

Parameters

order Order
The order.
initialOrder Order
The initial order.
See Also

RecurringSupported(Order)

Shows if order supports recurring payments
public bool RecurringSupported(Order order)

Parameters

order Order
Instance of order

Returns

bool
True, if recurring payments are supported
See Also

Redirect(Order)

Function that is called from CartV2 when OrderIdRequestName is in the Request.

Implement this method to receive redirects from CartV2

public override string Redirect(Order order)

Parameters

order Order
The order with order ID equal to the request OrderIdRequestName

Returns

string
Returns the output to the module.

Examples

//Write the port if it is not default
    var portString = HttpContext.Current.Request.Url.IsDefaultPort ? "" : string.Format(":{0}", HttpContext.Current.Request.Url.Port);
    var pageId = Dynamicweb.Context.Current.Request("ID") == null ? string.Empty : string.Format("ID={0}&", Dynamicweb.Context.Current.Request("ID"));
    Url
    var myUrl = string.Format("{0}://{1}{2}/Default.aspx?{3}{4}={5}",
    HttpContext.Current.Request.Url.Scheme,
    HttpContext.Current.Request.Url.Host,
    portString,
    pageId,
    OrderIdRequestName,
    order.Id);

Remarks

The most common use of this method is to receive callbacks and redirect urls from a gateway.

To enable the Redirect method to be called on a callback parse an url with the current page id and the order id in the query string to the gateway as the callback url. The order id must be stored in a query string variable named with the return value of the property OrderIdRequestName of the CheckoutHandler base class.

Return a string to control the module output. If a redirect is made within the method, it is not needed to return a string.

See Also

StartCheckout(Order)

This method is called when the checkout procedure is started and the order is handled to the checkout handler.
public override string StartCheckout(Order order)

Parameters

order Order
The order that need to be checked out.

Returns

string
The module output.

Examples

Public Overrides Function StartCheckout(ByVal order As eCommerce.Orders.Order) As String
LogEvent(order, "StartCheckout")
Try
SetOrderComplete(order)
LogEvent(order, "SetOrderComplete succeeded")
Catch ex As Exception
LogError(order, "SetOrderComplete failed with the message: {0}", ex.Message)
End Try
CheckoutDone(order)
RedirectToCart(order)
Return Nothing
End Function

Remarks

Return a string to control the module output. If a redirect is made, like in the example, it is not needed to return a string.
See Also

See Also

To top