friendly_shipping 0.7.1 → 0.7.3
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 +6 -0
- data/lib/friendly_shipping/services/ship_engine/label_options.rb +7 -3
- data/lib/friendly_shipping/services/ship_engine/serialize_label_shipment.rb +4 -0
- data/lib/friendly_shipping/services/ups/label.rb +20 -0
- data/lib/friendly_shipping/services/ups/parse_shipment_accept_response.rb +2 -1
- data/lib/friendly_shipping/services/ups.rb +1 -0
- data/lib/friendly_shipping/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c32d3c28aea8a8cc0367288ea92fd4c1f29c5e18eb680a82f273e3f4319d14e
|
4
|
+
data.tar.gz: 6618acc12ea1a92156dbfd2864a812d4c44cebd2b4f4c05b13d3d19d20d6fc62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef98ea7a648d25aba9d2d2df3d4d624a5c6413f1008d6bd9e2aff3520779aee02c24163242152698cdacf91a9c9b75a1686f950a53b1eb1aa406f6882c2864fe
|
7
|
+
data.tar.gz: 6e6d8669b5fa64c18cbf89a215e642042f1bcc31f35900a9836782bd80ca307e6bdeafdf36b8a946e0d3da3068338b1db69133827af0ec59cd2f538cb1c74492
|
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.7.3] - 2023-01-24
|
8
|
+
- UPS Service: Record USPS tracking code (#153)
|
9
|
+
|
10
|
+
## [0.7.2] - 2023-01-24
|
11
|
+
- ShipEngine Service: Allow sending a label image ID when creating labels (#152)
|
12
|
+
|
7
13
|
## [0.7.1] - 2023-01-20
|
8
14
|
- ShipEngine Service: Include package dimensions even if package code given
|
9
15
|
|
@@ -10,22 +10,26 @@ module FriendlyShipping
|
|
10
10
|
# @attribute label_format [Symbol] The format for the label. Possible Values: :png, :zpl and :pdf. Default :pdf
|
11
11
|
# @attribute label_download_type [Symbol] Whether to download directly (`:inline`) or
|
12
12
|
# obtain a URL to the label (`:url`). Default :url
|
13
|
+
# @attribute label_image_id [String] Identifier for image uploaded to ShipEngine. Default: nil
|
13
14
|
# @attribute package_options [Enumberable<LabelPackageOptions>] Package options for the packages in the shipment
|
14
15
|
#
|
15
16
|
class LabelOptions < FriendlyShipping::ShipmentOptions
|
16
17
|
attr_reader :shipping_method,
|
18
|
+
:label_download_type,
|
17
19
|
:label_format,
|
18
|
-
:
|
20
|
+
:label_image_id
|
19
21
|
|
20
22
|
def initialize(
|
21
23
|
shipping_method:,
|
22
|
-
label_format: :pdf,
|
23
24
|
label_download_type: :url,
|
25
|
+
label_format: :pdf,
|
26
|
+
label_image_id: nil,
|
24
27
|
**kwargs
|
25
28
|
)
|
26
29
|
@shipping_method = shipping_method
|
27
|
-
@label_format = label_format
|
28
30
|
@label_download_type = label_download_type
|
31
|
+
@label_format = label_format
|
32
|
+
@label_image_id = label_image_id
|
29
33
|
super(**kwargs.merge(package_options_class: LabelPackageOptions))
|
30
34
|
end
|
31
35
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FriendlyShipping
|
4
|
+
module Services
|
5
|
+
class Ups
|
6
|
+
class Label < FriendlyShipping::Label
|
7
|
+
attr_reader :usps_tracking_number
|
8
|
+
|
9
|
+
# @param [String] usps_tracking_number The label's usps tracking number. Limited to SUREPOST
|
10
|
+
def initialize(
|
11
|
+
usps_tracking_number: nil,
|
12
|
+
**params
|
13
|
+
)
|
14
|
+
@usps_tracking_number = usps_tracking_number
|
15
|
+
super(**params)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -36,8 +36,9 @@ module FriendlyShipping
|
|
36
36
|
cost_breakdown = build_cost_breakdown(package)
|
37
37
|
package_cost = cost_breakdown.values.any? ? cost_breakdown.values.sum : nil
|
38
38
|
encoded_label_data = package.at('LabelImage/GraphicImage')&.text
|
39
|
-
FriendlyShipping::Label.new(
|
39
|
+
FriendlyShipping::Services::Ups::Label.new(
|
40
40
|
tracking_number: package.at('TrackingNumber').text,
|
41
|
+
usps_tracking_number: package.at('USPSPICNumber')&.text,
|
41
42
|
label_data: encoded_label_data ? Base64.decode64(encoded_label_data) : nil,
|
42
43
|
label_format: package.at('LabelImage/LabelImageFormat/Code')&.text,
|
43
44
|
cost: package_cost,
|
@@ -19,6 +19,7 @@ require 'friendly_shipping/services/ups/parse_shipment_accept_response'
|
|
19
19
|
require 'friendly_shipping/services/ups/parse_time_in_transit_response'
|
20
20
|
require 'friendly_shipping/services/ups/parse_void_shipment_response'
|
21
21
|
require 'friendly_shipping/services/ups/shipping_methods'
|
22
|
+
require 'friendly_shipping/services/ups/label'
|
22
23
|
require 'friendly_shipping/services/ups/label_options'
|
23
24
|
require 'friendly_shipping/services/ups/rate_estimate_options'
|
24
25
|
require 'friendly_shipping/services/ups/timing_options'
|
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.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Meyerhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-monads
|
@@ -296,6 +296,7 @@ files:
|
|
296
296
|
- lib/friendly_shipping/services/ship_engine/serialize_label_shipment.rb
|
297
297
|
- lib/friendly_shipping/services/ship_engine/serialize_rate_estimate_request.rb
|
298
298
|
- lib/friendly_shipping/services/ups.rb
|
299
|
+
- lib/friendly_shipping/services/ups/label.rb
|
299
300
|
- lib/friendly_shipping/services/ups/label_billing_options.rb
|
300
301
|
- lib/friendly_shipping/services/ups/label_item_options.rb
|
301
302
|
- lib/friendly_shipping/services/ups/label_options.rb
|