dhl-get_quote 0.4.25
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/.rvmrc.example +1 -0
- data/.travis.yml +10 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +357 -0
- data/Rakefile +11 -0
- data/dhl-get_quote.gemspec +30 -0
- data/lib/dhl/get_quote/errors.rb +13 -0
- data/lib/dhl/get_quote/helper.rb +16 -0
- data/lib/dhl/get_quote/market_service.rb +42 -0
- data/lib/dhl/get_quote/piece.rb +59 -0
- data/lib/dhl/get_quote/request.rb +183 -0
- data/lib/dhl/get_quote/response.rb +94 -0
- data/lib/dhl/get_quote/version.rb +5 -0
- data/lib/dhl-get_quote.rb +96 -0
- data/spec/lib/dhl/dh-get_quote_spec.rb +177 -0
- data/spec/lib/dhl/get_quote/market_service_spec.rb +78 -0
- data/spec/lib/dhl/get_quote/piece_spec.rb +104 -0
- data/spec/lib/dhl/get_quote/request_spec.rb +482 -0
- data/spec/lib/dhl/get_quote/response_spec.rb +146 -0
- data/spec/spec_helper.rb +508 -0
- data/tpl/request.xml.erb +40 -0
- metadata +172 -0
data/tpl/request.xml.erb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-req.xsd ">
|
3
|
+
<GetQuote>
|
4
|
+
<Request>
|
5
|
+
<ServiceHeader>
|
6
|
+
<SiteID><%= @site_id %></SiteID>
|
7
|
+
<Password><%= @password %></Password>
|
8
|
+
</ServiceHeader>
|
9
|
+
</Request>
|
10
|
+
<From>
|
11
|
+
<CountryCode><%= @from_country_code %></CountryCode>
|
12
|
+
<Postalcode><%= @from_postal_code %></Postalcode>
|
13
|
+
</From>
|
14
|
+
<BkgDetails>
|
15
|
+
<PaymentCountryCode><%= @from_country_code %></PaymentCountryCode>
|
16
|
+
<Date><%= Time.now.strftime("%Y-%m-%d") %></Date>
|
17
|
+
<ReadyTime><%= ready_time %></ReadyTime>
|
18
|
+
<ReadyTimeGMTOffset>+00:00</ReadyTimeGMTOffset>
|
19
|
+
<DimensionUnit><%= dimensions_unit %></DimensionUnit>
|
20
|
+
<WeightUnit><%= weight_unit %></WeightUnit>
|
21
|
+
<Pieces>
|
22
|
+
<% pieces.each_with_index do |piece,i| %><%= piece.piece_id = i+1; piece.to_xml %><% end %>
|
23
|
+
</Pieces>
|
24
|
+
<IsDutiable><%= dutiable? ? "Y" : "N" %></IsDutiable>
|
25
|
+
<% if special_services.size>0 -%>
|
26
|
+
<QtdShp>
|
27
|
+
<% special_services.each do |special_service_type_code| -%>
|
28
|
+
<QtdShpExChrg>
|
29
|
+
<SpecialServiceType><%= special_service_type_code %></SpecialServiceType>
|
30
|
+
</QtdShpExChrg>
|
31
|
+
<% end -%>
|
32
|
+
</QtdShp>
|
33
|
+
<% end -%>
|
34
|
+
</BkgDetails>
|
35
|
+
<To>
|
36
|
+
<CountryCode><%= @to_country_code %></CountryCode>
|
37
|
+
<Postalcode><%= @to_postal_code %></Postalcode>
|
38
|
+
</To>
|
39
|
+
</GetQuote>
|
40
|
+
</p:DCTRequest>
|
metadata
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dhl-get_quote
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.25
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Deseret Book
|
9
|
+
- Matthew Nielsen
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2013-04-25 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: httparty
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.10.2
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 0.10.2
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: multi_xml
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ~>
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 0.5.3
|
39
|
+
type: :runtime
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.5.3
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 10.0.4
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 10.0.4
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: rake
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - '='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 10.0.4
|
71
|
+
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - '='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 10.0.4
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: rspec
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - '='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 2.13.0
|
87
|
+
type: :development
|
88
|
+
prerelease: false
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - '='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 2.13.0
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: rspec-must
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - '='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 0.0.1
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.0.1
|
111
|
+
description: Get shipping quotes from DHL
|
112
|
+
email:
|
113
|
+
- mnielsen@deseretbook.com
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- .gitignore
|
119
|
+
- .rspec
|
120
|
+
- .rvmrc.example
|
121
|
+
- .travis.yml
|
122
|
+
- Gemfile
|
123
|
+
- LICENSE.txt
|
124
|
+
- README.md
|
125
|
+
- Rakefile
|
126
|
+
- dhl-get_quote.gemspec
|
127
|
+
- lib/dhl-get_quote.rb
|
128
|
+
- lib/dhl/get_quote/errors.rb
|
129
|
+
- lib/dhl/get_quote/helper.rb
|
130
|
+
- lib/dhl/get_quote/market_service.rb
|
131
|
+
- lib/dhl/get_quote/piece.rb
|
132
|
+
- lib/dhl/get_quote/request.rb
|
133
|
+
- lib/dhl/get_quote/response.rb
|
134
|
+
- lib/dhl/get_quote/version.rb
|
135
|
+
- spec/lib/dhl/dh-get_quote_spec.rb
|
136
|
+
- spec/lib/dhl/get_quote/market_service_spec.rb
|
137
|
+
- spec/lib/dhl/get_quote/piece_spec.rb
|
138
|
+
- spec/lib/dhl/get_quote/request_spec.rb
|
139
|
+
- spec/lib/dhl/get_quote/response_spec.rb
|
140
|
+
- spec/spec_helper.rb
|
141
|
+
- tpl/request.xml.erb
|
142
|
+
homepage: ''
|
143
|
+
licenses: []
|
144
|
+
post_install_message:
|
145
|
+
rdoc_options: []
|
146
|
+
require_paths:
|
147
|
+
- lib
|
148
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
+
none: false
|
150
|
+
requirements:
|
151
|
+
- - ! '>='
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
|
+
none: false
|
156
|
+
requirements:
|
157
|
+
- - ! '>='
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
requirements: []
|
161
|
+
rubyforge_project:
|
162
|
+
rubygems_version: 1.8.25
|
163
|
+
signing_key:
|
164
|
+
specification_version: 3
|
165
|
+
summary: Gem to interface with DHL's XML-PI shipping quote service.
|
166
|
+
test_files:
|
167
|
+
- spec/lib/dhl/dh-get_quote_spec.rb
|
168
|
+
- spec/lib/dhl/get_quote/market_service_spec.rb
|
169
|
+
- spec/lib/dhl/get_quote/piece_spec.rb
|
170
|
+
- spec/lib/dhl/get_quote/request_spec.rb
|
171
|
+
- spec/lib/dhl/get_quote/response_spec.rb
|
172
|
+
- spec/spec_helper.rb
|