Queenbee

Build Status

Simple gem for communicating with external API. Heavily inspired by stripe gem.

Installation

Add this line to your application's Gemfile:

gem 'queenbee'

And then execute:

$ bundle

Or install it yourself as:

$ gem install queenbee

Usage

In your app

  1. Set token
Queenbee.token = ENV['QUEENBEE_TOKEN']
  1. Send order
Queenbee::Order.create(
  date: Time.now,
  currency: 'cad',
  client_email: '[email protected]',
  amount: '15',
  total_price: '15',
  city: 'Nancy',
  country: 'France',
  shipping: 0,
  uid: SecureRandom.hex(4),
  source: 'Stripe payment form'
)

For Sinatra app you may need to add require 'bundler/setup'

Tests

rake test

Complete list of parameters

  • uid (string, must be unique per application)
  • date (datetime. default to record creation timestamp. Should be used to send historic data)
  • currency (string. i.e. 'CAD')
  • amount (decimal)
  • tax (decimal)
  • shipping (decimal)
  • total_price (decimal)
  • gift (boolean, default false)
  • coupon (boolean, default false)
  • coupon_code (string)
  • country (string. i.e. 'Canada')
  • city (string)
  • url (string)
  • client_email (string)
  • products_count (integer, default 1)
  • subscribed_at (datetime. For recurring order)
  • unsubscribed_at (datetime. For recurring order)
  • fees (decimal)