spree_easypost 6.0.0.beta3 → 6.0.0.rc1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7676c0f19aeb31ec3eb142ba7ff44a8d01f129fb8e04ada73b03632ae66fa942
4
- data.tar.gz: b35ea9b62da9cbfcecb18da30ddcd96dc1172f4a6b444b0772c419ee02158865
3
+ metadata.gz: 8504147277652ef9c5e93e5d9f88f7ac05273a3ce4424379ed1d066577b36329
4
+ data.tar.gz: 670cc90e304b7b593ae5adcea1499698e21afd5fadcc35c3688ba867c1711236
5
5
  SHA512:
6
- metadata.gz: bb0105ec0e884bde4e23844c5c7c4adfeced3e3258abaf7332f6e8deb7289827e23c0f5f458d2e1c66dad8b2fbded172f0a0e140441c9f13040738c6bad5ca87
7
- data.tar.gz: 0e4d612eac742f488859905ba943713e62d350056c5eb8b71a07068fc4d59767705818f8ae5ca0a7492c31356361f6f25b3b62ac5ce538e1c4d6ed6f0ff06f17
6
+ metadata.gz: 4c0c5a31859685ad546ca47be9bb9a0d171c998070c988bdf6f4bc0fa6f17bb8f4bcdadaad0025d9a2f5454e2252770e20fe7328280119d8c1928f202e664447
7
+ data.tar.gz: 972a2606071cbf718b24aa4137dee18b4425a0cf08b2821d7e7da718faa10645176cfd252c1cde2c3254d60337f74c8e37bdbd8d4377b476063614774c43e74f
@@ -117,11 +117,16 @@ module SpreeEasyPost
117
117
 
118
118
  # One shipment-create returns rates for every carrier and service, so all
119
119
  # delivery methods sharing this provider within a request reuse it.
120
+ #
121
+ # Keyed by a digest of the exact payload sent: an order split into
122
+ # several packages from one stock location must quote each package's own
123
+ # parcel and customs contents, never the first package's cached rates.
124
+ # Anything that changes the request changes the key; identical requests
125
+ # still cost one API call.
120
126
  def easypost_shipment(package)
121
- cache_key = [:easypost_shipment, store.id, package.stock_location.id, package.owner.id]
122
- Spree::Current.provider_cache[cache_key] ||= integration.client.shipment.create(
123
- **shipment_params(package)
124
- )
127
+ params = shipment_params(package)
128
+ cache_key = [:easypost_shipment, store.id, integration.id, Digest::SHA256.hexdigest(params.to_json)]
129
+ Spree::Current.provider_cache[cache_key] ||= integration.client.shipment.create(**params)
125
130
  end
126
131
 
127
132
  # Built by the shared helper so a label bought against this quote carries
@@ -166,10 +166,10 @@ module SpreeEasyPost
166
166
 
167
167
  # Each of these is the merchant's to fix, so each says so rather than
168
168
  # failing as "check the carrier connection".
169
- raise Spree::Core::LabelPurchaseRefused, Spree.t('easypost.errors.no_destination') if address.nil?
169
+ raise Spree::Core::LabelPurchaseRefused, I18n.t('spree.easypost.errors.no_destination') if address.nil?
170
170
 
171
171
  if selected&.carrier.blank? || selected.service_level.blank?
172
- raise Spree::Core::LabelPurchaseRefused, Spree.t('easypost.errors.rate_not_quoted')
172
+ raise Spree::Core::LabelPurchaseRefused, I18n.t('spree.easypost.errors.rate_not_quoted')
173
173
  end
174
174
 
175
175
  shipment = integration.client.shipment.create(
@@ -185,7 +185,7 @@ module SpreeEasyPost
185
185
  # worse than no label, so this refuses and names the service.
186
186
  if rate.nil?
187
187
  raise Spree::Core::LabelPurchaseRefused,
188
- Spree.t('easypost.errors.service_unavailable', service: "#{selected.carrier} #{selected.service_level}")
188
+ I18n.t('spree.easypost.errors.service_unavailable', service: "#{selected.carrier} #{selected.service_level}")
189
189
  end
190
190
 
191
191
  buy(integration, fulfillment.stock_location, fulfillment.store, shipment.id, rate.id)
@@ -234,7 +234,7 @@ module SpreeEasyPost
234
234
  rescue EasyPost::Errors::EasyPostError => e
235
235
  report(e, stock_location)
236
236
  raise Spree::Core::LabelPurchaseRefused,
237
- Spree.t('easypost.errors.origin_address_refused',
237
+ I18n.t('spree.easypost.errors.origin_address_refused',
238
238
  location: location_name(stock_location), reason: carrier_reason(e))
239
239
  end
240
240
 
@@ -67,6 +67,10 @@ module SpreeEasyPost
67
67
  'https://www.easypost.com/wp-content/uploads/2026/03/EasyPost-Logo.svg'
68
68
  end
69
69
 
70
+ def self.docs_url
71
+ 'https://spreecommerce.org/docs/integrations/shipping/easypost'
72
+ end
73
+
70
74
  # Fallback for hosts without the gem's translations; the localized
71
75
  # description in config/locales wins.
72
76
  def self.description
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_easypost
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.beta3
4
+ version: 6.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vendo Connect Inc.
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-09-24 00:00:00.000000000 Z
12
+ date: 2026-10-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: easypost
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 6.0.0.beta3
34
+ version: 6.0.0.rc1
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 6.0.0.beta3
41
+ version: 6.0.0.rc1
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: vcr
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -75,9 +75,9 @@ licenses:
75
75
  - MIT
76
76
  metadata:
77
77
  bug_tracker_uri: https://github.com/spree/spree/issues
78
- changelog_uri: https://github.com/spree/spree/releases/tag/v6.0.0.beta3
78
+ changelog_uri: https://github.com/spree/spree/releases/tag/v6.0.0.rc1
79
79
  documentation_uri: https://docs.spreecommerce.org/
80
- source_code_uri: https://github.com/spree/spree/tree/v6.0.0.beta3
80
+ source_code_uri: https://github.com/spree/spree/tree/v6.0.0.rc1
81
81
  post_install_message:
82
82
  rdoc_options: []
83
83
  require_paths: