Cart cancellation

Steps and examples to send cancellations

Native Javascript cancellation

Files location and description

- luckyclient.min.js : the JS library
javascript/lc_cancel_sample.html : an example of use

Integration steps

 1. Install library

Insert the JavaScript library at the top of the cancellation confirmation page, using the specific URL provided by Lucky Cart :

<!-- Include library using the URL provided by Lucky Cart -->
<script src="/path/to/luckyclient.min.js" type="text/javascript"> </script> 

2. Initialize library and send cancellation

On the same cancellation confirmation page, use the cancel() method of Luckycart class :

<script type="text/javascript”>
  // Create a Lucky Cart object with your key and secret
  var client = new Luckycart('key', 'Secret');

  // Cancels the specified cart
    client.cancel(cart.getId(), function(res){
      // and do something with the response

3. Use response, if needed

The returned res object can be used and contains the following information :

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