active_shipping 1.14.0 → 1.14.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/active_shipping/carriers/canada_post_pws.rb +8 -8
- data/lib/active_shipping/version.rb +1 -1
- data/test/fixtures/xml/canadapost_pws/service_options_response_priority_worldwide.xml +41 -0
- data/test/unit/carriers/canada_post_pws_rating_test.rb +14 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b52cb7b75be25e1f18dd9fcb5cc212c2c590f79d
|
4
|
+
data.tar.gz: 493af87b593907f1ab99e5e1b9437d897ec128d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0a112df52dce5215b518506f3244b5bdb767d04581eb976ea3a8f97ec13bba9c8ab2f18e21405cb2929cd4e0c820925386e841dce84aaa6023288f145c939e7
|
7
|
+
data.tar.gz: c28eac1c26d272baf2116144b92e2b18d2fa15ae8090ef79fa8439a9b5a01a50c7ab87780e040445428750c7d53a2085ca0126f95f1aad557d3ceb4b1abe7f6d
|
data/CHANGELOG.md
CHANGED
@@ -214,14 +214,14 @@ module ActiveShipping
|
|
214
214
|
restrictions_node = doc.root.at('restrictions')
|
215
215
|
dimensions_node = restrictions_node.at('dimensional-restrictions')
|
216
216
|
restrictions = {
|
217
|
-
:min_weight => restrictions_node.at("weight-restriction").attributes['min'].value.to_i,
|
218
|
-
:max_weight => restrictions_node.at("weight-restriction").attributes['max'].value.to_i,
|
219
|
-
:min_length => dimensions_node.at("length").attributes['min'].value.to_f,
|
220
|
-
:max_length => dimensions_node.at("length").attributes['max'].value.to_f,
|
221
|
-
:min_height => dimensions_node.at("height").attributes['min'].value.to_f,
|
222
|
-
:max_height => dimensions_node.at("height").attributes['max'].value.to_f,
|
223
|
-
:min_width => dimensions_node.at("width").attributes['min'].value.to_f,
|
224
|
-
:max_width => dimensions_node.at("width").attributes['max'].value.to_f
|
217
|
+
:min_weight => restrictions_node.at("weight-restriction").attributes['min'].try(:value).to_i,
|
218
|
+
:max_weight => restrictions_node.at("weight-restriction").attributes['max'].try(:value).to_i,
|
219
|
+
:min_length => dimensions_node.at("length").attributes['min'].try(:value).to_f,
|
220
|
+
:max_length => dimensions_node.at("length").attributes['max'].try(:value).to_f,
|
221
|
+
:min_height => dimensions_node.at("height").attributes['min'].try(:value).to_f,
|
222
|
+
:max_height => dimensions_node.at("height").attributes['max'].try(:value).to_f,
|
223
|
+
:min_width => dimensions_node.at("width").attributes['min'].try(:value).to_f,
|
224
|
+
:max_width => dimensions_node.at("width").attributes['max'].try(:value).to_f
|
225
225
|
}
|
226
226
|
|
227
227
|
{
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<service>
|
3
|
+
<service-code>USA.PW.ENV</service-code>
|
4
|
+
<service-name>Priority Worldwide envelope USA</service-name>
|
5
|
+
<options>
|
6
|
+
<option>
|
7
|
+
<option-code>SO</option-code>
|
8
|
+
<option-name>Signature option</option-name>
|
9
|
+
<link rel="option" href="https://soa-gw.canadapost.ca/rs/ship/option/SO" media-type="application/vnd.cpc.ship.rate+xml"/>
|
10
|
+
<mandatory>true</mandatory>
|
11
|
+
<qualifier-required>false</qualifier-required>
|
12
|
+
</option>
|
13
|
+
<option>
|
14
|
+
<option-code>COV</option-code>
|
15
|
+
<option-name>Coverage</option-name>
|
16
|
+
<link rel="option" href="https://soa-gw.canadapost.ca/rs/ship/option/COV" media-type="application/vnd.cpc.ship.rate+xml"/>
|
17
|
+
<mandatory>false</mandatory>
|
18
|
+
<qualifier-required>true</qualifier-required>
|
19
|
+
<qualifier-max>100</qualifier-max>
|
20
|
+
</option>
|
21
|
+
<option>
|
22
|
+
<option-code>DC</option-code>
|
23
|
+
<option-name>Delivery confirmation</option-name>
|
24
|
+
<link rel="option" href="https://soa-gw.canadapost.ca/rs/ship/option/DC" media-type="application/vnd.cpc.ship.rate+xml"/>
|
25
|
+
<mandatory>true</mandatory>
|
26
|
+
<qualifier-required>false</qualifier-required>
|
27
|
+
</option>
|
28
|
+
</options>
|
29
|
+
<restrictions>
|
30
|
+
<weight-restriction/>
|
31
|
+
<dimensional-restrictions>
|
32
|
+
<length />
|
33
|
+
<width />
|
34
|
+
<height />
|
35
|
+
<length-plus-girth-max>300</length-plus-girth-max>
|
36
|
+
</dimensional-restrictions>
|
37
|
+
<can-ship-in-mailing-tube>false</can-ship-in-mailing-tube>
|
38
|
+
<can-ship-unpackaged>false</can-ship-unpackaged>
|
39
|
+
<allowed-as-return-service>false</allowed-as-return-service>
|
40
|
+
</restrictions>
|
41
|
+
</service>
|
@@ -343,6 +343,20 @@ class CanadaPostPwsRatingTest < Minitest::Test
|
|
343
343
|
assert_equal 150, response[:restrictions][:max_width]
|
344
344
|
end
|
345
345
|
|
346
|
+
def test_parse_find_service_options_response
|
347
|
+
body = xml_fixture('canadapost_pws/service_options_response_priority_worldwide')
|
348
|
+
response = @cp.parse_service_options_response(body)
|
349
|
+
assert_equal 3, response[:options].size
|
350
|
+
assert_equal 0, response[:restrictions][:min_weight]
|
351
|
+
assert_equal 0, response[:restrictions][:max_weight]
|
352
|
+
assert_equal 0, response[:restrictions][:min_length]
|
353
|
+
assert_equal 0, response[:restrictions][:min_height]
|
354
|
+
assert_equal 0, response[:restrictions][:min_width]
|
355
|
+
assert_equal 0, response[:restrictions][:max_length]
|
356
|
+
assert_equal 0, response[:restrictions][:max_height]
|
357
|
+
assert_equal 0, response[:restrictions][:max_width]
|
358
|
+
end
|
359
|
+
|
346
360
|
def test_parse_find_option_response
|
347
361
|
body = xml_fixture('canadapost_pws/option_response')
|
348
362
|
response = @cp.parse_option_response(body)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_shipping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: quantified
|
@@ -266,6 +266,7 @@ files:
|
|
266
266
|
- test/fixtures/xml/canadapost_pws/register_token_error.xml
|
267
267
|
- test/fixtures/xml/canadapost_pws/register_token_response.xml
|
268
268
|
- test/fixtures/xml/canadapost_pws/service_options_response.xml
|
269
|
+
- test/fixtures/xml/canadapost_pws/service_options_response_priority_worldwide.xml
|
269
270
|
- test/fixtures/xml/canadapost_pws/services_error.xml
|
270
271
|
- test/fixtures/xml/canadapost_pws/services_response.xml
|
271
272
|
- test/fixtures/xml/canadapost_pws/shipment_domestic.xml
|
@@ -502,6 +503,7 @@ test_files:
|
|
502
503
|
- test/fixtures/xml/canadapost_pws/register_token_error.xml
|
503
504
|
- test/fixtures/xml/canadapost_pws/register_token_response.xml
|
504
505
|
- test/fixtures/xml/canadapost_pws/service_options_response.xml
|
506
|
+
- test/fixtures/xml/canadapost_pws/service_options_response_priority_worldwide.xml
|
505
507
|
- test/fixtures/xml/canadapost_pws/services_error.xml
|
506
508
|
- test/fixtures/xml/canadapost_pws/services_response.xml
|
507
509
|
- test/fixtures/xml/canadapost_pws/shipment_domestic.xml
|