fedex 3.3.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.md +14 -12
- data/fedex.gemspec +2 -0
- data/lib/fedex/request/address.rb +1 -1
- data/lib/fedex/request/base.rb +6 -0
- data/lib/fedex/request/shipment.rb +1 -1
- data/lib/fedex/version.rb +1 -1
- data/spec/lib/fedex/address_spec.rb +20 -0
- data/spec/lib/fedex/track_spec.rb +1 -1
- metadata +14 -13
data/Readme.md
CHANGED
@@ -68,10 +68,10 @@ packages << {
|
|
68
68
|
```
|
69
69
|
|
70
70
|
By default packaging type is "YOUR PACKAGING" and the drop off type is "REGULAR PICKUP".
|
71
|
-
If you need something different you can pass an extra hash for shipping
|
71
|
+
If you need something different you can pass an extra hash for shipping options
|
72
72
|
|
73
73
|
```ruby
|
74
|
-
|
74
|
+
shipping_options = {
|
75
75
|
:packaging_type => "YOUR_PACKAGING",
|
76
76
|
:drop_off_type => "REGULAR_PICKUP"
|
77
77
|
}
|
@@ -98,7 +98,7 @@ rate = fedex.rate(:shipper=>shipper,
|
|
98
98
|
:recipient => recipient,
|
99
99
|
:packages => packages,
|
100
100
|
:service_type => "FEDEX_GROUND",
|
101
|
-
:
|
101
|
+
:shipping_options => shipping_options)
|
102
102
|
```
|
103
103
|
|
104
104
|
Fedex provides multiple total values; `total_net_charge` is the final amount you are looking for.
|
@@ -123,7 +123,7 @@ ship = fedex.ship(:shipper=>shipper,
|
|
123
123
|
:recipient => recipient,
|
124
124
|
:packages => packages,
|
125
125
|
:service_type => "FEDEX_GROUND",
|
126
|
-
:
|
126
|
+
:shipping_options => shipping_options)
|
127
127
|
puts ship[:completed_shipment_detail][:operational_detail] [:transit_time]
|
128
128
|
```
|
129
129
|
Above code will give you the transit time.
|
@@ -138,7 +138,7 @@ label = fedex.label(:filename => "my_dir/example.pdf",
|
|
138
138
|
:recipient => recipient,
|
139
139
|
:packages => packages,
|
140
140
|
:service_type => "FEDEX_GROUND",
|
141
|
-
:
|
141
|
+
:shipping_options => shipping_options)
|
142
142
|
```
|
143
143
|
|
144
144
|
### ** Generate a shipping label in any available format **
|
@@ -156,7 +156,7 @@ label = fedex.label(:filename => "my_dir/example_epl2.pcx",
|
|
156
156
|
:recipient => recipient,
|
157
157
|
:packages => packages,
|
158
158
|
:service_type => "FEDEX_GROUND",
|
159
|
-
:
|
159
|
+
:shipping_options => shipping_options,
|
160
160
|
:label_specification => example_spec)
|
161
161
|
```
|
162
162
|
### ** Storing a label on Amazon S3 with Paperclip **
|
@@ -169,7 +169,7 @@ label = fedex.label(:filename => "tmp/example_label.pdf",
|
|
169
169
|
:recipient => recipient,
|
170
170
|
:packages => packages,
|
171
171
|
:service_type => "FEDEX_GROUND",
|
172
|
-
:
|
172
|
+
:shipping_options => shipping_options,
|
173
173
|
:label_specification => example_spec)
|
174
174
|
```
|
175
175
|
|
@@ -240,16 +240,18 @@ Fedex::Shipment::DROP_OFF_TYPES
|
|
240
240
|
````
|
241
241
|
|
242
242
|
# Contributors:
|
243
|
-
- [jazminschroeder](http://github.com/jazminschroeder) (Jazmin Schroeder)
|
244
|
-
- [parndt](https://github.com/parndt) (Philip Arndt)
|
245
|
-
- [mmell](https://github.com/mmell) (Michael Mell)
|
246
|
-
- [jordanbyron](https://github.com/jordanbyron) (Jordan Byron)
|
247
|
-
- [geermc4](https://github.com/geermc4) (German Garcia)
|
243
|
+
- [jazminschroeder] (http://github.com/jazminschroeder) (Jazmin Schroeder)
|
244
|
+
- [parndt] (https://github.com/parndt) (Philip Arndt)
|
245
|
+
- [mmell] (https://github.com/mmell) (Michael Mell)
|
246
|
+
- [jordanbyron] (https://github.com/jordanbyron) (Jordan Byron)
|
247
|
+
- [geermc4] (https://github.com/geermc4) (German Garcia)
|
248
248
|
- [janders223] (https://github.com/janders223) (Jim Anders)
|
249
249
|
- [jlambert121] (https://github.com/jlambert121) (Justin Lambert)
|
250
250
|
- [sborsje] (https://github.com/sborsje) (Stefan Borsje)
|
251
251
|
- [bradediger] (https://github.com/bradediger) (Brad Ediger)
|
252
252
|
- [yevgenko] (https://github.com/yevgenko) (Yevgeniy Viktorov)
|
253
|
+
- [smartacus] (https://github.com/smartacus) (Michael Lippold)
|
254
|
+
- [jonathandean] (https://github.com/jonathandean) (Jonathan Dean)
|
253
255
|
|
254
256
|
# Copyright/License:
|
255
257
|
Copyright 2011 [Jazmin Schroeder](http://jazminschroeder.com)
|
data/fedex.gemspec
CHANGED
@@ -17,7 +17,7 @@ module Fedex
|
|
17
17
|
response = parse_response(api_response)
|
18
18
|
if success?(response)
|
19
19
|
options = response[:address_validation_reply][:address_results][:proposed_address_details]
|
20
|
-
|
20
|
+
options = Array(options).first
|
21
21
|
Fedex::Address.new(options)
|
22
22
|
else
|
23
23
|
error_message = if response[:address_validation_reply]
|
data/lib/fedex/request/base.rb
CHANGED
@@ -177,6 +177,12 @@ module Fedex
|
|
177
177
|
@packages.each do |package|
|
178
178
|
xml.RequestedPackageLineItems{
|
179
179
|
xml.GroupPackageCount 1
|
180
|
+
if package[:insured_value]
|
181
|
+
xml.InsuredValue{
|
182
|
+
xml.Currency package[:insured_value][:currency]
|
183
|
+
xml.Amount package[:insured_value][:amount]
|
184
|
+
}
|
185
|
+
end
|
180
186
|
xml.Weight{
|
181
187
|
xml.Units package[:weight][:units]
|
182
188
|
xml.Value package[:weight][:value]
|
@@ -37,7 +37,7 @@ module Fedex
|
|
37
37
|
# Add information for shipments
|
38
38
|
def add_requested_shipment(xml)
|
39
39
|
xml.RequestedShipment{
|
40
|
-
xml.ShipTimestamp Time.now.utc.iso8601(2)
|
40
|
+
xml.ShipTimestamp @shipping_options[:ship_timestamp] ||= Time.now.utc.iso8601(2)
|
41
41
|
xml.DropoffType @shipping_options[:drop_off_type] ||= "REGULAR_PICKUP"
|
42
42
|
xml.ServiceType service_type
|
43
43
|
xml.PackagingType @shipping_options[:packaging_type] ||= "YOUR_PACKAGING"
|
data/lib/fedex/version.rb
CHANGED
@@ -34,6 +34,26 @@ module Fedex
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
context "multiple address validation results", :vcr do
|
38
|
+
let(:address) do
|
39
|
+
{
|
40
|
+
:street => "301 Las Colinas Blvd",
|
41
|
+
:city => "Irving",
|
42
|
+
:state => "TX",
|
43
|
+
:postal_code => "75039",
|
44
|
+
:country => "USA"
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
let(:options) do
|
49
|
+
{ :address => address }
|
50
|
+
end
|
51
|
+
|
52
|
+
it "validates the address" do
|
53
|
+
expect{ fedex.validate_address(options) }.to_not raise_error
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
37
57
|
end
|
38
58
|
end
|
39
59
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fedex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement: &
|
16
|
+
requirement: &70294995885800 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.11.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70294995885800
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: nokogiri
|
27
|
-
requirement: &
|
27
|
+
requirement: &70294995885280 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.5.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70294995885280
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70294995884680 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.9.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70294995884680
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: vcr
|
49
|
-
requirement: &
|
49
|
+
requirement: &70294995884140 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 2.0.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70294995884140
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: webmock
|
60
|
-
requirement: &
|
60
|
+
requirement: &70294995883540 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: 1.8.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70294995883540
|
69
69
|
description: Provides an interface to Fedex Web Services(version 10) - shipping rates,
|
70
70
|
generate labels and address validation
|
71
71
|
email:
|
@@ -109,7 +109,8 @@ files:
|
|
109
109
|
- spec/support/credentials.rb
|
110
110
|
- spec/support/vcr.rb
|
111
111
|
homepage: https://github.com/jazminschroeder/fedex
|
112
|
-
licenses:
|
112
|
+
licenses:
|
113
|
+
- MIT
|
113
114
|
post_install_message:
|
114
115
|
rdoc_options: []
|
115
116
|
require_paths:
|