1.0.9 • Published 7 years ago

stripe-checkout v1.0.9

Weekly downloads
148
License
-
Repository
github
Last release
7 years ago

stripe-checkout

Open up Stripe Checkout without any hassle.

Install

npm install stripe-checkout

Usage

const Stripe = require('stripe-checkout')

// configure and start lazy-loading the stripe script
//
// I'll usually just stick this on the top of the page
// so stripe is all loaded by the time we want to open
// up checkout.
const stripe = Stripe({
  // don't put your secret here!
  key: process.env.STRIPE_CLIENT_ID
})

// later in your application, when the user
// clicks on a button or something, call
// this to open up stripe checkout.
stripe({
  locale: 'auto',
  name: 'Your Website',
  description: 'Small website blurb',
  amount: 10 * 100,
  email: 'test@test.com',
  allowRememberMe: false,
  image: 'https://avatars2.githubusercontent.com/u/170270?v=3&s=466'
}).then(function(token) {
  if (!token) {
    console.log('user closed stripe checkout without filling in credentials')
    return
  }
  console.log('send this token to the server', token)
})

License

MIT

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

8 years ago