Project

spike-ruby

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby library for SPIKE API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.0.0
~> 10.0
>= 3.0.0
>= 0

Runtime

>= 0
 Project Readme

spike-ruby Gem Version build status

SPIKE API Client for Ruby.

Installation

Add this line to your application's Gemfile:

gem 'spike-ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install spike-ruby

Usage

Example: Create charge

require 'spike'

spike = Spike.new(spike_secret_api_key)

token_params = {
  'card[number]' => '4444333322221111',
  'card[exp_month]' => '3',
  'card[exp_year]' => '2017',
  'card[cvc]' => '111',
  'card[name]' => 'TARO SPIKE',
  'currency' => 'JPY',
  'email' => 'foo@example.com'
}

token = spike.token.create(token_params)

request_params = {
  mount: 1000,
  currency: "JPY",
  card: token.id
}

products = [{
  title: "item title",
  description: "item description",
  price: 1000,
  stock: 10,
  language: "JA",
  count: 1,
  currency: "JPY",
  id: "00001"
}]

spike.charge.create(request_params, products)

Contributing

  1. Fork it ( https://github.com/spice-life/spike-ruby/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Pass tests (bundle exec rspec)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request