Class CheckoutHandlerWithStatusPage
- Namespace
- Dynamicweb.Ecommerce.Cart
- Assembly
- Dynamicweb.Ecommerce.dll
A CheckoutHandlerWithStatusPage does all the business logic required to complete an order.
Inherit from this base class to extend to checkout logic in DynamicWeb eCommerce Cart V2.
public abstract class CheckoutHandlerWithStatusPage : CheckoutHandler
- Inheritance
-
CheckoutHandlerWithStatusPage
- Inherited Members
Remarks
Make use of the Dynamicweb AddIn API to add editable properties to the checkout handler.
Methods
CheckoutDone(Order, int)
This method should be called when the handler is done with the checkout even if the checkout fails.
protected void CheckoutDone(Order order, int pageID)
Parameters
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
- See Also
GetInfoFromQueryString(Order)
Returns all info from query string as xml string
protected string GetInfoFromQueryString(Order order)
Parameters
order
Order- The order
Returns
- string
- System.String.
Examples
Order myOrder;
Get transaction number from gateway
string transNum;
...
Set the order complete
SetOrderComplete(myOrder, transNum);
- See Also
PrepareGatewayResult(string)
Save cart's pageID in suitable form for recording in the GatewayResult field
protected static string PrepareGatewayResult(string pageID)
Parameters
pageID
string- The page identifier.
Returns
- string
- System.String.
- See Also
RetrievePageID(string)
Retrieve cart's pageID from order.GatewayResult, previously prepared with PrepareGatewayResult() function
protected static int RetrievePageID(string gatewayResult)
Parameters
gatewayResult
string- The gateway result.
Returns
- int
- System.Int32.
- See Also
SetOrderCompleteSafety(Order)
Performs the logic for setting the order complete
protected void SetOrderCompleteSafety(Order order)
Parameters
order
Order- The order to set complete
- See Also
SetTransactionState(Order, bool, double, string, string)
Save gateway's transaction sensibility parameters on order
protected void SetTransactionState(Order order, bool isSuccess, double transactionAmount, string transactionNumber, string transactionCardType)
Parameters
order
Order- The order to set complete
isSuccess
bool- if set to
true
[is success]. transactionAmount
double- The transaction amount.
transactionNumber
string- The transaction number.
transactionCardType
string- Type of the transaction card.
- See Also