Giter Site home page Giter Site logo

ship_compliant-ruby's Introduction

ShipCompliant - Ruby API Client

The ShipCompliant gem is an API Client for the SOAP API provided by ShipCompliant. This gem has been created for fast implementation and supports the 9 main API calls.

Documentation | RDoc | CoreService V1.2

Coverage Status Build Status Code Climate

Installation

Add this line to your application's Gemfile:

gem 'ship_compliant'

And then execute:

$ bundle install

Add this to config/initializers/ship_compliant.rb

ShipCompliant.configure do |c|
  c.partner_key = ENV.fetch('SHIP_COMPLIANT_KEY')
  c.username = ENV.fetch('SHIP_COMPLIANT_USER')
  c.password = ENV.fetch('SHIP_COMPLIANT_PASS')
end

Usage

TODO: Coming soon...

Contributing

  1. Fork it ( http://github.com/ShipCompliant/ship_compliant-ruby/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

ship_compliant-ruby's People

Contributors

jtapia avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ship_compliant-ruby's Issues

Excon::Error::Certificate: SSL_connect certificate verify failed

Hey guys,

I've been using this package and today we've been getting some errors from our production as seen below.

I can't seem to figure out why this has occurred. I've had to turn ssl_verify_peer off, but I'm surprised it's unable to verify anything. As far as I can tell, ShipCompliant's SSL appears to be solid and so does the host machine. Yet, something is failing.

No SSL certs are custom added to Excon and I'm wondering if it could be an issue with ShipCompliant.

The error:

Excon::Error::Certificate: SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate) (OpenSSL::SSL::SSLError) Unable to verify certificate. This may be an issue with the remote host or with Excon. Excon has certificates bundled, but these can be customized:

            `Excon.defaults[:ssl_ca_path] = path_to_certs`
            `ENV['SSL_CERT_DIR'] = path_to_certs`
            `Excon.defaults[:ssl_ca_file] = path_to_file`
            `ENV['SSL_CERT_FILE'] = path_to_file`
            `Excon.defaults[:ssl_verify_callback] = callback`
                (see OpenSSL::SSL::SSLContext#verify_callback)
or:
            `Excon.defaults[:ssl_verify_peer] = false` (less secure).
/var/web/app/shared/bundle/ruby/2.6.0/gems/excon-0.62.0/lib/excon/ssl_socket.rb:118:in `connect_nonblock'
/var/web/app/shared/bundle/ruby/2.6.0/gems/excon-0.62.0/lib/excon/ssl_socket.rb:118:in `initialize'
/var/web/app/shared/bundle/ruby/2.6.0/gems/excon-0.62.0/lib/excon/connection.rb:429:in `new'
/var/web/app/shared/bundle/ruby/2.6.0/gems/excon-0.62.0/lib/excon/connection.rb:429:in `socket'
/var/web/app/shared/bundle/ruby/2.6.0/gems/excon-0.62.0/lib/excon/connection.rb:111:in `request_call'
/var/web/app/shared/bundle/ruby/2.6.0/gems/excon-0.62.0/lib/excon/middlewares/mock.rb:48:in `request_call'
/var/web/app/shared/bundle/ruby/2.6.0/gems/excon-0.62.0/lib/excon/middlewares/instrumentor.rb:26:in `request_call'
/var/web/app/shared/bundle/ruby/2.6.0/gems/excon-0.62.0/lib/excon/middlewares/base.rb:16:in `request_call'
/var/web/app/shared/bundle/ruby/2.6.0/gems/excon-0.62.0/lib/excon/middlewares/base.rb:16:in `request_call'
/var/web/app/shared/bundle/ruby/2.6.0/gems/excon-0.62.0/lib/excon/middlewares/base.rb:16:in `request_call'
/var/web/app/shared/bundle/ruby/2.6.0/gems/excon-0.62.0/lib/excon/connection.rb:260:in `request'
/var/web/app/shared/bundle/ruby/2.6.0/gems/excon-0.62.0/lib/excon/connection.rb:339:in `get'
/var/web/app/shared/bundle/ruby/2.6.0/gems/httpi-2.4.4/lib/httpi/adapter/excon.rb:25:in `request'
/var/web/app/shared/bundle/ruby/2.6.0/gems/httpi-2.4.4/lib/httpi.rb:161:in `request'
/var/web/app/shared/bundle/ruby/2.6.0/gems/httpi-2.4.4/lib/httpi.rb:127:in `get'
/var/web/app/shared/bundle/ruby/2.6.0/gems/wasabi-3.5.0/lib/wasabi/resolver.rb:43:in `load_from_remote'
/var/web/app/shared/bundle/ruby/2.6.0/gems/wasabi-3.5.0/lib/wasabi/resolver.rb:33:in `resolve'
/var/web/app/shared/bundle/ruby/2.6.0/gems/wasabi-3.5.0/lib/wasabi/document.rb:142:in `xml'
/var/web/app/shared/bundle/ruby/2.6.0/gems/wasabi-3.5.0/lib/wasabi/document.rb:160:in `parse'
/var/web/app/shared/bundle/ruby/2.6.0/gems/wasabi-3.5.0/lib/wasabi/document.rb:147:in `parser'
/var/web/app/shared/bundle/ruby/2.6.0/gems/wasabi-3.5.0/lib/wasabi/document.rb:64:in `soap_actions'
/var/web/app/shared/bundle/ruby/2.6.0/gems/savon-2.12.0/lib/savon/operation.rb:22:in `ensure_exists!'
/var/web/app/shared/bundle/ruby/2.6.0/gems/savon-2.12.0/lib/savon/operation.rb:15:in `create'
/var/web/app/shared/bundle/ruby/2.6.0/gems/savon-2.12.0/lib/savon/client.rb:32:in `operation'
/var/web/app/shared/bundle/ruby/2.6.0/gems/savon-2.12.0/lib/savon/client.rb:36:in `call'
/var/web/app/shared/bundle/ruby/2.6.0/bundler/gems/ship_compliant-ruby-7fb91ddf9ef7/lib/ship_compliant/client.rb:38:in `call'
/var/web/app/shared/bundle/ruby/2.6.0/bundler/gems/ship_compliant-ruby-7fb91ddf9ef7/lib/ship_compliant/add_update_brand.rb:41:in `brand'

What our Excon connection looks like:

#<Excon::Connection:7edaa10
  @data={
    :chunk_size=>1048576,
    :ciphers=>"ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS", 
    :connect_timeout=>60,
    :debug_request=>false, 
    :debug_response=>false, 
    :headers=>{}, 
    :idempotent=>false, 
    :instrumentor_name=>"excon", 
    :middlewares=>[
      Excon::Middleware::ResponseParser, 
      Excon::Middleware::Expects, 
      Excon::Middleware::Idempotent, 
      Excon::Middleware::Instrumentor, 
      Excon::Middleware::Mock
    ],
    :mock=>false,
    :nonblock=>true, 
    :omit_default_port=>false, 
    :persistent=>false, 
    :read_timeout=>60, 
    :retry_limit=>4, 
    :ssl_verify_peer=>true, 
    :ssl_uri_schemes=>["https"], 
    :stubs=>:global, 
    :tcp_nodelay=>false, 
    :thread_safe_sockets=>true, 
    :uri_parser=>URI, 
    :versions=>"excon/0.62.0 (x86_64-linux) ruby/2.6.2", 
    :write_timeout=>60, 
    :host=>"ws.shipcompliant.com", 
    :path=>"/services/1.2/coreservice.asmx", 
    :port=>443, 
    :query=>"WSDL", 
    :scheme=>"https", 
    :body=>nil, 
    :hostname=>"ws.shipcompliant.com"
  }
  @socket_key="https://ws.shipcompliant.com:443"
  @_excon_sockets={6576560=>{}}
>

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.