Git Product home page Git Product logo

spree_shipstation's Introduction

Spree/ShipStation Integration

Integrates ShipStation with Spree. It enables ShipStation to pull shipments from the system and update tracking numbers.

For documentation on the API, see doc/ShipStationCustomStoreDevGuide.pdf

Configuring Spree

Add spree_shipstation to your Gemfile:

gem "spree_shipstation"

Alternatively you can use the git repo directly:

gem "spree_shipstation", git: "git://github.com/DynamoMTL/spree_shipstation.git"

Then, run bundler

$ bundle

Configure the ShipStation API username and password. This can be done in the app's spree initializer

# config/initializers/spree.rb
Spree.config do |config|
  if Rails.env.production?
    config.shipstation_username = "brett"
    config.shipstation_password = "hull"
  else
    config.shipstation_username = "jody"
    config.shipstation_password = "hull"
  end

  config.shipstation_weight_units = "Grams" # Grams, Ounces or Pounds

  # choose which number to send shipstation, use :shipment or :order, default is :shipment
  config.shipstation_number = :shipment

  # if you prefer to send notifications via shipstation
  config.send_shipped_email = false
end

For deployment on Heroku, you can configure the API username/password with environment variables:

# config/initializers/spree.rb
Spree.config do |config|
  config.shipstation_username = ENV['SHIPSTATION_USERNAME']
  config.shipstation_password = ENV['SHIPSTATION_PASSWORD']


  config.shipstation_weight_units = "Grams" # Grams, Ounces or Pounds
  config.send_shipped_email = false
end

And you can configure them with:

$ heroku config:set SHIPSTATION_USERNAME=brett SHIPSTATION_PASSWORD=hull

Configuring ShipStation

To do this, go to Settings and select Stores. Then click Add Store, scroll down and choose the Custom Store option.

  • For Username, enter the username defined in your config
  • For Password, enter the password defined in your config
  • For URL to custom page, enter the url: https://domain.tld/shipstation.xml
  • For Unpaid Status enter pending
  • For Paid Status enter ready
  • For Shipped Status enter shipped
  • For Cancelled Status enter cancelled

Testing

Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.

$ bundle
$ bundle exec rake test_app

To run tests:

$ bundle exec rspec spec

To run tests with guard (preferred):

$ bundle exec guard

Caveats

  • If you change the shipping method of an order in ShipStation, the change will not be reflected in Spree and the tracking link might not work

Copyright (c) 2013 Dynamo, released under the New BSD License

spree_shipstation's People

Contributors

joshnuss avatar bryanmtl avatar ehoch avatar swrobel avatar godalphul avatar neddenriep avatar jormon avatar nicocharlery avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.