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
//goes great with my DB structure. like cake | |
//custom items not from the charge json | |
$invoiceid = '';//create a unique invoice id for your transaction | |
$transactiontoken = '';//the token passed through from stripe.js | |
$itemname = 'green apples';//sent through with token and double checked | |
$itemdesc = 'delicious green apples';//sent through with token and double checked | |
$itemamount = '';//sent through with token and double checked | |
$applicationfee = '';//the fee that you sent through the charge | |
$buyeremail = '[email protected]';//sent through with token from stripe.js |
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
CREATE TABLE IF NOT EXISTS `transactions` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`transactiontoken` varchar(200) NOT NULL, | |
`chargeid` varchar(100) NOT NULL, | |
`invoiceid` varchar(20) NOT NULL, | |
`type` varchar(10) NOT NULL, | |
`itemname` varchar(100) NOT NULL, | |
`itemdesc` varchar(100) NOT NULL, | |
`itemamount` int(10) NOT NULL, | |
`applicationfee` varchar(11) NOT NULL, |
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 objvalues = {};//needed so you can store all items for later use | |
var handler = StripeCheckout.configure({ | |
key: "pk_test_Public key", | |
image: "productimage.jpg", | |
token: function(token) { | |
objvalues["stripeToken"] = token.id; | |
objvalues["stripeEmail"] = token.email; | |
$.get( | |
"/handler.php", /* your route here */ | |
objvalues, |