Skip to content

Instantly share code, notes, and snippets.

@digilord
Created November 7, 2014 18:47
Show Gist options
  • Save digilord/7a68d190fab2524ca1ea to your computer and use it in GitHub Desktop.
Save digilord/7a68d190fab2524ca1ea to your computer and use it in GitHub Desktop.
// Test this route with
// curl -F test=testing http://localhost:3000/stripeaccess/
Router.route('stripeaccess',{
path:'/stripeaccess',
where: 'server',
action: function(){
var request = this.request; // From the client
var response = this.response; // Response to the client
// 1. receive the JSON from Stripe
var stripeData = request.body;
console.log('stripeData: ', stripeData)
// 2. Send that JSON to a server method
Meteor.call('processStripe', stripeData);
// 3. Profit (Literally :-P )
// Stripe required end of reciept.
response.writeHead(200)
response.end()
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment