friendly_shipping 0.7.1 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 748717bbd3258962363ac3c25a9159cbcf384c91d8f5a356a1c405441bec7bac
4
- data.tar.gz: cf66d120169edd0bdc1608a27c0a015da599ca7800e813245cb1af9b2ce7992d
3
+ metadata.gz: 4c32d3c28aea8a8cc0367288ea92fd4c1f29c5e18eb680a82f273e3f4319d14e
4
+ data.tar.gz: 6618acc12ea1a92156dbfd2864a812d4c44cebd2b4f4c05b13d3d19d20d6fc62
5
5
  SHA512:
6
- metadata.gz: f5b2fe10990482d30af429f31bbb48acfafa3dec81adf728a18a29d3de20bafaf329d00c73bb8899ab21469b7068a67bdb848067980d4deee559cdd1cbe511bb
7
- data.tar.gz: 483efd68ebd20f3554baa8a239d1372a3fea8805cbcd203e84f7ec2401fd135627c452c2002147b474635806748dffd926ead4f40030ce583fb8a01c6d60ef3a
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
- :label_download_type
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
@@ -25,6 +25,10 @@ module FriendlyShipping
25
25
  shipment_hash[:test_label] = true
26
26
  end
27
27
 
28
+ if options.label_image_id
29
+ shipment_hash[:label_image_id] = options.label_image_id
30
+ end
31
+
28
32
  shipment_hash
29
33
  end
30
34
 
@@ -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'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FriendlyShipping
4
- VERSION = "0.7.1"
4
+ VERSION = "0.7.3"
5
5
  end
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.1
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-20 00:00:00.000000000 Z
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