dpd_api 0.1.8 → 0.1.9
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 +4 -4
- data/lib/dpd_api/order.rb +5 -5
- data/lib/dpd_api/version.rb +1 -1
- data/spec/lib/dpd_api/order_spec.rb +8 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d2a66b51282b428cbd2684bca9bbf2a803e4caa
|
4
|
+
data.tar.gz: d9676f2c92caf42bb2480c315c939e2d63ea9e2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7cb41872ce10d3b5f9e2fe2c9cebb3a620290ade82c0e4455550f234c13483c5e76bbfe5fb955d1e5259581512f35541b9d670341ed2efd472cec56a9db3d04
|
7
|
+
data.tar.gz: 456c57a88cdf9a843eedd41428734b04dca1ed65631494584021691ffe38a6da002f1981003b598673777f333dc78e10be32528ed6fee902ce72c304649f9990
|
data/lib/dpd_api/order.rb
CHANGED
@@ -5,27 +5,27 @@ module DpdApi
|
|
5
5
|
class << self
|
6
6
|
def create_order(params = {})
|
7
7
|
method = :create_order
|
8
|
-
response(method, params, namespace:
|
8
|
+
response(method, params, namespace: :orders)
|
9
9
|
end
|
10
10
|
|
11
11
|
def cancel_order(params = {})
|
12
12
|
method = :cancel_order
|
13
|
-
response(method, params, namespace:
|
13
|
+
response(method, params, namespace: :orders)
|
14
14
|
end
|
15
15
|
|
16
16
|
def order_status(params = {})
|
17
17
|
method = :get_order_status
|
18
|
-
response(method, params, namespace:
|
18
|
+
response(method, params, namespace: :order_status)
|
19
19
|
end
|
20
20
|
|
21
21
|
def create_address(params = {})
|
22
22
|
method = :create_address
|
23
|
-
response(method, params, namespace:
|
23
|
+
response(method, params, namespace: :orders)
|
24
24
|
end
|
25
25
|
|
26
26
|
def update_address(params = {})
|
27
27
|
method = :update_address
|
28
|
-
response(method, params, namespace:
|
28
|
+
response(method, params, namespace: :orders)
|
29
29
|
end
|
30
30
|
|
31
31
|
# TODO: add :save for file
|
data/lib/dpd_api/version.rb
CHANGED
@@ -9,12 +9,12 @@ describe DpdApi::Order do
|
|
9
9
|
|
10
10
|
let(:auth) do
|
11
11
|
{ auth: {
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
client_number: ENV['DPD_CLIENT_NUMBER'] || '234',
|
13
|
+
client_key: ENV['DPD_CLIENT_KEY'] || '123'
|
14
|
+
} }
|
15
15
|
end
|
16
16
|
let(:message) do
|
17
|
-
{
|
17
|
+
{ orders: auth.clone.deep_merge!(params) }
|
18
18
|
end
|
19
19
|
|
20
20
|
context ".create_order" do
|
@@ -93,10 +93,13 @@ describe DpdApi::Order do
|
|
93
93
|
context ".order_status" do
|
94
94
|
let(:fixture) { File.read("spec/fixtures/dpd_api/order/order_status.xml") }
|
95
95
|
let(:params) do
|
96
|
-
{
|
96
|
+
{ order_status: {
|
97
97
|
order_number_internal: '1234567',
|
98
98
|
} }
|
99
99
|
end
|
100
|
+
let(:message) do
|
101
|
+
{ order_status: auth.clone.deep_merge!(params) }
|
102
|
+
end
|
100
103
|
|
101
104
|
it "is success" do
|
102
105
|
savon.expects(:get_order_status).with(message: message).returns(fixture)
|
@@ -174,8 +177,6 @@ describe DpdApi::Order do
|
|
174
177
|
# TODO: just fill with response the add_parcels.xml file and test should pass
|
175
178
|
xcontext ".add_parcels" do
|
176
179
|
let(:fixture) { File.read("spec/fixtures/dpd_api/order/add_parcels.xml") }
|
177
|
-
let(:params) do
|
178
|
-
end
|
179
180
|
|
180
181
|
it "is success" do
|
181
182
|
savon.expects(:add_parcels).with(message: message).returns(fixture)
|