Skip to content

Instantly share code, notes, and snippets.

View talkaboutdesign's full-sized avatar

Maksim Petriv talkaboutdesign

View GitHub Profile
@talkaboutdesign
talkaboutdesign / index.js
Last active March 13, 2019 02:19
Serverless Stripe payment processing. Compatible with Zeit.co Now 2.0.
const stripe = require('stripe')('your-stripe-secret')
const { text } = require('micro')
module.exports = async (req, res) => {
// Need to process body from request coming in.
const body = JSON.parse(await text(req))
// Process payment using details from incoming request. You might also optionally want to create a customer before initiating a payment.
const charge = await stripe.charges
.create({
Widgetly does not collect any information about the users of the app.
That's it. It's that simple. No tracking, no data storage outside your device.