Skip to content

Instantly share code, notes, and snippets.

@benjitastic
Created October 6, 2018 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjitastic/5af5d28de10c367fc8df2b2e239bf478 to your computer and use it in GitHub Desktop.
Save benjitastic/5af5d28de10c367fc8df2b2e239bf478 to your computer and use it in GitHub Desktop.
// Require the Stripe library with a test secret key.
const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2');
// Create a payment from a test card token.
const charge = await stripe.charges.create({
amount: 2000,
currency: 'usd',
source: 'tok_amex',
description: 'My first payment'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment