Skip to content

hanzoai/checkout.js

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
css
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Checkout.js

npm build dependencies downloads license chat

Easy to use checkout powered by Hanzo

Checkout.js is an easy to use checkout widget powered by Hanzo. It makes it possible for businesses to begin taking pre-orders in minutes.

Preview

Checkout.js Image

Install

$ npm install checkout.js

Usage

Set the href of your button to #checkout.

<a class="btn" href="#checkout">Buy Now</a>

Configure the checkout widget however you'd like.

<script src="https://cdn.rawgit.com/hanzoai/checkout.js/v2.1.21/checkout.min.js"></script>
<script>
  var {Checkout, User, Order, Product} = Hanzo

  // Create user (pre-populated in form fields)
  var user = new User({
    email:     'joe@fan.com',
    firstName: 'Joe',
    lastName:  'Fan'
  })

  // Create order
  var order = new Order({
    currency: 'usd',
    items: [
      new Product({id:   '84cRXBYs9jX7w', quantity: 1}),
      new Product({slug: 'doge-shirt',    quantity: 1}),
    ]
  })

  // Instantiate checkout widget.
  var checkout = new Checkout('your access token', {
    social: {
      facebook:   'suchtees',
      googlePlus: 'suchtees',
      twitter:    'suchtees',
  })

  // Open widget. This can be called multiple times, overriding order or user.
  checkout.open('#checkout', user, order)
</script>

Examples

You can find more examples here.

License

BSD