Cart cancellation

Steps and examples to send cancellations

ASP .NET cancellation

Files location and description the ASP .NET library example of use page 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 :

- : specified unique cart Id
- : number of cancelled tickets