dooca_commerce 1.0.3 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dooca_commerce.rb +48 -0
- data/lib/response_handler.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2ef96abbacc085d54da98f7b01e7eddf76a8cf828f708c18fdca2e9ceb953c3
|
4
|
+
data.tar.gz: efffdc00fc890996eceff0c26e7a0000aab25ea28dc9c74706052642957c16a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19b72c6b0961678d5a18289f6212b6e907e736eeebac7db58b52f6fc998569268046f8d98c62f001d477f5c533b8485e86a6877b9034566a3a5434f2e12ca531
|
7
|
+
data.tar.gz: fc70541b5c1b48a8a9ebacf5093d8106fbf9117166bcd7e21cfbed7e7305baa502dbf65ea781e8908ab0452caa5be82552baae50ca5c2aba764b54f8b228fb11
|
data/lib/dooca_commerce.rb
CHANGED
@@ -46,6 +46,18 @@ class DoocaCommerce
|
|
46
46
|
handler.new(response).parse!
|
47
47
|
end
|
48
48
|
|
49
|
+
def fetch_orders(query = {})
|
50
|
+
response = connection.get("/orders", query)
|
51
|
+
|
52
|
+
handler.new(response).parse!
|
53
|
+
end
|
54
|
+
|
55
|
+
def fetch_order(order_id:)
|
56
|
+
response = connection.get("/orders/#{order_id}")
|
57
|
+
|
58
|
+
handler.new(response).parse!
|
59
|
+
end
|
60
|
+
|
49
61
|
def fetch_colors(query = {})
|
50
62
|
response = connection.get("/colors", query)
|
51
63
|
|
@@ -148,6 +160,42 @@ class DoocaCommerce
|
|
148
160
|
handler.new(response).parse!
|
149
161
|
end
|
150
162
|
|
163
|
+
def create_fulfillment(order_id:)
|
164
|
+
response = connection.post("/orders/#{order_id}/fulfillment")
|
165
|
+
|
166
|
+
handler.new(response).parse!
|
167
|
+
end
|
168
|
+
|
169
|
+
def update_invoice(order_id:, body:)
|
170
|
+
response = connection.put("/orders/#{order_id}/fulfillment/invoiced", body.to_json)
|
171
|
+
|
172
|
+
handler.new(response).parse!
|
173
|
+
end
|
174
|
+
|
175
|
+
def update_tracking(order_id:, body:)
|
176
|
+
response = connection.put("/orders/#{order_id}/fulfillment/shipped", body.to_json)
|
177
|
+
|
178
|
+
handler.new(response).parse!
|
179
|
+
end
|
180
|
+
|
181
|
+
def mark_as_delivered(order_id:)
|
182
|
+
response = connection.put("/orders/#{order_id}/fulfillment/delivered")
|
183
|
+
|
184
|
+
handler.new(response).parse!
|
185
|
+
end
|
186
|
+
|
187
|
+
def delete_image(product_id:, image_id:)
|
188
|
+
response = connection.delete("/products/#{product_id}/images/#{image_id}")
|
189
|
+
|
190
|
+
handler.new(response).parse!
|
191
|
+
end
|
192
|
+
|
193
|
+
def create_image(product_id:, body:)
|
194
|
+
response = connection.post("/products/#{product_id}/images", body.to_json)
|
195
|
+
|
196
|
+
handler.new(response).parse!
|
197
|
+
end
|
198
|
+
|
151
199
|
private
|
152
200
|
|
153
201
|
URL = "https://api.dooca.store"
|
data/lib/response_handler.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dooca_commerce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luciano Cesar Cordeiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|