Skip to content

Instantly share code, notes, and snippets.

View twmills's full-sized avatar

Theo Mills twmills

View GitHub Profile
@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) {
@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: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 / 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 / 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 / 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 / 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_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 / order_array.php
Last active July 29, 2016 10:54
Example payload for ShippingEasy_Order
<?php
array(
"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",
@twmills
twmills / create_order.sh
Last active January 3, 2016 12:29
ShippingEasy Example API Call (subject to change)
curl -XPOST https://app.shippingeasy.com/api/orders?api_key=fc2d75c0212154d4ff394bfdc436b45a&api_timestamp=1390314539&api_signature=662f775289a34b3852fa28230f396ae73433c793c86b120be6bf7252816d83a1 -d '{
"order" : {
"order_identifier":"ABC-1004",
"ordered_at":"2014-01-16 14:37:56 -0600",
"order_status":"awaiting_shipment",
"subtotal_including_tax":10.0,
"total_including_tax":10.0,
"total_excluding_tax":10.0,
"discount_amount":0,
"shipping_cost_including_tax":1.5,