Last active
August 29, 2015 14:05
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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