cricketscircle/bigcommerce-api-ruby — pull request #2 by brycemcd (2014-08-14 20:06:33+00:00)
Title: Adds order methods, fixes SSL

## What

It's quite possible that connecting via SSL never worked. Adds many tests so `Connection` supports the various ssl_* configuration options.

Also adds method `create_order` according to the documentation.

Prevents exceptions from being raised when the request results in a status code other than 2xx

## How to test

Set up an API connection according to the README

In an irb console:
`require_relative 'path/to/project/lib/bigcommerce'`

set an instance variable (like `order_hash`) to the hash below. Then issue the commands:
`api.create_order(order_hash) #=> returns order_id`
`api.update_order('order-id-from-above-command', {"products" => [{"product_id" => 101,"quantity" => 1}],"external_source" => "ecomm"} )`

```ruby
{
"customer_id"=> 0,
"order_is_digital"=> false,
"staff_notes"=> "I'm a staff note!",
"customer_message"=> "HI! I'm from a customer!",
"billing_address"=> {
"first_name"=> "Trisha",
"last_name"=> "McLaughlin",
"company"=> "",
"street_1"=> "12345 W Anderson Ln",
"street_2"=> "",
"city"=> "Austin",
"state"=> "Texas",
"zip"=> "78757",
"country"=> "United States",
"country_iso2"=> "US",
"phone"=> "",
"email"=> "elsie@example.com"
},
"shipping_addresses"=> [
{
"first_name"=> "Custy",
"last_name"=> "McWallethaver",
"company"=> "",
"street_1"=> "566 Sussex St",
"street_2"=> "",
"city"=> "New York",
"state"=> "NY",
"zip"=> "10013",
"country"=> "United States",
"country_iso2"=> "US",
"phone"=> "",
"email"=> "el@example.com"
}
],
"products"=> [
{
"product_id"=> 102,
"quantity"=> 2
}
],
"external_source"=> "the internet"
}
```