Giter Club home page Giter Club logo

shopify-fulfillment-integration's Introduction

shopify-fulfillment-integration

A simple sinatra web app demonstrating how to integrate an existing fulfillment service with an API into Shopify using the Shopify Fulfillment Service API and the Shopify Embedded App SDK.

Check out the code in lib/* and read the docs to understand how the app works.

This app is built using the shopify-sinatra-app framework, take a look at the framework readme for information about developing locally and deploying to Heroku.

This particular app is an example integration with Shipwire. Check out the other branches to see how this integration can be used with the other services built into Active Fulfillment such as Webgistix and Amazon Marketplace Web.

After you have the app running visit the install page (located at your url + '/install') and install the app on your Shopify test store. Then you will need to add your Shipwire Credentials - you can create a Shipwire developer account which will let you make requests in test mode - the app is configured for this by default. In test mode Shipwire will always return the same data regardless of what is in the request. Therefore when creating a product to use the custom fulfillment app always use either GD802-024 or GD201-500 for the SKU.

If you use this template as a starting point for building an integration it is strongly recommended that you follow a similar pattern used here and add the specific logic for formating and parsing the requests to the Active Fulfillment library.

Running Tests

First run the rake command test:prepare which will initialize the test database. Then simply run:

rake test

shopify-fulfillment-integration's People

Contributors

cursedcoder avatar icefox avatar kevinhughes27 avatar tmlayton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shopify-fulfillment-integration's Issues

tests now fail

When running 'bundle exec rake test' it looks like the testing framework that was being used has been deprecated and it fails to run any tests and just outputs warnings about how the tests should be upgraded :\

$ bundle exec rake test
/usr/bin/ruby2.1 -I"lib:test" -I"/var/lib/gems/2.1.0/gems/rake-10.1.1/lib" "/var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb" "test/__test.rb"
Warning: you should require 'minitest/autorun' instead.
Warning: or add 'gem "minitest"' before 'require "minitest/autorun"'
From:
/usr/lib/ruby/2.1.0/test/unit.rb:1:in require' /usr/lib/ruby/2.1.0/test/unit.rb:1:in<top (required)>'
/home/ben/public_html/shopify-fulfillment-integration/test/test_helper.rb:4:in require' /home/ben/public_html/shopify-fulfillment-integration/test/test_helper.rb:4:in<top (required)>'
/home/ben/public_html/shopify-fulfillment-integration/test/app_test.rb:1:in require' /home/ben/public_html/shopify-fulfillment-integration/test/app_test.rb:1:in<top (required)>'
/var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:10:in require' /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:10:inblock (2 levels) in

'
/var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:9:in each' /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:9:inblock in '
/var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:4:in select' /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:4:in'
MiniTest::Unit::TestCase is now Minitest::Test. From /usr/lib/ruby/2.1.0/test/unit/testcase.rb:8:in <module:Unit>' /usr/lib/ruby/2.1.0/test/unit.rb:676:inclass:Runner': undefined method _run_suite' for classTest::Unit::Runner' (NameError)
from /usr/lib/ruby/2.1.0/test/unit.rb:261:in <module:Unit>' from /usr/lib/ruby/2.1.0/test/unit.rb:15:inmodule:Test'
from /usr/lib/ruby/2.1.0/test/unit.rb:7:in <top (required)>' from /home/ben/public_html/shopify-fulfillment-integration/test/test_helper.rb:4:inrequire'
from /home/ben/public_html/shopify-fulfillment-integration/test/test_helper.rb:4:in <top (required)>' from /home/ben/public_html/shopify-fulfillment-integration/test/app_test.rb:1:inrequire'
from /home/ben/public_html/shopify-fulfillment-integration/test/app_test.rb:1:in <top (required)>' from /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:10:inrequire'
from /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:10:in block (2 levels) in <main>' from /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:9:ineach'
from /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:9:in block in <main>' from /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:4:inselect'
from /var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:4:in `'
rake aborted!
Command failed with status (1): [ruby -I"lib:test" -I"/var/lib/gems/2.1.0/gems/rake-10.1.1/lib" "/var/lib/gems/2.1.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb" "test/__test.rb" ]

Tasks: TOP => test
(See full trace by running task with --trace)

Example Outdated

Just dropping a second issue on top of the one from 3 years ago.

Can this example be redone with the new Remix app framework and new Fullfilment guidelines?

Trying to implement a simple dropshipping app integration with Shopify and it's a mess of misleading information, and confusing documentation / examples.

Hooks should be installed using WebhooksManager

As this is cited as example code for teaching new developers this should use the built in ShopifyApp::WebhooksManager rather than directly calling Webhook.new(). It is much too easy for developers to go off and roll there own hook solution that isn't as good as WebhooksManager if they don't know it exists, potentially building something that causes problems down the road when their home grown hook doesn't use a queue and times out.

Edit: I would make a patch that changes it to use WebhooksManager, but I am not entirely sure the correct way to do that (my current project is just more copy/paste of more web hooks from the example, but I recognize that it is bad and should be changed) so I have made a pull request to at least mention it so others will be aware of it earlier when just reading over the code.

Edit2: Along the same lines I am not sure if I have done something wrong, but the install is never called so I now just call it explicitly inside of '/', was the install/uninstall deprecated a while back in favor of something like WebhooksManager?

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.