Last active
May 31, 2016 08:26
-
-
Save samcorcos/35c1d26633db7e993df296116be9b8c1 to your computer and use it in GitHub Desktop.
index.html part 1 for payment processor
This file contains hidden or 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
<html> | |
<head> | |
<title>Page Title</title> | |
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> | |
</script> | |
<script> | |
var submit = function() { | |
$.ajax({ | |
type: 'POST', url: '/api/purchase', data: { | |
token: "stripe-token" | |
}, | |
beforeSend: function (xhr) { | |
xhr.setRequestHeader ("Authorization", "true"); | |
}, | |
}).done(function(res) { | |
console.log(res) | |
console.log("POST request successful"); | |
}) | |
} | |
</script> | |
</head> | |
<body> | |
Hello World! | |
<button onclick="submit()">submit</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment