Skip to content

twmulloy/chockstone-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chockstone API

Description

This a Ruby interface for the Chockstone API service.

Installation

gem install chockstone

Example

require 'rubygems'
require 'chockstone'

cs = Chockstone::Connection.new({
  :url            => "MY_API_URL",
  :domain         => "MY_API_DOMAIN",
  :profile        => "MY_API_PROFILE",
  :seller_profile => "MY_API_SELLER_PROFILE",
  :password       => "MY_API_PASSWORD"
})

# verify user credentials
cs.authenticate_user('[email protected]', 'their_password')

# create new user
cs.create_user({
    :id           => '[email protected]',
    :password     => 'their_password',
    :title        => 'Mr.',
    :first_name   => 'The Lord Viper',
    :last_name    => 'Scorpion',
    :street       => "123 Fake St.",
    :city         => '',
    :state_or_province => '',
    :postal_code  => '',
    :country      => 'USA',
    :email        => '[email protected]',
    :email_opt_in => 0,
    :voice_phone  => '',
    :other_phone  => '',
    :birth_date   => {
      :year       => '',
      :month      => '',
      :day        => ''
    }
  })

# create a new user and account (provide a hash of authorization 
# method as a 2nd argument to create_user)
cs.create_user({
  #... user hash
  },{
    :pin_authorization => {
      :id => '1234123412341234',
      :pin => '4321'
    }
  }
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages