stellae-ruby-api 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1d02f04b187da3b5e02bd46e21bda3c47ccce391
4
+ data.tar.gz: 57952e88bbb13a6f4ca393ca692c9fc844a97167
5
+ SHA512:
6
+ metadata.gz: f168e8c6f321a728f44d21c1e1e89bb48e16e3e3f3f090f53dbe64f5321f95a332bacaacc8cb743f2c7e1381cb761c4a91e68eabda3969291c52304f5d1bd478
7
+ data.tar.gz: eeef780128a04a0fee31dfcf6ee098602707c230babb8184f1070ae1b092a3432a2f97932cdeb95e5b431369e4d9d6530cc9624318b373684a29c23ad652e3cb
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/.travis.yml ADDED
@@ -0,0 +1,26 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+
5
+ matrix:
6
+ allow_failures:
7
+ - rvm: rbx-19mode
8
+
9
+ services:
10
+ - redis
11
+
12
+ script:
13
+ - bundle exec rake
14
+
15
+ # addons:
16
+ # code_climate:
17
+ # repo_token: f0884115cadbe82b33756e38a9cd32d5129304746a17126d6c7da02e7a69910a
18
+
19
+ notifications:
20
+ email:
21
+ - justin@jgrubbs.net
22
+
23
+ gemfile:
24
+ - Gemfile
25
+
26
+
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in stellae.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Justin Grubbs
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # Stellae
2
+
3
+ [![Build Status](https://travis-ci.org/jGRUBBS/stellae-ruby-api.svg?branch=master)](https://travis-ci.org/jGRUBBS/stellae-ruby-api)
4
+ [![Code Climate](https://codeclimate.com/github/jGRUBBS/stellae-ruby-api.png)](https://codeclimate.com/github/jGRUBBS/stellae-ruby-api)
5
+
6
+ Ruby library for interfacing with the Stellae Fulfillment API
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ gem 'stellae-ruby-api'
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install stellae-ruby-api
21
+
22
+ ## Usage
23
+
24
+ ```ruby
25
+
26
+ order = {
27
+ carrier: "FEDEX",
28
+ billing_address: {
29
+ first_name: "John",
30
+ last_name: "Smith",
31
+ address1: "123 Here Now",
32
+ address2: "2nd Floor",
33
+ address3: "",
34
+ city: "New York",
35
+ state: "New York",
36
+ country: "US",
37
+ zipcode: "10012",
38
+ phone: "123-123-1234"
39
+ },
40
+ shipping_address: {
41
+ first_name: "John",
42
+ last_name: "Smith",
43
+ address1: "123 Here Now",
44
+ address2: "2nd Floor",
45
+ address3: "",
46
+ city: "New York",
47
+ state: "New York",
48
+ country: "US",
49
+ zipcode: "10012",
50
+ phone: "123-123-1234"
51
+ },
52
+ gift_wrap: "true",
53
+ gift_message: "Happy Birthday!",
54
+ email: "someone@somehwere.com",
55
+ number: "R123123123",
56
+ type: "OO",
57
+ line_items: [
58
+ {
59
+ price: "127.23",
60
+ quantity: "1",
61
+ sku: "123332211",
62
+ size: "XS"
63
+ }
64
+ ],
65
+ shipping_code: "90",
66
+ invoice_url: "http://example.com/R123123123/invoice"
67
+ }
68
+
69
+ client = Stellae::Client.new("username", "password")
70
+ response = client.send_order_request(order)
71
+
72
+ if response.success?
73
+ # DO SOMETHING
74
+ else
75
+ # QUEUE REQUEST, STORE AND RAISE ERRORS
76
+ end
77
+
78
+ ```
79
+
80
+ ## Contributing
81
+
82
+ 1. Fork it
83
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
84
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
85
+ 4. Push to the branch (`git push origin my-new-feature`)
86
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake'
3
+ require 'rake/testtask'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+ task :default => :spec
@@ -0,0 +1,128 @@
1
+ require 'net/https'
2
+ require 'xmlsimple'
3
+
4
+ module Stellae
5
+ class Client
6
+
7
+ PORT = 443
8
+ TEST_HOST = "webservice.stellae.us"
9
+ TEST_PATH = "/SIIServices/Siiservice.svc?wsdl"
10
+ LIVE_HOST = "www.stellae.us"
11
+ LIVE_PATH = "/webservices/SIIService.svc?wsdl"
12
+ KEYS_MAP = { "on_hand" => "qty" }
13
+
14
+ attr_accessor :username, :password, :response, :type, :request_uri
15
+
16
+ def initialize(username, password, options = {})
17
+ raise "Username is required" unless username
18
+ raise "Password is required" unless password
19
+
20
+ @username = username
21
+ @password = password
22
+ @options = default_options.merge!(options)
23
+ end
24
+
25
+ def send_order_request(order)
26
+ request = Order.new(self).build_order_request(order)
27
+ response = post(request)
28
+ end
29
+
30
+ def order_request(order)
31
+ Order.new(self).build_order_request(order)
32
+ end
33
+
34
+ def get_inventory
35
+ request = Inventory.new(self).build_inventory_request
36
+ response = post(request)
37
+ result = response.result['Inventory_values'][0]['UPC_Inventory_Response']
38
+ return nil if result.blank?
39
+ map_results(result)
40
+ end
41
+
42
+ def upcs(inventory)
43
+ inventory.collect { |s| s["upc"] }
44
+ end
45
+
46
+ def mapped_inventory(upcs, inventory)
47
+ inventory.collect do |stock|
48
+ if upcs.include?(stock["upc"])
49
+ { quantity: stock["qty"].to_i }
50
+ end
51
+ end.compact
52
+ end
53
+
54
+ def request_uri
55
+ "https://#{host}#{path}"
56
+ end
57
+
58
+ private
59
+ def default_options
60
+ {
61
+ verbose: false,
62
+ test_mode: false
63
+ }
64
+ end
65
+
66
+ def testing?
67
+ @options[:test_mode]
68
+ end
69
+
70
+ def verbose?
71
+ @options[:verbose]
72
+ end
73
+
74
+ def host
75
+ testing? ? TEST_HOST : LIVE_HOST
76
+ end
77
+
78
+ def path
79
+ testing? ? TEST_PATH : LIVE_PATH
80
+ end
81
+
82
+ def log(message)
83
+ return unless verbose?
84
+ puts message
85
+ end
86
+
87
+ def http
88
+ @http ||= Net::HTTP.new(host, PORT)
89
+ end
90
+
91
+ def request(xml_request)
92
+ request = Net::HTTP::Post.new(path)
93
+ request.body = xml_request
94
+ request.content_type = 'application/soap+xml; charset=utf-8'
95
+ http.use_ssl = true
96
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
97
+ http.request(request)
98
+ end
99
+
100
+ def post(xml_request)
101
+ response = request(xml_request)
102
+ parse_response(response.body)
103
+ end
104
+
105
+ def parse_response(xml_response)
106
+ log xml_response
107
+ @response = Response.new(xml_response, @type)
108
+ end
109
+
110
+ def map_results(results)
111
+ results = flatten_results(results)
112
+ results.map do |h|
113
+ h.inject({ }) { |x, (k,v)| x[map_keys(k)] = v; x }
114
+ end
115
+ end
116
+
117
+ def flatten_results(results)
118
+ @flattened ||= results.map do |h|
119
+ h.each { |k,v| h[k] = v[0] }
120
+ end
121
+ end
122
+
123
+ def map_keys(key)
124
+ KEYS_MAP[key] || key
125
+ end
126
+
127
+ end
128
+ end
@@ -0,0 +1,11 @@
1
+ module Stellae
2
+ class Inventory < Request
3
+
4
+ def build_inventory_request
5
+ construct_xml "get_inventory_on_hand" do |xml|
6
+ xml.upcs :"xmlns:b" => SCHEMA[:datacontract], :"xmlns:i" => SCHEMA[:instance]
7
+ end
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,104 @@
1
+ module Stellae
2
+ class Order < Request
3
+
4
+ def build_order_request(order)
5
+ construct_xml "new_order_entry" do |xml|
6
+
7
+ xml.ohn :"xmlns:b" => SCHEMA[:datacontract], :"xmlns:i" => SCHEMA[:instance] do
8
+ xml.b :CARRIER, order[:carrier]
9
+ xml.b :CURRENCY, order[:currency]
10
+ build_address(xml, "CUSTOMER", order[:billing_address])
11
+ xml.b :CUSTOMER_CODE
12
+ xml.b :CUSTOMER_PO, :"i:nil" => "true"
13
+ build_address xml, "DELIVERY", order[:shipping_address]
14
+ xml.b :DELIVERY_DC_EDI, :"i:nil" => "true"
15
+ xml.b :DELIVERY_DOOR_EDI, :"i:nil" => "true"
16
+ xml.b :DELIVERY_FROM, :"i:nil" => "true"
17
+ xml.b :DELIVERY_ID, :"i:nil" => "true"
18
+ xml.b :DELIVERY_MESSAGE do
19
+ xml.cdata!(order[:gift_message])
20
+ end
21
+ xml.b :DELIVERY_TO, :"i:nil" => "true"
22
+ xml.b :DISCOUNT, order[:item_discount] || 0
23
+ xml.b :EMAIL, order[:email]
24
+ xml.b :FREIGHT_ACCOUNT, :"i:nil" => "true"
25
+ xml.b :MISC1, 0
26
+ xml.b :MISC1_REASON, :"i:nil" => "true"
27
+ xml.b :MISC2, 0
28
+ xml.b :MISC2_REASON, :"i:nil" => "true"
29
+ xml.b :ORDER_ID, order[:number]
30
+ xml.b :ORDER_TYPE, order[:type] || 'OO'
31
+ build_line_items xml, order
32
+ xml.b :SERVICE, order[:shipping_code]
33
+ xml.b :SHIPPING_FEES, shipping_fees(order)
34
+ xml.b :TAXES, order[:tax] || 0
35
+ xml.b :TOTAL_AMOUNT, order[:total_amount] || 0
36
+ xml.b :USER1 do
37
+ xml.cdata!(order[:invoice_url])
38
+ end
39
+ xml.b :USER2, :"i:nil" => "true"
40
+ xml.b :USER3, :"i:nil" => "true"
41
+ xml.b :USER4, :"i:nil" => "true"
42
+ xml.b :USER5, :"i:nil" => "true"
43
+ xml.b :WAREHOUSE, :"i:nil" => "true"
44
+ end
45
+
46
+ end
47
+ end
48
+
49
+ private
50
+
51
+ def build_address(xml, type, address)
52
+ full_name = "#{address[:first_name]} #{address[:last_name]}"
53
+ xml.b :"#{type}_NAME" do
54
+ xml.cdata!(full_name)
55
+ end
56
+ xml.b :"#{type}_ADDRESS_1" do
57
+ xml.cdata!(address[:address1])
58
+ end
59
+ xml.b :"#{type}_ADDRESS_2" do
60
+ xml.cdata!(address[:address2])
61
+ end
62
+ xml.b :"#{type}_ADDRESS_3" do
63
+ xml.cdata!(address[:address3]) if address[:address3]
64
+ end
65
+ xml.b :"#{type}_ADDRESS_CITY", address[:city]
66
+ xml.b :"#{type}_ADDRESS_COUNTRY", address[:country]
67
+ xml.b :"#{type}_ADDRESS_STATE", address[:state]
68
+ xml.b :"#{type}_ADDRESS_ZIP", address[:zipcode]
69
+ xml.b :"#{type}_TELEPHONE", address[:phone]
70
+ end
71
+
72
+ def build_line_items(xml, order)
73
+ xml.b :Order_Details do
74
+ order[:line_items].each do |line_item|
75
+ xml.b :Order_Detail_New do
76
+ xml.b :COST, :"i:nil" => "true"
77
+ xml.b :FLAGS, :"i:nil" => "true"
78
+ xml.b :LINE_ID, :"i:nil" => "true"
79
+ xml.b :LOT_NUMBER, :"i:nil" => "true"
80
+ xml.b :PRICE, line_item[:price]
81
+ xml.b :QUANTITY, line_item[:quantity]
82
+ xml.b :RETAIL_PRICE, :"i:nil" => "true"
83
+ xml.b :SEASON, :"i:nil" => "true"
84
+ xml.b :SIZE, line_item[:size]
85
+ xml.b :SKU, line_item[:sku]
86
+ end
87
+ end
88
+ end
89
+ end
90
+
91
+ def shipping_cost(order)
92
+ order[:shipping_cost] || 0
93
+ end
94
+
95
+ def shipping_discount(order)
96
+ order[:shipping_discount] || 0
97
+ end
98
+
99
+ def shipping_fees(order)
100
+ shipping_cost(order).abs - shipping_discount(order).abs
101
+ end
102
+
103
+ end
104
+ end
@@ -0,0 +1,51 @@
1
+ require 'builder'
2
+
3
+ module Stellae
4
+ class Request
5
+
6
+ SCHEMA = {
7
+ soap_envelop: "http://www.w3.org/2003/05/soap-envelope",
8
+ addressing: "http://www.w3.org/2005/08/addressing",
9
+ datacontract: "http://schemas.datacontract.org/2004/07/",
10
+ instance: "http://www.w3.org/2001/XMLSchema-instance"
11
+ }
12
+
13
+ def initialize(client)
14
+ @client = client
15
+ end
16
+
17
+ def construct_xml(type)
18
+ @client.type = type
19
+ xml = Builder::XmlMarkup.new
20
+ xml.s :Envelope, :"xmlns:s" => SCHEMA[:soap_envelop], :"xmlns:a" => SCHEMA[:addressing] do
21
+ build_header(xml, type)
22
+ xml.s :Body do
23
+ xml.tag! type, :"xmlns" => "SII" do
24
+ build_user xml
25
+ yield(xml)
26
+ end
27
+ end
28
+ end
29
+ xml.target!
30
+ end
31
+
32
+ def build_header(xml, action)
33
+ xml.s :Header do
34
+ xml.a :Action, "SII/ISIIService/#{action}", :"s:mustUnderstand" => "1"
35
+ xml.a :MessageID, "urn:uuid:56b55a70-8bbc-471d-94bb-9ca060bcf99f"
36
+ xml.a :ReplyTo do
37
+ xml.a :Address, "http://www.w3.org/2005/08/addressing/anonymous"
38
+ end
39
+ xml.a :To, @client.request_uri.split('?').first, :"s:mustUnderstand" => "1"
40
+ end
41
+ end
42
+
43
+ def build_user(xml)
44
+ xml.user :"xmlns:b" => SCHEMA[:datacontract], :"xmlns:i" => SCHEMA[:instance] do
45
+ xml.b :user_name, @client.username
46
+ xml.b :user_password, @client.password
47
+ end
48
+ end
49
+
50
+ end
51
+ end
@@ -0,0 +1,59 @@
1
+ module Stellae
2
+ class Response
3
+
4
+ CODES = {
5
+ "0001" => "success",
6
+ "0002" => "Bad login information",
7
+ "0003" => "Login points to multiple databases",
8
+ "0005" => "Invalid order type must be OO or CM",
9
+ "0006" => "Error creating order header",
10
+ "0007" => "Bad UPC/EAN13",
11
+ "0008" => "Duplicate order – order number exists in database",
12
+ "0009" => "Problem with line item import"
13
+ }
14
+
15
+ attr_accessor :response, :status, :result
16
+
17
+ def initialize(raw_response, type)
18
+ build_response(raw_response)
19
+ @type = type
20
+ end
21
+
22
+ def build_response(raw_response)
23
+ @response ||= {
24
+ raw: raw_response,
25
+ parsed: parse_response(raw_response)
26
+ }
27
+ end
28
+
29
+ def error
30
+ "Stellae::Error - #{status}"
31
+ end
32
+
33
+ def failure?
34
+ !success?
35
+ end
36
+
37
+ def status
38
+ @status = CODES[raw_status] || raw_status
39
+ end
40
+
41
+ def raw_status
42
+ result['status'][0]
43
+ end
44
+
45
+ def result
46
+ @response[:parsed]['Body'][0]["#{@type}Response"][0]["#{@type}Result"][0]
47
+ end
48
+
49
+ def success?
50
+ status == 'success'
51
+ end
52
+
53
+ def parse_response(xml_response)
54
+ return nil if xml_response.empty?
55
+ XmlSimple.xml_in(xml_response)
56
+ end
57
+
58
+ end
59
+ end
@@ -0,0 +1,3 @@
1
+ module Stellae
2
+ VERSION = "0.0.1"
3
+ end
data/lib/stellae.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "stellae/version"
2
+ require "stellae/response"
3
+ require "stellae/client"
4
+ require "stellae/request"
5
+ require "stellae/order"
6
+ require "stellae/inventory"
@@ -0,0 +1,50 @@
1
+ require 'spec_helper'
2
+
3
+ describe Stellae::Client do
4
+ let(:client) { Stellae::Client.new("TESTACCOUNT", "TESTPASSWORD", test_mode: true) }
5
+
6
+ describe '#send_order_request', :vcr do
7
+ let(:result) { client.send_order_request(order_hash) }
8
+
9
+ it 'sends an order request and returns a parsed respose' do
10
+ expect(result).to be_a(Stellae::Response)
11
+ expect(result.success?).to eq(true)
12
+ end
13
+ end
14
+
15
+ context 'inventory methods' do
16
+ let(:result) { client.get_inventory }
17
+ let(:upcs) { client.upcs(result) }
18
+
19
+ describe '#get_inventory' do
20
+ it 'gets inventory and maps results into an array of hashes' do
21
+ expect(result).to be_a(Array)
22
+ expect(result.first).to have_key("qty")
23
+ end
24
+ end
25
+
26
+ describe '#upcs' do
27
+ it 'returns an array of upcs' do
28
+ expect(upcs).to be_a(Array)
29
+ expect(upcs).not_to be_empty
30
+ end
31
+ end
32
+
33
+ describe '#mapped_inventory' do
34
+ let(:mapped_inventory) { client.mapped_inventory(upcs, result) }
35
+
36
+ it 'returns an array of quantity hashes' do
37
+ expect(mapped_inventory).to be_a(Array)
38
+ expect(mapped_inventory.first).to have_key(:quantity)
39
+ end
40
+ end
41
+
42
+ end
43
+
44
+ describe '#request_uri' do
45
+ it 'returns the complete request uri' do
46
+ expect(client.request_uri).to eq("https://webservice.stellae.us/SIIServices/Siiservice.svc?wsdl")
47
+ end
48
+ end
49
+
50
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe Stellae::Order do
4
+
5
+ describe '#build_order_request' do
6
+ it 'is pending'
7
+ end
8
+
9
+ end
@@ -0,0 +1,69 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # Require this file using `require "spec_helper"` to ensure that it is only
4
+ # loaded once.
5
+
6
+ require 'rubygems'
7
+ require 'bundler/setup'
8
+ Bundler.require(:default, :development)
9
+ require 'hashie'
10
+ require 'stellae'
11
+ require 'support/vcr'
12
+
13
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
14
+ RSpec.configure do |config|
15
+ config.treat_symbols_as_metadata_keys_with_true_values = true
16
+ config.run_all_when_everything_filtered = true
17
+ config.filter_run :focus
18
+ config.order = 'random'
19
+ end
20
+
21
+ def order_hash
22
+ {
23
+ carrier: "FEDEX",
24
+ billing_address: {
25
+ first_name: "John",
26
+ last_name: "Smith",
27
+ address1: "123 Here Now",
28
+ address2: "2nd Floor",
29
+ address3: "",
30
+ city: "New York",
31
+ state: "New York",
32
+ country: "US",
33
+ zipcode: "10012",
34
+ phone: "123-123-1234"
35
+ },
36
+ shipping_address: {
37
+ first_name: "John",
38
+ last_name: "Smith",
39
+ address1: "123 Here Now",
40
+ address2: "2nd Floor",
41
+ address3: "",
42
+ city: "New York",
43
+ state: "New York",
44
+ country: "US",
45
+ zipcode: "10012",
46
+ phone: "123-123-1234"
47
+ },
48
+ gift_wrap: "true",
49
+ gift_message: "Happy Birthday!",
50
+ email: "someone@somehwere.com",
51
+ number: "R123123123",
52
+ type: "OO",
53
+ currency: "USD",
54
+ line_items: [
55
+ {
56
+ price: "127.23",
57
+ quantity: "1",
58
+ sku: "326604071",
59
+ size: "XS"
60
+ }
61
+ ],
62
+ shipping_code: "90",
63
+ invoice_url: "http://example.com/R123123123/invoice",
64
+ shipping_cost: 10,
65
+ shipping_discount: -5,
66
+ item_discount: 0,
67
+ total_amount: 132.23
68
+ }
69
+ end
@@ -0,0 +1,22 @@
1
+ require 'vcr'
2
+
3
+ def underscorize(key)
4
+ key.to_s.sub(/^(v[0-9]+|ns):/, "")
5
+ .gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
6
+ .gsub(/([a-z\d])([A-Z])/,'\1_\2').downcase
7
+ end
8
+
9
+ VCR.configure do |c|
10
+ c.cassette_library_dir = File.join(Dir.pwd, 'spec/vcr')
11
+ c.hook_into :webmock
12
+ end
13
+
14
+ RSpec.configure do |c|
15
+ c.around(:each, :vcr) do |example|
16
+ name = example.metadata[:full_description]
17
+ name = name.split(/\s+/, 2).join("/")
18
+ name = underscorize(name)
19
+ name = name.gsub(/[^\w\/]+/, "_")
20
+ VCR.use_cassette(name) { example.call }
21
+ end
22
+ end
@@ -0,0 +1,72 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://webservice.stellae.us/SIIServices/Siiservice.svc?wsdl
6
+ body:
7
+ encoding: UTF-8
8
+ string: <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action
9
+ s:mustUnderstand="1">SII/ISIIService/get_inventory_on_hand</a:Action><a:MessageID>urn:uuid:56b55a70-8bbc-471d-94bb-9ca060bcf99f</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To
10
+ s:mustUnderstand="1">https://webservice.stellae.us/SIIServices/Siiservice.svc</a:To></s:Header><s:Body><get_inventory_on_hand
11
+ xmlns="SII"><user xmlns:b="http://schemas.datacontract.org/2004/07/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><b:user_name>TESTACCOUNT</b:user_name><b:user_password>TESTPASSWORD</b:user_password></user><upcs
12
+ xmlns:b="http://schemas.datacontract.org/2004/07/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/></get_inventory_on_hand></s:Body></s:Envelope>
13
+ headers:
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - '*/*'
18
+ User-Agent:
19
+ - Ruby
20
+ Content-Type:
21
+ - application/soap+xml; charset=utf-8
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Content-Length:
28
+ - '5070'
29
+ Content-Type:
30
+ - application/soap+xml; charset=utf-8
31
+ Server:
32
+ - Microsoft-IIS/8.5
33
+ X-Powered-By:
34
+ - ASP.NET
35
+ Date:
36
+ - Mon, 17 Aug 2015 20:58:56 GMT
37
+ body:
38
+ encoding: UTF-8
39
+ string: <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action
40
+ s:mustUnderstand="1">SII/ISIIService/get_inventory_on_handResponse</a:Action><ActivityId
41
+ CorrelationId="c9f9b908-fa88-498f-a616-61702225871b" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">f5df4c89-2f2e-4b56-99b2-75fe06214a06</ActivityId><a:RelatesTo>urn:uuid:56b55a70-8bbc-471d-94bb-9ca060bcf99f</a:RelatesTo></s:Header><s:Body><get_inventory_on_handResponse
42
+ xmlns="SII"><get_inventory_on_handResult xmlns:b="http://schemas.datacontract.org/2004/07/"
43
+ xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><b:Inventory_values><b:UPC_Inventory_Response><b:lot>
44
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326609016</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
45
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326612425</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
46
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326614291</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
47
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326616970</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
48
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326617439</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
49
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326624327</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
50
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326625879</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
51
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326626167</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
52
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326626532</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
53
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326627332</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
54
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326630329</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
55
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326636519</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
56
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326642628</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
57
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326646312</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
58
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326652161</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
59
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326656887</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
60
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326666544</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
61
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326668704</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
62
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326669917</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
63
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326671947</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
64
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326682263</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
65
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326685907</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
66
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326691679</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
67
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326692239</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
68
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326696838</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
69
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326699950</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response></b:Inventory_values><b:status>0001</b:status></get_inventory_on_handResult></get_inventory_on_handResponse></s:Body></s:Envelope>
70
+ http_version:
71
+ recorded_at: Mon, 17 Aug 2015 21:01:59 GMT
72
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,73 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://webservice.stellae.us/SIIServices/Siiservice.svc?wsdl
6
+ body:
7
+ encoding: UTF-8
8
+ string: <?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
9
+ xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">SII/ISIIService/get_inventory_on_hand</a:Action><a:MessageID>urn:uuid:56b55a70-8bbc-471d-94bb-9ca060bcf99f</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To
10
+ s:mustUnderstand="1">https://webservice.stellae.us/SIIServices/Siiservice.svc</a:To></s:Header><s:Body><get_inventory_on_hand
11
+ xmlns="SII"><user xmlns:b="http://schemas.datacontract.org/2004/07/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><b:user_name>TESTACCOUNT</b:user_name><b:user_password>TESTPASSWORD</b:user_password></user><upcs
12
+ xmlns:b="http://schemas.datacontract.org/2004/07/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/></get_inventory_on_hand></s:Body></s:Envelope>
13
+ headers:
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - '*/*'
18
+ User-Agent:
19
+ - Ruby
20
+ Content-Type:
21
+ - application/soap+xml; charset=utf-8
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Content-Length:
28
+ - '5234'
29
+ Content-Type:
30
+ - application/soap+xml; charset=utf-8
31
+ Server:
32
+ - Microsoft-IIS/8.5
33
+ X-Powered-By:
34
+ - ASP.NET
35
+ Date:
36
+ - Mon, 17 Aug 2015 19:33:52 GMT
37
+ body:
38
+ encoding: UTF-8
39
+ string: <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action
40
+ s:mustUnderstand="1">SII/ISIIService/get_inventory_on_handResponse</a:Action><ActivityId
41
+ CorrelationId="16c31059-054f-4123-9a04-996492f30840" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">d9bede9c-86bc-43f1-aad2-5140ae15bc57</ActivityId><a:RelatesTo>urn:uuid:56b55a70-8bbc-471d-94bb-9ca060bcf99f</a:RelatesTo></s:Header><s:Body><get_inventory_on_handResponse
42
+ xmlns="SII"><get_inventory_on_handResult xmlns:b="http://schemas.datacontract.org/2004/07/"
43
+ xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><b:Inventory_values><b:UPC_Inventory_Response><b:lot>
44
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326604071</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
45
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326609016</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
46
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326612425</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
47
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326614291</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
48
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326616970</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
49
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326617439</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
50
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326624327</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
51
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326625879</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
52
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326626167</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
53
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326626532</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
54
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326627332</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
55
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326630329</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
56
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326636519</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
57
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326642628</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
58
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326646312</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
59
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326652161</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
60
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326656887</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
61
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326666544</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
62
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326668704</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
63
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326669917</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
64
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326671947</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
65
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326682263</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
66
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326685907</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
67
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326691679</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
68
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326692239</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
69
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326696838</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
70
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326699950</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response></b:Inventory_values><b:status>0001</b:status></get_inventory_on_handResult></get_inventory_on_handResponse></s:Body></s:Envelope>
71
+ http_version:
72
+ recorded_at: Mon, 17 Aug 2015 19:36:57 GMT
73
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,73 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://webservice.stellae.us/SIIServices/Siiservice.svc?wsdl
6
+ body:
7
+ encoding: UTF-8
8
+ string: <?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
9
+ xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">SII/ISIIService/get_inventory_on_hand</a:Action><a:MessageID>urn:uuid:56b55a70-8bbc-471d-94bb-9ca060bcf99f</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To
10
+ s:mustUnderstand="1">https://webservice.stellae.us/SIIServices/Siiservice.svc</a:To></s:Header><s:Body><get_inventory_on_hand
11
+ xmlns="SII"><user xmlns:b="http://schemas.datacontract.org/2004/07/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><b:user_name>TESTACCOUNT</b:user_name><b:user_password>TESTPASSWORD</b:user_password></user><upcs
12
+ xmlns:b="http://schemas.datacontract.org/2004/07/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/></get_inventory_on_hand></s:Body></s:Envelope>
13
+ headers:
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - '*/*'
18
+ User-Agent:
19
+ - Ruby
20
+ Content-Type:
21
+ - application/soap+xml; charset=utf-8
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Content-Length:
28
+ - '5234'
29
+ Content-Type:
30
+ - application/soap+xml; charset=utf-8
31
+ Server:
32
+ - Microsoft-IIS/8.5
33
+ X-Powered-By:
34
+ - ASP.NET
35
+ Date:
36
+ - Mon, 17 Aug 2015 19:33:52 GMT
37
+ body:
38
+ encoding: UTF-8
39
+ string: <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action
40
+ s:mustUnderstand="1">SII/ISIIService/get_inventory_on_handResponse</a:Action><ActivityId
41
+ CorrelationId="d7225c35-6e0b-4e13-9bb3-d9122aa5d951" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">ec66bb11-0509-43c5-812c-f535f104b32b</ActivityId><a:RelatesTo>urn:uuid:56b55a70-8bbc-471d-94bb-9ca060bcf99f</a:RelatesTo></s:Header><s:Body><get_inventory_on_handResponse
42
+ xmlns="SII"><get_inventory_on_handResult xmlns:b="http://schemas.datacontract.org/2004/07/"
43
+ xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><b:Inventory_values><b:UPC_Inventory_Response><b:lot>
44
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326604071</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
45
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326609016</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
46
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326612425</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
47
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326614291</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
48
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326616970</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
49
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326617439</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
50
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326624327</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
51
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326625879</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
52
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326626167</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
53
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326626532</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
54
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326627332</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
55
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326630329</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
56
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326636519</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
57
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326642628</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
58
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326646312</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
59
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326652161</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
60
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326656887</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
61
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326666544</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
62
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326668704</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
63
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326669917</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
64
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326671947</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
65
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326682263</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
66
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326685907</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
67
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326691679</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
68
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326692239</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
69
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326696838</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response><b:UPC_Inventory_Response><b:lot>
70
+ </b:lot><b:on_hand>1</b:on_hand><b:uom>EA</b:uom><b:upc>326699950</b:upc><b:warehouse>NYC</b:warehouse></b:UPC_Inventory_Response></b:Inventory_values><b:status>0001</b:status></get_inventory_on_handResult></get_inventory_on_handResponse></s:Body></s:Envelope>
71
+ http_version:
72
+ recorded_at: Mon, 17 Aug 2015 19:36:56 GMT
73
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,65 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://webservice.stellae.us/SIIServices/Siiservice.svc?wsdl
6
+ body:
7
+ encoding: UTF-8
8
+ string: <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action
9
+ s:mustUnderstand="1">SII/ISIIService/new_order_entry</a:Action><a:MessageID>urn:uuid:56b55a70-8bbc-471d-94bb-9ca060bcf99f</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To
10
+ s:mustUnderstand="1">https://webservice.stellae.us/SIIServices/Siiservice.svc</a:To></s:Header><s:Body><new_order_entry
11
+ xmlns="SII"><user xmlns:b="http://schemas.datacontract.org/2004/07/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><b:user_name>TESTACCOUNT</b:user_name><b:user_password>TESTPASSWORD</b:user_password></user><ohn
12
+ xmlns:b="http://schemas.datacontract.org/2004/07/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><b:CARRIER>FEDEX</b:CARRIER><b:CURRENCY>USD</b:CURRENCY><b:CUSTOMER_NAME><![CDATA[John
13
+ Smith]]></b:CUSTOMER_NAME><b:CUSTOMER_ADDRESS_1><![CDATA[123 Here Now]]></b:CUSTOMER_ADDRESS_1><b:CUSTOMER_ADDRESS_2><![CDATA[2nd
14
+ Floor]]></b:CUSTOMER_ADDRESS_2><b:CUSTOMER_ADDRESS_3><![CDATA[]]></b:CUSTOMER_ADDRESS_3><b:CUSTOMER_ADDRESS_CITY>New
15
+ York</b:CUSTOMER_ADDRESS_CITY><b:CUSTOMER_ADDRESS_COUNTRY>US</b:CUSTOMER_ADDRESS_COUNTRY><b:CUSTOMER_ADDRESS_STATE>New
16
+ York</b:CUSTOMER_ADDRESS_STATE><b:CUSTOMER_ADDRESS_ZIP>10012</b:CUSTOMER_ADDRESS_ZIP><b:CUSTOMER_TELEPHONE>123-123-1234</b:CUSTOMER_TELEPHONE><b:CUSTOMER_CODE/><b:CUSTOMER_PO
17
+ i:nil="true"/><b:DELIVERY_NAME><![CDATA[John Smith]]></b:DELIVERY_NAME><b:DELIVERY_ADDRESS_1><![CDATA[123
18
+ Here Now]]></b:DELIVERY_ADDRESS_1><b:DELIVERY_ADDRESS_2><![CDATA[2nd Floor]]></b:DELIVERY_ADDRESS_2><b:DELIVERY_ADDRESS_3><![CDATA[]]></b:DELIVERY_ADDRESS_3><b:DELIVERY_ADDRESS_CITY>New
19
+ York</b:DELIVERY_ADDRESS_CITY><b:DELIVERY_ADDRESS_COUNTRY>US</b:DELIVERY_ADDRESS_COUNTRY><b:DELIVERY_ADDRESS_STATE>New
20
+ York</b:DELIVERY_ADDRESS_STATE><b:DELIVERY_ADDRESS_ZIP>10012</b:DELIVERY_ADDRESS_ZIP><b:DELIVERY_TELEPHONE>123-123-1234</b:DELIVERY_TELEPHONE><b:DELIVERY_DC_EDI
21
+ i:nil="true"/><b:DELIVERY_DOOR_EDI i:nil="true"/><b:DELIVERY_FROM i:nil="true"/><b:DELIVERY_ID
22
+ i:nil="true"/><b:DELIVERY_MESSAGE><![CDATA[Happy Birthday!]]></b:DELIVERY_MESSAGE><b:DELIVERY_TO
23
+ i:nil="true"/><b:DISCOUNT>0</b:DISCOUNT><b:EMAIL>someone@somehwere.com</b:EMAIL><b:FREIGHT_ACCOUNT
24
+ i:nil="true"/><b:MISC1>0</b:MISC1><b:MISC1_REASON i:nil="true"/><b:MISC2>0</b:MISC2><b:MISC2_REASON
25
+ i:nil="true"/><b:ORDER_ID>R123123123</b:ORDER_ID><b:ORDER_TYPE>OO</b:ORDER_TYPE><b:Order_Details><b:Order_Detail_New><b:COST
26
+ i:nil="true"/><b:FLAGS i:nil="true"/><b:LINE_ID i:nil="true"/><b:LOT_NUMBER
27
+ i:nil="true"/><b:PRICE>127.23</b:PRICE><b:QUANTITY>1</b:QUANTITY><b:RETAIL_PRICE
28
+ i:nil="true"/><b:SEASON i:nil="true"/><b:SIZE>XS</b:SIZE><b:SKU>326604071</b:SKU></b:Order_Detail_New></b:Order_Details><b:SERVICE>90</b:SERVICE><b:SHIPPING_FEES>5</b:SHIPPING_FEES><b:TAXES>0</b:TAXES><b:TOTAL_AMOUNT>132.23</b:TOTAL_AMOUNT><b:USER1><![CDATA[http://example.com/R123123123/invoice]]></b:USER1><b:USER2
29
+ i:nil="true"/><b:USER3 i:nil="true"/><b:USER4 i:nil="true"/><b:USER5 i:nil="true"/><b:WAREHOUSE
30
+ i:nil="true"/></ohn></new_order_entry></s:Body></s:Envelope>
31
+ headers:
32
+ Accept-Encoding:
33
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
34
+ Accept:
35
+ - '*/*'
36
+ User-Agent:
37
+ - Ruby
38
+ Content-Type:
39
+ - application/soap+xml; charset=utf-8
40
+ response:
41
+ status:
42
+ code: 200
43
+ message: OK
44
+ headers:
45
+ Content-Length:
46
+ - '880'
47
+ Content-Type:
48
+ - application/soap+xml; charset=utf-8
49
+ Server:
50
+ - Microsoft-IIS/8.5
51
+ X-Powered-By:
52
+ - ASP.NET
53
+ Date:
54
+ - Mon, 17 Aug 2015 20:55:46 GMT
55
+ body:
56
+ encoding: UTF-8
57
+ string: <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action
58
+ s:mustUnderstand="1">SII/ISIIService/new_order_entryResponse</a:Action><ActivityId
59
+ CorrelationId="3dd83e7d-16b5-4041-af29-0ad9eec526a7" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">7b61e1aa-f926-47fb-bb0f-8d96bca6c2ee</ActivityId><a:RelatesTo>urn:uuid:56b55a70-8bbc-471d-94bb-9ca060bcf99f</a:RelatesTo></s:Header><s:Body><new_order_entryResponse
60
+ xmlns="SII"><new_order_entryResult xmlns:b="http://schemas.datacontract.org/2004/07/"
61
+ xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><b:detail_status i:nil="true"
62
+ xmlns:c="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/><b:sii_order_number>11736</b:sii_order_number><b:status>0001</b:status></new_order_entryResult></new_order_entryResponse></s:Body></s:Envelope>
63
+ http_version:
64
+ recorded_at: Mon, 17 Aug 2015 20:58:49 GMT
65
+ recorded_with: VCR 2.9.3
data/stellae.gemspec ADDED
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'stellae/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "stellae-ruby-api"
8
+ spec.version = Stellae::VERSION
9
+ spec.authors = ["Justin Grubbs"]
10
+ spec.email = ["justin@sellect.com"]
11
+ spec.description = %q{Ruby Library for Stellae Fulfillment API}
12
+ spec.summary = %q{This is a library for interfacing with the Stellae Fulfillment API}
13
+ spec.homepage = "http://sellect.com"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "builder"
22
+ spec.add_dependency "xml-simple"
23
+ spec.add_dependency "hashie"
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.3"
26
+ spec.add_development_dependency "rake"
27
+ spec.add_development_dependency "rspec"
28
+ spec.add_development_dependency "debugger"
29
+ spec.add_development_dependency "vcr", "~> 2.9.3"
30
+ spec.add_development_dependency "webmock", "~> 1.21.0"
31
+ end
metadata ADDED
@@ -0,0 +1,201 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stellae-ruby-api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Justin Grubbs
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: builder
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: xml-simple
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: hashie
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: debugger
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: vcr
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 2.9.3
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: 2.9.3
125
+ - !ruby/object:Gem::Dependency
126
+ name: webmock
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ~>
130
+ - !ruby/object:Gem::Version
131
+ version: 1.21.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ~>
137
+ - !ruby/object:Gem::Version
138
+ version: 1.21.0
139
+ description: Ruby Library for Stellae Fulfillment API
140
+ email:
141
+ - justin@sellect.com
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - .gitignore
147
+ - .rspec
148
+ - .travis.yml
149
+ - Gemfile
150
+ - LICENSE.txt
151
+ - README.md
152
+ - Rakefile
153
+ - lib/stellae.rb
154
+ - lib/stellae/client.rb
155
+ - lib/stellae/inventory.rb
156
+ - lib/stellae/order.rb
157
+ - lib/stellae/request.rb
158
+ - lib/stellae/response.rb
159
+ - lib/stellae/version.rb
160
+ - spec/lib/client_spec.rb
161
+ - spec/lib/order_spec.rb
162
+ - spec/spec_helper.rb
163
+ - spec/support/vcr.rb
164
+ - spec/vcr/stellae_client/inventory_methods_get_inventory_gets_inventory_and_maps_results_into_an_array_of_hashes.yml
165
+ - spec/vcr/stellae_client/inventory_methods_mapped_inventory_returns_an_array_of_quantity_hashes.yml
166
+ - spec/vcr/stellae_client/inventory_methods_upcs_returns_an_array_of_upcs.yml
167
+ - spec/vcr/stellae_client_send_order_request/sends_an_order_request_and_returns_a_parsed_respose.yml
168
+ - stellae.gemspec
169
+ homepage: http://sellect.com
170
+ licenses:
171
+ - MIT
172
+ metadata: {}
173
+ post_install_message:
174
+ rdoc_options: []
175
+ require_paths:
176
+ - lib
177
+ required_ruby_version: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ required_rubygems_version: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - '>='
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ requirements: []
188
+ rubyforge_project:
189
+ rubygems_version: 2.4.8
190
+ signing_key:
191
+ specification_version: 4
192
+ summary: This is a library for interfacing with the Stellae Fulfillment API
193
+ test_files:
194
+ - spec/lib/client_spec.rb
195
+ - spec/lib/order_spec.rb
196
+ - spec/spec_helper.rb
197
+ - spec/support/vcr.rb
198
+ - spec/vcr/stellae_client/inventory_methods_get_inventory_gets_inventory_and_maps_results_into_an_array_of_hashes.yml
199
+ - spec/vcr/stellae_client/inventory_methods_mapped_inventory_returns_an_array_of_quantity_hashes.yml
200
+ - spec/vcr/stellae_client/inventory_methods_upcs_returns_an_array_of_upcs.yml
201
+ - spec/vcr/stellae_client_send_order_request/sends_an_order_request_and_returns_a_parsed_respose.yml