Skip to content

Instantly share code, notes, and snippets.

View twmills's full-sized avatar

Theo Mills twmills

View GitHub Profile
@twmills
twmills / se_example_ruby.rb
Last active August 29, 2015 13:57
Example ShippingEasy API order hash
{ "order" => {
"external_order_identifier" => "ABC-1004",
"ordered_at" => "2014-01-16 14:37:56 -0600",
"order_status" => "awaiting_shipment",
"subtotal_including_tax" => "10.00",
"total_including_tax" => "10.00",
"total_excluding_tax" => "10.00",
"discount_amount" => "0.00",
"coupon_discount" => "1.00",
"subtotal_including_tax" => "0.00",
@twmills
twmills / se_api_order_find_all.json
Created May 21, 2014 14:58
Example response of ShippingEasy API call: find all orders.
{"orders": [
{
"id": 73150,
"external_order_identifier": "45640",
"ordered_at": "2014-03-05T08:00:00Z",
"order_status": "ready_for_shipment",
"total_including_tax": "94.90",
"total_excluding_tax": "0.00",
"discount_amount": "0.00",
"coupon_discount": "0.00",
@twmills
twmills / se_api_find_order.json
Created May 21, 2014 15:07
Example response of ShippingEasy API call: find order.
{"order": {
"id": 73150,
"external_order_identifier": "45640",
"ordered_at": "2014-03-05T08:00:00Z",
"order_status": "ready_for_shipment",
"total_including_tax": "94.90",
"total_excluding_tax": "0.00",
"discount_amount": "0.00",
"coupon_discount": "0.00",
"subtotal_including_tax": "89.95",
@twmills
twmills / body.json
Last active August 29, 2015 14:02
Example ShippingEasy order payload.
{ "order":
{
"external_order_identifier":"ABC-100",
"ordered_at":"2014-01-16 14:37:56 -0600",
"order_status":"awaiting_shipment",
"subtotal_including_tax":"10.00",
"total_including_tax":"10.00",
"total_excluding_tax":"10.00",
"discount_amount":"0.00",
"coupon_discount":"1.00",
@twmills
twmills / account_payload.json
Created July 9, 2014 16:12
ShippingEasy Partner API New Account Payload
{
"account":{
"first_name":"Bonita",
"last_name":"Yundt",
"company_name":"Emard, Becker and Morissette",
"email":"heber@kuhlman.net",
"phone_number":"787.128.7490",
"address":"97509 Littel Throughway",
"address2":"",
"state":"AA",
@twmills
twmills / gist:7649e6abbb4642b6cec3
Created October 8, 2014 16:59
authentication example
<?php
$method = "post";
$path = "/presta/index.php";
$params = $_POST;
$json_body = http_get_request_body();
$authenticator = new ShippingEasy_Authenticator($method, $path, $params, $json_body);
$authenticator->isAuthenticated();
?>
@twmills
twmills / keybase.md
Created October 20, 2014 13:57
keybase.md

Keybase proof

I hereby claim:

  • I am twmills on github.
  • I am twmills (https://keybase.io/twmills) on keybase.
  • I have a public key whose fingerprint is E29A 5A60 4930 563F CD17 6DBA 88DD 15C8 F711 65EC

To claim this, I am signing this object:

@twmills
twmills / gist:83a8161c77e2c1404610
Created December 8, 2014 16:36
token generation example
<script type='text/javascript'>
EasyShip.token = function (orderNumber) {
var $token = "";
$.ajax({
url: "/tokens",
type: "post",
dataType: "json",
async:false,
data: { "order_number": orderNumber }
}).done(function(data) {
require 'date'
require 'time'
# Submission for RPCFN: Business Hours (#10)
# Theo Mills - June 2010
#
# BusinessHours creates a calendar of daily operating schedules for
# days-of-the-week and specific dates.
#
# Opening and closing times are stored as an array of strings,
#----------------------------------------------------------------------------
# Remove unnecessary Rails files
#----------------------------------------------------------------------------
run 'rm README'
run 'rm Gemfile'
run 'rm config/database.yml'
run 'rm public/index.html'
run 'rm public/favicon.ico'
run 'rm public/images/rails.png'
run 'touch README'