active_shipping 1.12.0 → 1.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0c2626c0d7b81afecb26e4f8ca1ff08c260565c
4
- data.tar.gz: 3f1884f2a1aeb865d4ea8d1624567e173e9ee135
3
+ metadata.gz: 0f4f1610144f6b41f51175256c47cc12601216ef
4
+ data.tar.gz: ce74fa151c3ae1483368330c88970a0631d82cf3
5
5
  SHA512:
6
- metadata.gz: 608079bfbaa0a14a8f58317e526bd902c878724b3cfaad4bd8fdc5fba712f5b6467c7ea1fce8896cd4d4e7b043fb7717a8d429ee41a439dbc2249dc589418746
7
- data.tar.gz: 85f2435abf36e3b75d473ffd880bbcc545356cc7e1c1e1f9f8ff50fb7b71a99822d00d8237810999d6b088f7fe7dba6e4b73a31ba37ff26a55808e2c0f5ac0c1
6
+ metadata.gz: f11e65c4c3fc7efc64ca6d3715f8ec83ae978c44c617b39855c7f5ba3793ba24ba1fd8ba5631d44ead849e289b18bbeceb47694f82d3c1a19ca0353f28276180
7
+ data.tar.gz: f8f765528c38f1a08e8e72d59bb562452148dc471b2904ebd08798e8bb3e8812378610155e6b09bc52a3daa37c4c219ee25cdb64fb4d9b154de3c0d7bfe74514
@@ -1,5 +1,9 @@
1
1
  # ActiveShipping CHANGELOG
2
2
 
3
+ ### v1.12.1
4
+ - Explicitly set ssl_version for USPS
5
+ - Strip 9 digit origin zip code for USPS world rate requests
6
+
3
7
  ### v1.12.0
4
8
  - Update active_utils dependency to v3.3.0
5
9
 
@@ -13,6 +13,7 @@ module ActiveShipping
13
13
  EventDetails = Struct.new(:description, :time, :zoneless_time, :location, :event_code)
14
14
  ONLY_PREFIX_EVENTS = ['DELIVERED','OUT FOR DELIVERY']
15
15
  self.retry_safe = true
16
+ self.ssl_version = :TLSv1_2
16
17
 
17
18
  cattr_reader :name
18
19
  @@name = "USPS"
@@ -421,7 +422,7 @@ module ActiveShipping
421
422
  xml.Length("%0.2f" % [package.inches(:length), 0.01].max)
422
423
  xml.Height("%0.2f" % [package.inches(:height), 0.01].max)
423
424
  xml.Girth("%0.2f" % [package.inches(:girth), 0.01].max)
424
- xml.OriginZip(origin.zip)
425
+ xml.OriginZip(strip_zip(origin.zip))
425
426
  if commercial_type = commercial_type(options)
426
427
  xml.public_send(COMMERCIAL_FLAG_NAME.fetch(commercial_type), 'Y')
427
428
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveShipping
2
- VERSION = "1.12.0"
2
+ VERSION = "1.12.1"
3
3
  end
@@ -134,6 +134,15 @@ module ActiveShipping::Test
134
134
  :zip => '90210',
135
135
  :phone => '1-310-285-1013',
136
136
  :fax => '1-310-275-8159'),
137
+ :beverly_hills_9_zip => Location.new(
138
+ :country => 'US',
139
+ :state => 'CA',
140
+ :city => 'Beverly Hills',
141
+ :address1 => '455 N. Rexford Dr.',
142
+ :address2 => '3rd Floor',
143
+ :zip => '90210-1234',
144
+ :phone => '1-310-285-1013',
145
+ :fax => '1-310-275-8159'),
137
146
  :real_home_as_commercial => Location.new(
138
147
  :country => 'US',
139
148
  :city => 'Tampa',
@@ -15,6 +15,11 @@ class USPSTest < Minitest::Test
15
15
  ]
16
16
  end
17
17
 
18
+ def test_using_tls_and_not_ssl_v3
19
+ refute_equal :SSLv3, @carrier.ssl_version, 'SSLv3 is no longer supported by USPS Web Tools'
20
+ assert_equal :TLSv1_2, @carrier.ssl_version
21
+ end
22
+
18
23
  def test_tracking_request_should_create_correct_xml
19
24
  @carrier.expects(:commit).with(:track, xml_fixture('usps/tracking_request'),false).returns(@tracking_response)
20
25
  @carrier.find_tracking_info('9102901000462189604217', :destination_zip => '12345', :mailing_date => Date.new(2010,1,30))
@@ -386,6 +391,13 @@ class USPSTest < Minitest::Test
386
391
  assert request =~ /\>12345\</
387
392
  end
388
393
 
394
+ def test_strip_9_digit_zip_codes_world_rates
395
+ request = URI.decode(@carrier.send(:build_world_rate_request, location_fixtures[:beverly_hills_9_zip],
396
+ package_fixtures[:book], location_fixtures[:auckland], {}))
397
+ refute_match /\<OriginZip\>90210-1234/, request
398
+ assert_match /\<OriginZip\>90210/, request
399
+ end
400
+
389
401
  def test_maximum_weight
390
402
  assert Package.new(70 * 16, [5, 5, 5], :units => :imperial).mass == @carrier.maximum_weight
391
403
  assert Package.new((70 * 16) + 0.01, [5, 5, 5], :units => :imperial).mass > @carrier.maximum_weight
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.12.0
4
+ version: 1.12.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-03-10 00:00:00.000000000 Z
11
+ date: 2017-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: quantified