Created
December 8, 2014 16:36
-
-
Save twmills/83a8161c77e2c1404610 to your computer and use it in GitHub Desktop.
token generation example
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
<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