active_shipping 1.14.1 → 1.14.2

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: b52cb7b75be25e1f18dd9fcb5cc212c2c590f79d
4
- data.tar.gz: 493af87b593907f1ab99e5e1b9437d897ec128d0
3
+ metadata.gz: 1cdf320ee4f62ffc781b724b4a1062cca673d55b
4
+ data.tar.gz: 751db33e450bb92c8b9b8b38911716450e51f364
5
5
  SHA512:
6
- metadata.gz: c0a112df52dce5215b518506f3244b5bdb767d04581eb976ea3a8f97ec13bba9c8ab2f18e21405cb2929cd4e0c820925386e841dce84aaa6023288f145c939e7
7
- data.tar.gz: c28eac1c26d272baf2116144b92e2b18d2fa15ae8090ef79fa8439a9b5a01a50c7ab87780e040445428750c7d53a2085ca0126f95f1aad557d3ceb4b1abe7f6d
6
+ metadata.gz: 2cb07bbdefd76c3ae7a05f523d42d4f79de0daecfa2688ee708c79dc369e81fb475f153c777e29cd896018bf686afa6f9cc93a9f153c1d2903695e79053e4d2f
7
+ data.tar.gz: 04e6be9e02c295e14b725dfbe0c193d400445e2b487ba7193899053e2c81c8d9dfbf544cd699afaac03ca0d4bb221b65b2f023edfdd507ed988ff06ef5766105
@@ -1,5 +1,8 @@
1
1
  # ActiveShipping CHANGELOG
2
2
 
3
+ ### v1.14.2
4
+ - Make saturday delivery an option for fedex
5
+
3
6
  ### v1.14.1
4
7
  - Fix parsing of CanadaPostPWS service options response.
5
8
 
@@ -304,7 +304,7 @@ module ActiveShipping
304
304
  xml.ReturnTransitAndCommit(true)
305
305
 
306
306
  # Returns saturday delivery shipping options when available
307
- xml.VariableOptions('SATURDAY_DELIVERY')
307
+ xml.VariableOptions('SATURDAY_DELIVERY') if options[:saturday_delivery]
308
308
 
309
309
  xml.RequestedShipment do
310
310
  if options[:pickup_date]
@@ -1,3 +1,3 @@
1
1
  module ActiveShipping
2
- VERSION = "1.14.1"
2
+ VERSION = "1.14.2"
3
3
  end
@@ -0,0 +1,79 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <RateRequest xmlns="http://fedex.com/ws/rate/v13">
3
+ <WebAuthenticationDetail>
4
+ <UserCredential>
5
+ <Key>1111</Key>
6
+ <Password>2222</Password>
7
+ </UserCredential>
8
+ </WebAuthenticationDetail>
9
+ <ClientDetail>
10
+ <AccountNumber>3333</AccountNumber>
11
+ <MeterNumber>4444</MeterNumber>
12
+ </ClientDetail>
13
+ <TransactionDetail>
14
+ <CustomerTransactionId>ActiveShipping</CustomerTransactionId>
15
+ </TransactionDetail>
16
+ <Version>
17
+ <ServiceId>crs</ServiceId>
18
+ <Major>13</Major>
19
+ <Intermediate>0</Intermediate>
20
+ <Minor>0</Minor>
21
+ </Version>
22
+ <ReturnTransitAndCommit>true</ReturnTransitAndCommit>
23
+ <RequestedShipment>
24
+ <ShipTimestamp>2009-07-20T12:01:55-04:00</ShipTimestamp>
25
+ <DropoffType>REGULAR_PICKUP</DropoffType>
26
+ <PackagingType>YOUR_PACKAGING</PackagingType>
27
+ <Shipper>
28
+ <Address>
29
+ <StreetLines>110 Laurier Avenue West</StreetLines>
30
+ <City>Ottawa</City>
31
+ <PostalCode>K1P 1J1</PostalCode>
32
+ <CountryCode>CA</CountryCode>
33
+ <Residential>true</Residential>
34
+ </Address>
35
+ </Shipper>
36
+ <Recipient>
37
+ <Address>
38
+ <StreetLines>455 N. Rexford Dr.</StreetLines>
39
+ <StreetLines>3rd Floor</StreetLines>
40
+ <City>Beverly Hills</City>
41
+ <PostalCode>90210</PostalCode>
42
+ <CountryCode>US</CountryCode>
43
+ <Residential>true</Residential>
44
+ </Address>
45
+ </Recipient>
46
+ <SmartPostDetail>
47
+ <Indicia>PARCEL_SELECT</Indicia>
48
+ <HubId>5902</HubId>
49
+ </SmartPostDetail>
50
+ <RateRequestTypes>ACCOUNT</RateRequestTypes>
51
+ <PackageCount>2</PackageCount>
52
+ <RequestedPackageLineItems>
53
+ <GroupPackageCount>1</GroupPackageCount>
54
+ <Weight>
55
+ <Units>KG</Units>
56
+ <Value>0.25</Value>
57
+ </Weight>
58
+ <Dimensions>
59
+ <Length>19</Length>
60
+ <Width>14</Width>
61
+ <Height>2</Height>
62
+ <Units>CM</Units>
63
+ </Dimensions>
64
+ </RequestedPackageLineItems>
65
+ <RequestedPackageLineItems>
66
+ <GroupPackageCount>1</GroupPackageCount>
67
+ <Weight>
68
+ <Units>KG</Units>
69
+ <Value>3.402</Value>
70
+ </Weight>
71
+ <Dimensions>
72
+ <Length>39</Length>
73
+ <Width>26</Width>
74
+ <Height>12</Height>
75
+ <Units>CM</Units>
76
+ </Dimensions>
77
+ </RequestedPackageLineItems>
78
+ </RequestedShipment>
79
+ </RateRequest>
@@ -93,7 +93,19 @@ class FedExTest < Minitest::Test
93
93
  destination = ActiveShipping::Location.from(location_fixtures[:beverly_hills].to_hash, :address_type => :commercial)
94
94
  @carrier.find_rates( location_fixtures[:ottawa],
95
95
  destination,
96
- package_fixtures.values_at(:book, :wii), :test => true)
96
+ package_fixtures.values_at(:book, :wii), test: true, saturday_delivery: true)
97
+ end
98
+
99
+ def test_building_request_with_no_saturday_delivery_should_not_have_saturday_option_set
100
+ mock_response = xml_fixture('fedex/ottawa_to_beverly_hills_rate_response')
101
+ expected_request = xml_fixture('fedex/ottawa_to_beverly_hills_no_saturday_rate_request')
102
+
103
+ @carrier.expects(:ship_timestamp).returns(Time.parse("2009-07-20T12:01:55-04:00").in_time_zone('US/Eastern'))
104
+ @carrier.expects(:commit).with { |request, test_mode| Hash.from_xml(request) == Hash.from_xml(expected_request) && test_mode }.returns(mock_response)
105
+ destination = ActiveShipping::Location.from(location_fixtures[:beverly_hills].to_hash)
106
+ @carrier.find_rates( location_fixtures[:ottawa],
107
+ destination,
108
+ package_fixtures.values_at(:book, :wii), test: true)
97
109
  end
98
110
 
99
111
  def test_building_freight_request_and_parsing_response
@@ -130,7 +142,7 @@ class FedExTest < Minitest::Test
130
142
 
131
143
  response = @carrier.find_rates( shipping_location,
132
144
  location_fixtures[:ottawa],
133
- [package_fixtures[:wii]], :freight => freight_options, :test => true )
145
+ [package_fixtures[:wii]], freight: freight_options, test: true, saturday_delivery: true )
134
146
 
135
147
  assert_equal ["FedEx Freight Economy", "FedEx Freight Priority"], response.rates.map(&:service_name)
136
148
  assert_equal [66263, 68513], response.rates.map(&:price)
@@ -164,7 +176,7 @@ class FedExTest < Minitest::Test
164
176
  @carrier.expects(:commit).with { |request, test_mode| Hash.from_xml(request) == Hash.from_xml(expected_request) && test_mode }.returns(mock_response)
165
177
  response = @carrier.find_rates( location_fixtures[:ottawa],
166
178
  location_fixtures[:beverly_hills],
167
- package_fixtures.values_at(:book, :wii), :test => true)
179
+ package_fixtures.values_at(:book, :wii), test: true, saturday_delivery: true)
168
180
  assert_equal ["FedEx Ground"], response.rates.map(&:service_name)
169
181
  assert_equal [3836], response.rates.map(&:price)
170
182
 
@@ -199,7 +211,7 @@ class FedExTest < Minitest::Test
199
211
  exception = assert_raises(ActiveShipping::ResponseContentError) do
200
212
  @carrier.find_rates( location_fixtures[:ottawa],
201
213
  location_fixtures[:beverly_hills],
202
- package_fixtures.values_at(:book, :wii), :test => true)
214
+ package_fixtures.values_at(:book, :wii), test: true, saturday_delivery: true)
203
215
  end
204
216
  message = "Invalid document \n\n#{mock_response}"
205
217
  assert_equal message, exception.message
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_shipping
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.1
4
+ version: 1.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
@@ -287,6 +287,7 @@ files:
287
287
  - test/fixtures/xml/fedex/freight_rate_response.xml
288
288
  - test/fixtures/xml/fedex/invalid_fedex_reply.xml
289
289
  - test/fixtures/xml/fedex/ottawa_to_beverly_hills_commercial_rate_request.xml
290
+ - test/fixtures/xml/fedex/ottawa_to_beverly_hills_no_saturday_rate_request.xml
290
291
  - test/fixtures/xml/fedex/ottawa_to_beverly_hills_rate_request.xml
291
292
  - test/fixtures/xml/fedex/ottawa_to_beverly_hills_rate_response.xml
292
293
  - test/fixtures/xml/fedex/raterequest_reply.xml
@@ -524,6 +525,7 @@ test_files:
524
525
  - test/fixtures/xml/fedex/freight_rate_response.xml
525
526
  - test/fixtures/xml/fedex/invalid_fedex_reply.xml
526
527
  - test/fixtures/xml/fedex/ottawa_to_beverly_hills_commercial_rate_request.xml
528
+ - test/fixtures/xml/fedex/ottawa_to_beverly_hills_no_saturday_rate_request.xml
527
529
  - test/fixtures/xml/fedex/ottawa_to_beverly_hills_rate_request.xml
528
530
  - test/fixtures/xml/fedex/ottawa_to_beverly_hills_rate_response.xml
529
531
  - test/fixtures/xml/fedex/raterequest_reply.xml