Cart cancellation

Steps and examples to send cancellations

ASP .NET cancellation

Files location and description

asp.net/luckycart.dll: the ASP .NET library
asp.net/lc_cancel_sample.aspx: example of use page
asp.net/lc_cancel_sample.aspx.cs: example of use code

Integration steps

1. Library installation

Copy the luckycart.dll library into the Bin subdirectory of the order confirmation page.

2. Library inclusion

Modify the order confirmation page code to include library:

// Include LC library
Using LuckyCart;

3. Library initialisation and sending cancellation

Always in the cancellation confirmation page code, use the Cancel() method of LuckyLib class :

// Use exception to catch error
try {
  // Create a Lucky Cart object with your key and secret
  LuckyLib lc = new LuckyLib(Key, Secret);

  // Sends the cancel request to LC servers
  var cancel_info = lc.Cancel(Cart.Id);
}
catch (Exception ex)
{
    //handle exception here (retry, log, ...)
    throw ex;
}

4. Use response

The cancel_info object can be used as needed and contains the following information :

- cancel_info.id : specified unique cart Id
- cancel_info.tickets : number of cancelled tickets