active_fulfillment 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/active_fulfillment.rb +4 -18
  3. data/lib/active_fulfillment/fulfillment/services/amazon_mws.rb +438 -0
  4. data/lib/active_fulfillment/fulfillment/services/shipwire.rb +39 -34
  5. data/lib/active_fulfillment/fulfillment/services/webgistix.rb +5 -1
  6. data/lib/active_fulfillment/fulfillment/version.rb +6 -0
  7. data/test/fixtures/xml/amazon_mws/fulfillment_get_fulfillment_order.xml +114 -0
  8. data/test/fixtures/xml/amazon_mws/fulfillment_get_fulfillment_order_2.xml +90 -0
  9. data/test/fixtures/xml/amazon_mws/fulfillment_get_fullfillment_order_with_multiple_tracking_numbers.xml +121 -0
  10. data/test/fixtures/xml/amazon_mws/fulfillment_list_all_fulfillment_orders.xml +70 -0
  11. data/test/fixtures/xml/amazon_mws/inventory_list_inventory_item_supply.xml +32 -0
  12. data/test/fixtures/xml/amazon_mws/inventory_list_inventory_supply.xml +75 -0
  13. data/test/fixtures/xml/amazon_mws/inventory_list_inventory_supply_by_next_token.xml +38 -0
  14. data/test/fixtures/xml/amazon_mws/tracking_response_error.xml +9 -0
  15. data/test/fixtures/xml/amazon_mws/tracking_response_not_found.xml +9 -0
  16. data/test/fixtures/xml/shipwire/fulfillment_failure_response.xml +7 -0
  17. data/test/fixtures/xml/shipwire/invalid_login_response.xml +7 -0
  18. data/test/fixtures/xml/shipwire/inventory_get_response.xml +44 -0
  19. data/test/fixtures/xml/shipwire/successful_empty_tracking_response.xml +8 -0
  20. data/test/fixtures/xml/shipwire/successful_live_tracking_response.xml +53 -0
  21. data/test/fixtures/xml/shipwire/successful_tracking_response.xml +16 -0
  22. data/test/fixtures/xml/shipwire/successful_tracking_response_with_tracking_urls.xml +31 -0
  23. data/test/fixtures/xml/webgistix/multiple_tracking_response.xml +21 -0
  24. data/test/remote/amazon_mws_test.rb +114 -0
  25. data/test/unit/services/amazon_mws_test.rb +357 -0
  26. data/test/unit/services/shipwire_test.rb +20 -95
  27. data/test/unit/services/webgistix_test.rb +12 -1
  28. metadata +57 -11
  29. data/Rakefile +0 -36
  30. data/VERSION +0 -1
  31. data/active_fulfillment.gemspec +0 -70
  32. data/init.rb +0 -1
@@ -109,7 +109,18 @@ class WebgistixTest < Test::Unit::TestCase
109
109
  assert_equal ['1Z8E5A380396682872'], response.tracking_numbers['AB12345']
110
110
  assert_nil response.tracking_numbers['XY4567']
111
111
  end
112
-
112
+
113
+ def test_multiple_tracking_numbers
114
+ @service.expects(:ssl_post).returns(xml_fixture('webgistix/multiple_tracking_response'))
115
+ invoice_number = '#8305090.1'
116
+
117
+ response = @service.fetch_tracking_numbers([invoice_number])
118
+
119
+ assert response.success?
120
+ assert_equal WebgistixService::SUCCESS_MESSAGE, response.message
121
+ assert_equal ['345678070437428', '546932544227'], response.tracking_numbers[invoice_number]
122
+ end
123
+
113
124
  def test_failed_login
114
125
  @service.expects(:ssl_post).returns(invalid_login_response)
115
126
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_fulfillment
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Fauser
@@ -15,14 +15,14 @@ dependencies:
15
15
  name: activesupport
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: 3.2.9
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ~>
25
+ - - '>='
26
26
  - !ruby/object:Gem::Version
27
27
  version: 3.2.9
28
28
  - !ruby/object:Gem::Dependency
@@ -101,20 +101,17 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - CHANGELOG
105
- - Rakefile
106
- - VERSION
107
- - active_fulfillment.gemspec
108
- - init.rb
109
- - lib/active_fulfillment.rb
110
104
  - lib/active_fulfillment/fulfillment/base.rb
111
105
  - lib/active_fulfillment/fulfillment/response.rb
112
106
  - lib/active_fulfillment/fulfillment/service.rb
113
- - lib/active_fulfillment/fulfillment/services.rb
114
107
  - lib/active_fulfillment/fulfillment/services/amazon.rb
108
+ - lib/active_fulfillment/fulfillment/services/amazon_mws.rb
115
109
  - lib/active_fulfillment/fulfillment/services/shipwire.rb
116
110
  - lib/active_fulfillment/fulfillment/services/webgistix.rb
117
- - test/fixtures.yml
111
+ - lib/active_fulfillment/fulfillment/services.rb
112
+ - lib/active_fulfillment/fulfillment/version.rb
113
+ - lib/active_fulfillment.rb
114
+ - CHANGELOG
118
115
  - test/fixtures/xml/amazon/inventory_get_response.xml
119
116
  - test/fixtures/xml/amazon/inventory_list_response.xml
120
117
  - test/fixtures/xml/amazon/inventory_list_response_with_next_1.xml
@@ -123,12 +120,32 @@ files:
123
120
  - test/fixtures/xml/amazon/tracking_response_2.xml
124
121
  - test/fixtures/xml/amazon/tracking_response_error.xml
125
122
  - test/fixtures/xml/amazon/tracking_response_not_found.xml
123
+ - test/fixtures/xml/amazon_mws/fulfillment_get_fulfillment_order.xml
124
+ - test/fixtures/xml/amazon_mws/fulfillment_get_fulfillment_order_2.xml
125
+ - test/fixtures/xml/amazon_mws/fulfillment_get_fullfillment_order_with_multiple_tracking_numbers.xml
126
+ - test/fixtures/xml/amazon_mws/fulfillment_list_all_fulfillment_orders.xml
127
+ - test/fixtures/xml/amazon_mws/inventory_list_inventory_item_supply.xml
128
+ - test/fixtures/xml/amazon_mws/inventory_list_inventory_supply.xml
129
+ - test/fixtures/xml/amazon_mws/inventory_list_inventory_supply_by_next_token.xml
130
+ - test/fixtures/xml/amazon_mws/tracking_response_error.xml
131
+ - test/fixtures/xml/amazon_mws/tracking_response_not_found.xml
132
+ - test/fixtures/xml/shipwire/fulfillment_failure_response.xml
133
+ - test/fixtures/xml/shipwire/invalid_login_response.xml
134
+ - test/fixtures/xml/shipwire/inventory_get_response.xml
135
+ - test/fixtures/xml/shipwire/successful_empty_tracking_response.xml
136
+ - test/fixtures/xml/shipwire/successful_live_tracking_response.xml
137
+ - test/fixtures/xml/shipwire/successful_tracking_response.xml
138
+ - test/fixtures/xml/shipwire/successful_tracking_response_with_tracking_urls.xml
139
+ - test/fixtures/xml/webgistix/multiple_tracking_response.xml
126
140
  - test/fixtures/xml/webgistix/tracking_response.xml
141
+ - test/fixtures.yml
142
+ - test/remote/amazon_mws_test.rb
127
143
  - test/remote/amazon_test.rb
128
144
  - test/remote/shipwire_test.rb
129
145
  - test/remote/webgistix_test.rb
130
146
  - test/test_helper.rb
131
147
  - test/unit/base_test.rb
148
+ - test/unit/services/amazon_mws_test.rb
132
149
  - test/unit/services/amazon_test.rb
133
150
  - test/unit/services/shipwire_test.rb
134
151
  - test/unit/services/webgistix_test.rb
@@ -157,11 +174,40 @@ specification_version: 4
157
174
  summary: Framework and tools for dealing with shipping, tracking and order fulfillment
158
175
  services.
159
176
  test_files:
177
+ - test/fixtures/xml/amazon/inventory_get_response.xml
178
+ - test/fixtures/xml/amazon/inventory_list_response.xml
179
+ - test/fixtures/xml/amazon/inventory_list_response_with_next_1.xml
180
+ - test/fixtures/xml/amazon/inventory_list_response_with_next_2.xml
181
+ - test/fixtures/xml/amazon/tracking_response_1.xml
182
+ - test/fixtures/xml/amazon/tracking_response_2.xml
183
+ - test/fixtures/xml/amazon/tracking_response_error.xml
184
+ - test/fixtures/xml/amazon/tracking_response_not_found.xml
185
+ - test/fixtures/xml/amazon_mws/fulfillment_get_fulfillment_order.xml
186
+ - test/fixtures/xml/amazon_mws/fulfillment_get_fulfillment_order_2.xml
187
+ - test/fixtures/xml/amazon_mws/fulfillment_get_fullfillment_order_with_multiple_tracking_numbers.xml
188
+ - test/fixtures/xml/amazon_mws/fulfillment_list_all_fulfillment_orders.xml
189
+ - test/fixtures/xml/amazon_mws/inventory_list_inventory_item_supply.xml
190
+ - test/fixtures/xml/amazon_mws/inventory_list_inventory_supply.xml
191
+ - test/fixtures/xml/amazon_mws/inventory_list_inventory_supply_by_next_token.xml
192
+ - test/fixtures/xml/amazon_mws/tracking_response_error.xml
193
+ - test/fixtures/xml/amazon_mws/tracking_response_not_found.xml
194
+ - test/fixtures/xml/shipwire/fulfillment_failure_response.xml
195
+ - test/fixtures/xml/shipwire/invalid_login_response.xml
196
+ - test/fixtures/xml/shipwire/inventory_get_response.xml
197
+ - test/fixtures/xml/shipwire/successful_empty_tracking_response.xml
198
+ - test/fixtures/xml/shipwire/successful_live_tracking_response.xml
199
+ - test/fixtures/xml/shipwire/successful_tracking_response.xml
200
+ - test/fixtures/xml/shipwire/successful_tracking_response_with_tracking_urls.xml
201
+ - test/fixtures/xml/webgistix/multiple_tracking_response.xml
202
+ - test/fixtures/xml/webgistix/tracking_response.xml
203
+ - test/fixtures.yml
204
+ - test/remote/amazon_mws_test.rb
160
205
  - test/remote/amazon_test.rb
161
206
  - test/remote/shipwire_test.rb
162
207
  - test/remote/webgistix_test.rb
163
208
  - test/test_helper.rb
164
209
  - test/unit/base_test.rb
210
+ - test/unit/services/amazon_mws_test.rb
165
211
  - test/unit/services/amazon_test.rb
166
212
  - test/unit/services/shipwire_test.rb
167
213
  - test/unit/services/webgistix_test.rb
data/Rakefile DELETED
@@ -1,36 +0,0 @@
1
- require 'bundler'
2
- Bundler::GemHelper.install_tasks
3
-
4
- require 'rake'
5
- require 'rake/testtask'
6
- require 'rdoc/task'
7
-
8
- desc "Default Task"
9
- task :default => 'test:units'
10
-
11
- # Run the unit tests
12
-
13
- namespace :test do
14
- Rake::TestTask.new(:units) do |t|
15
- t.pattern = 'test/unit/**/*_test.rb'
16
- t.ruby_opts << '-rubygems'
17
- t.libs << 'test'
18
- t.verbose = true
19
- end
20
-
21
- Rake::TestTask.new(:remote) do |t|
22
- t.pattern = 'test/remote/*_test.rb'
23
- t.ruby_opts << '-rubygems'
24
- t.libs << 'test'
25
- t.verbose = true
26
- end
27
- end
28
-
29
- # Genereate the RDoc documentation
30
- Rake::RDocTask.new do |rdoc|
31
- rdoc.rdoc_dir = 'doc'
32
- rdoc.title = "ActiveFulfillment library"
33
- rdoc.options << '--line-numbers' << '--inline-source'
34
- rdoc.rdoc_files.include('README', 'CHANGELOG')
35
- rdoc.rdoc_files.include('lib/**/*.rb')
36
- end
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 2.0.1
@@ -1,70 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{active_fulfillment}
8
- s.version = "2.0.1"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Cody Fauser", "James MacAulay"]
12
- s.date = %q{2010-12-13}
13
- s.email = %q{cody@shopify.com}
14
- s.files = [
15
- "CHANGELOG",
16
- "Rakefile",
17
- "VERSION",
18
- "active_fulfillment.gemspec",
19
- "init.rb",
20
- "lib/active_fulfillment.rb",
21
- "lib/active_fulfillment/fulfillment/base.rb",
22
- "lib/active_fulfillment/fulfillment/response.rb",
23
- "lib/active_fulfillment/fulfillment/service.rb",
24
- "lib/active_fulfillment/fulfillment/services.rb",
25
- "lib/active_fulfillment/fulfillment/services/amazon.rb",
26
- "lib/active_fulfillment/fulfillment/services/shipwire.rb",
27
- "lib/active_fulfillment/fulfillment/services/webgistix.rb",
28
- "test/fixtures.yml",
29
- "test/fixtures/xml/amazon/inventory_get_response.xml",
30
- "test/fixtures/xml/amazon/inventory_list_response.xml",
31
- "test/fixtures/xml/amazon/inventory_list_response_with_next_1.xml",
32
- "test/fixtures/xml/amazon/inventory_list_response_with_next_2.xml",
33
- "test/fixtures/xml/amazon/tracking_response_1.xml",
34
- "test/fixtures/xml/amazon/tracking_response_2.xml",
35
- "test/fixtures/xml/amazon/tracking_response_error.xml",
36
- "test/fixtures/xml/amazon/tracking_response_not_found.xml",
37
- "test/fixtures/xml/webgistix/tracking_response.xml",
38
- "test/remote/amazon_test.rb",
39
- "test/remote/shipwire_test.rb",
40
- "test/remote/webgistix_test.rb",
41
- "test/test_helper.rb",
42
- "test/unit/base_test.rb",
43
- "test/unit/services/amazon_test.rb",
44
- "test/unit/services/shipwire_test.rb",
45
- "test/unit/services/webgistix_test.rb"
46
- ]
47
- s.homepage = %q{http://github.com/shopify/active_fulfillment}
48
- s.require_paths = ["lib"]
49
- s.rubygems_version = %q{1.3.7}
50
- s.summary = %q{Framework and tools for dealing with shipping, tracking and order fulfillment services.}
51
- s.test_files = [
52
- "test/remote/amazon_test.rb",
53
- "test/remote/shipwire_test.rb",
54
- "test/remote/webgistix_test.rb",
55
- "test/test_helper.rb",
56
- "test/unit/base_test.rb",
57
- "test/unit/services/amazon_test.rb",
58
- "test/unit/services/shipwire_test.rb",
59
- "test/unit/services/webgistix_test.rb"
60
- ]
61
-
62
- s.add_dependency('activesupport', '~> 3.2.9')
63
- s.add_dependency('builder', '>= 2.0.0')
64
- s.add_dependency('active_utils', '>= 1.0.1')
65
-
66
- s.add_development_dependency('rake')
67
- s.add_development_dependency('mocha')
68
- s.add_development_dependency('rdoc', '>= 2.4.2')
69
- end
70
-
data/init.rb DELETED
@@ -1 +0,0 @@
1
- require 'active_fulfillment'