New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

spree_fosdick_integration

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spree_fosdick_integration

  • 0.0.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SpreeFosdickIntegration

Current gem provides easy integration for you Spree Commerce based apps with full service fulfillment services of Fosdick Fulfillment.

Spree Commerce versions:

  • Spree Core - 3.6
  • Spree Auth Devise - 3.3

Installation

Add this line to your application's Gemfile:

gem 'spree_fosdick_integration'

Bundle your dependencies and run the installation generator:

bundle
bundle exec rails g spree_fosdick_integration:install

Update config/fosdick.yml with your credentials received from Fosdick

Usage

Create a rake task to push shipments to Fosdick iPost interface:

desc "Push shipments to Fosdick iPost interface"
task push_shipments_fosdick: :environment do
  eligible_shipments = Spree::Shipment.perform_fosdick_shipments

  if eligible_shipments.present?
    eligible_shipments.each do |shipment|
      Fosdick::Processor.send_shipment(shipment, FOSDICK_CONFIG)
    end
  end
end

Create a rake task to receive shipment information from Fosdick API:

desc "Receive shipment information from Fosdick API"
task receive_shipments_fosdick: :environment do
  eligible_shipments = Spree::FosdickShipment.eligible_fosdick_shipments

  if eligible_shipments.present?
    eligible_shipments.each do |fosdick_shipment|
      # get tracking details
      Fosdick::Processor.receive_shipment({external_order_num: fosdick_shipment.external_order_num }) if fosdick_shipment.tracking_number.nil?
      # get ship_date
      Fosdick::Processor.receive_shipment({external_order_num: fosdick_shipment.external_order_num }, 'shipments.json') if fosdick_shipment.ship_date.nil?
    end
  end
end

Override the email view to customise:

app/views/spree/fosdick_shipment_mailer/order_shipped.html.erb

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
bundle exec rspec spec

When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:

require 'spree_fosdick_integration/factories'

FAQs

Package last updated on 19 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc