Skip to content

Instantly share code, notes, and snippets.

@jtallieu
Last active August 29, 2015 14:05
Show Gist options
  • Save jtallieu/f3f362ae13074a363838 to your computer and use it in GitHub Desktop.
Save jtallieu/f3f362ae13074a363838 to your computer and use it in GitHub Desktop.
This file is intended to be used as a template for https://gist.github.com/jtallieu/e6a209a436465d0743e4 VEND: mkVoidJs.py. This JS gist expects a list of order id's
var void_order = function(index){
if (index < ids.length){
var id = ids[index];
console.log("(" + index + ") voiding order " + id);
$.ajax({
type: "POST",
url: "/register_sale/void",
data: {id:id, return:null},
success: function(data, stat, xhr){
console.log("Success " + xhr.status);
void_order(++index);
},
error: function(xhr, stat, err){
console.log("ERROR " + xhr.status);
},
});
}
else{
console.log("Complete");
}
}
void_order(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment