Skip to content

Instantly share code, notes, and snippets.

@twmills
Created December 8, 2014 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twmills/83a8161c77e2c1404610 to your computer and use it in GitHub Desktop.
Save twmills/83a8161c77e2c1404610 to your computer and use it in GitHub Desktop.
token generation example
<script type='text/javascript'>
EasyShip.token = function (orderNumber) {
var $token = "";
$.ajax({
url: "/tokens",
type: "post",
dataType: "json",
async:false,
data: { "order_number": orderNumber }
}).done(function(data) {
$token = data.token;
}
);
console.log("token: " + $token);
return $token;
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment