friendly_shipping 0.4.10 → 0.4.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/friendly_shipping/services/usps/choose_package_rate.rb +2 -7
- data/lib/friendly_shipping/services/usps/parse_rate_response.rb +1 -1
- data/lib/friendly_shipping/services/usps/serialize_rate_request.rb +2 -2
- data/lib/friendly_shipping/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad0bd0ca10d1e4d781445eae63c71f67361da4f1dc7d8f1fe86c5372371ede0a
|
4
|
+
data.tar.gz: 3a327d0fc73633dc59c7e669db85d649d3d8daa8ae2a08d15ebde792d1a19679
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6db80ebea75835a2d100b46250e18e43231051e895c57ca6dc71bf63a16e6d3ca06396dba9b865b62cb6580e1bad54ed64b9e2785c23df5edbb18c5e37f5d2d4
|
7
|
+
data.tar.gz: d3d1d930b11db4dc22e052ed7ce49b5a9be371a0d384cfdb38830383660de60532db044e252a9e2219203cab4fb1759f62391d6296de7fbc8a03d184ecd9d31b
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.4.11] - 2020-01-14
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
- USPS Service: Identify packages within a shipment by index rather than by ID (#72)
|
11
|
+
- USPS Service: Do not raise if multiple rates for a package and shipping method are present (#72)
|
12
|
+
|
7
13
|
## [0.4.10] - 2020-01-10
|
8
14
|
|
9
15
|
### Changed
|
@@ -31,13 +31,8 @@ module FriendlyShipping
|
|
31
31
|
r.data[:hold_for_pickup] == !!package.properties[:hold_for_pickup]
|
32
32
|
end
|
33
33
|
|
34
|
-
# At this point we
|
35
|
-
#
|
36
|
-
if rates_with_this_hold_for_pickup_option.length > 1
|
37
|
-
raise CannotDetermineRate
|
38
|
-
end
|
39
|
-
|
40
|
-
# As we only have one rate left, return that without the array.
|
34
|
+
# At this point, we have one or two rates left, and they're similar enough.
|
35
|
+
# Once this poses an actual problem, we'll fix it.
|
41
36
|
rates_with_this_hold_for_pickup_option.first
|
42
37
|
end
|
43
38
|
end
|
@@ -65,7 +65,7 @@ module FriendlyShipping
|
|
65
65
|
def rates_from_response_node(xml, shipment)
|
66
66
|
xml.xpath(PACKAGE_NODE_XPATH).each_with_object({}) do |package_node, result|
|
67
67
|
package_id = package_node['ID']
|
68
|
-
corresponding_package = shipment.packages.
|
68
|
+
corresponding_package = shipment.packages[package_id.to_i]
|
69
69
|
|
70
70
|
# There should always be a package in the original shipment that corresponds to the package ID
|
71
71
|
# in the USPS response.
|
@@ -19,8 +19,8 @@ module FriendlyShipping
|
|
19
19
|
def call(shipment:, login:, shipping_method: nil)
|
20
20
|
xml_builder = Nokogiri::XML::Builder.new do |xml|
|
21
21
|
xml.RateV4Request('USERID' => login) do
|
22
|
-
shipment.packages.
|
23
|
-
xml.Package('ID' =>
|
22
|
+
shipment.packages.each_with_index do |package, index|
|
23
|
+
xml.Package('ID' => index) do
|
24
24
|
xml.Service(service_code_by(shipping_method, package))
|
25
25
|
if package.properties[:first_class_mail_type]
|
26
26
|
xml.FirstClassMailType(FIRST_CLASS_MAIL_TYPES[package.properties[:first_class_mail_type]])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: friendly_shipping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Meyerhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: data_uri
|