blomming_api 0.4.5 → 0.4.6
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/blomming_api/buy_endpoints.rb +33 -33
- data/lib/blomming_api/oauth_endpoint.rb +1 -1
- data/lib/blomming_api/private_helpers.rb +26 -8
- data/lib/blomming_api/sell_endpoints.rb +33 -32
- data/lib/blomming_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7e0c7366da5aff6c926bcee806c8594392d9744
|
4
|
+
data.tar.gz: d9057aa9d300dce1dd2c331216fc58c6dffbf718
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d3406fb988cc61bc21bcce750bae444842fd72868a53787013537c848fbd6a87fe9db88e28487fc87756807c3d5bd4d7b62e828389ea36c637c33a12be93433
|
7
|
+
data.tar.gz: 68ba5da8c950751188f5bda3d85757234838bf9a1e8c6f21e84ca5acbcb82c987b60d0f05b0ff42f606e00573669392a996973e7da79867691b71fb53d081907
|
@@ -19,7 +19,7 @@ module BlommingApi
|
|
19
19
|
#puts req
|
20
20
|
#RestClient.log = 'stdout'
|
21
21
|
|
22
|
-
|
22
|
+
feed_or_retry do
|
23
23
|
RestClient.post url, load, req
|
24
24
|
end
|
25
25
|
end
|
@@ -31,7 +31,7 @@ module BlommingApi
|
|
31
31
|
# with a hash sends parameters as a urlencoded form body
|
32
32
|
load = {:skus => skus.join(','), :multipart => true}
|
33
33
|
|
34
|
-
|
34
|
+
feed_or_retry do
|
35
35
|
RestClient.put url, load, req
|
36
36
|
end
|
37
37
|
end
|
@@ -43,16 +43,16 @@ module BlommingApi
|
|
43
43
|
# with a hash sends parameters as a urlencoded form body
|
44
44
|
load = {:skus => skus.join(','), :multipart => true}
|
45
45
|
|
46
|
-
|
46
|
+
feed_or_retry do
|
47
47
|
RestClient.put url, load, req
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
def carts_clear(cart_id, params={})
|
52
|
-
url = api_url
|
52
|
+
url = api_url "/carts/#{cart_id}/clear"
|
53
53
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
54
54
|
|
55
|
-
|
55
|
+
feed_or_retry do
|
56
56
|
# PUT with a hash sends parameters as a urlencoded form body ?
|
57
57
|
RestClient.put url, req
|
58
58
|
end
|
@@ -63,7 +63,7 @@ module BlommingApi
|
|
63
63
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
64
64
|
load = MultiJson.dump order
|
65
65
|
|
66
|
-
|
66
|
+
feed_or_retry do
|
67
67
|
# POST with raw JSON payloads ?
|
68
68
|
RestClient.post url, load, req
|
69
69
|
end
|
@@ -74,7 +74,7 @@ module BlommingApi
|
|
74
74
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
75
75
|
load = MultiJson.dump paypal_order
|
76
76
|
|
77
|
-
|
77
|
+
feed_or_retry do
|
78
78
|
RestClient.post url, load, req
|
79
79
|
end
|
80
80
|
end
|
@@ -84,7 +84,7 @@ module BlommingApi
|
|
84
84
|
url = api_url '/carts/shipping_countries'
|
85
85
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
86
86
|
|
87
|
-
|
87
|
+
feed_or_retry do
|
88
88
|
RestClient.get url, req
|
89
89
|
end
|
90
90
|
end
|
@@ -93,7 +93,7 @@ module BlommingApi
|
|
93
93
|
url = api_url '/carts/#{cart_id}/show'
|
94
94
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
95
95
|
|
96
|
-
|
96
|
+
feed_or_retry do
|
97
97
|
RestClient.get url, req
|
98
98
|
end
|
99
99
|
end
|
@@ -102,7 +102,7 @@ module BlommingApi
|
|
102
102
|
url = api_url '/carts/#{cart_id}/validate'
|
103
103
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
104
104
|
|
105
|
-
|
105
|
+
feed_or_retry do
|
106
106
|
RestClient.get url, req
|
107
107
|
end
|
108
108
|
end
|
@@ -115,7 +115,7 @@ module BlommingApi
|
|
115
115
|
url = api_url '/categories'
|
116
116
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
117
117
|
|
118
|
-
|
118
|
+
feed_or_retry do
|
119
119
|
RestClient.get url, req
|
120
120
|
end
|
121
121
|
end
|
@@ -124,7 +124,7 @@ module BlommingApi
|
|
124
124
|
url = api_url "/categories/#{category_id}/items"
|
125
125
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
126
126
|
|
127
|
-
|
127
|
+
feed_or_retry do
|
128
128
|
RestClient.get url, req
|
129
129
|
end
|
130
130
|
end
|
@@ -136,7 +136,7 @@ module BlommingApi
|
|
136
136
|
url = api_url '/collections'
|
137
137
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
138
138
|
|
139
|
-
|
139
|
+
feed_or_retry do
|
140
140
|
RestClient.get url, req
|
141
141
|
end
|
142
142
|
end
|
@@ -145,7 +145,7 @@ module BlommingApi
|
|
145
145
|
url = api_url "/collections/#{collection_id}/items"
|
146
146
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
147
147
|
|
148
|
-
|
148
|
+
feed_or_retry do
|
149
149
|
RestClient.get url, req
|
150
150
|
end
|
151
151
|
end
|
@@ -157,7 +157,7 @@ module BlommingApi
|
|
157
157
|
url = api_url '/countries'
|
158
158
|
req = request_params({locale: @locale}.merge(params))
|
159
159
|
|
160
|
-
|
160
|
+
feed_or_retry do
|
161
161
|
RestClient.get url, req
|
162
162
|
end
|
163
163
|
end
|
@@ -169,7 +169,7 @@ module BlommingApi
|
|
169
169
|
url = api_url '/currencies'
|
170
170
|
req = request_params({locale: @locale}.merge(params))
|
171
171
|
|
172
|
-
|
172
|
+
feed_or_retry do
|
173
173
|
RestClient.get url, req
|
174
174
|
end
|
175
175
|
end
|
@@ -181,7 +181,7 @@ module BlommingApi
|
|
181
181
|
url = api_url '/items/discounted'
|
182
182
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
183
183
|
|
184
|
-
|
184
|
+
feed_or_retry do
|
185
185
|
RestClient.get url, req
|
186
186
|
end
|
187
187
|
end
|
@@ -190,7 +190,7 @@ module BlommingApi
|
|
190
190
|
url = api_url '/items/featured'
|
191
191
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
192
192
|
|
193
|
-
|
193
|
+
feed_or_retry do
|
194
194
|
RestClient.get url, req
|
195
195
|
end
|
196
196
|
end
|
@@ -199,7 +199,7 @@ module BlommingApi
|
|
199
199
|
url = api_url '/items/hand_picked'
|
200
200
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
201
201
|
|
202
|
-
|
202
|
+
feed_or_retry do
|
203
203
|
RestClient.get url, req
|
204
204
|
end
|
205
205
|
end
|
@@ -208,7 +208,7 @@ module BlommingApi
|
|
208
208
|
url = api_url '/items/list'
|
209
209
|
req = request_params({id: item_id, currency: @currency, locale: @locale}.merge(params))
|
210
210
|
|
211
|
-
|
211
|
+
feed_or_retry do
|
212
212
|
RestClient.get url, req
|
213
213
|
end
|
214
214
|
end
|
@@ -217,7 +217,7 @@ module BlommingApi
|
|
217
217
|
url = api_url '/items/most_liked'
|
218
218
|
req = request_params({currency: @currency, locale: @locale}.merge(params))
|
219
219
|
|
220
|
-
|
220
|
+
feed_or_retry do
|
221
221
|
RestClient.get url, req
|
222
222
|
end
|
223
223
|
end
|
@@ -226,7 +226,7 @@ module BlommingApi
|
|
226
226
|
url = api_url '/items/search'
|
227
227
|
req = request_params({q: keyword, currency: @currency, locale: @locale}.merge(params))
|
228
228
|
|
229
|
-
|
229
|
+
feed_or_retry do
|
230
230
|
RestClient.get url, req
|
231
231
|
end
|
232
232
|
end
|
@@ -238,7 +238,7 @@ module BlommingApi
|
|
238
238
|
url = api_url '/macrocategories'
|
239
239
|
req = request_params({locale: @locale}.merge(params))
|
240
240
|
|
241
|
-
|
241
|
+
feed_or_retry do
|
242
242
|
RestClient.get url, req
|
243
243
|
end
|
244
244
|
end
|
@@ -247,7 +247,7 @@ module BlommingApi
|
|
247
247
|
url = api_url "/macrocategories/:macrocategory_id/categories"
|
248
248
|
req = request_params({locale: @locale}.merge(params))
|
249
249
|
|
250
|
-
|
250
|
+
feed_or_retry do
|
251
251
|
RestClient.get url, req
|
252
252
|
end
|
253
253
|
end
|
@@ -256,7 +256,7 @@ module BlommingApi
|
|
256
256
|
url = api_url "/macrocategories/:macrocategory_id/items"
|
257
257
|
req = request_params({locale: @locale}.merge(params))
|
258
258
|
|
259
|
-
|
259
|
+
feed_or_retry do
|
260
260
|
RestClient.get url, req
|
261
261
|
end
|
262
262
|
end
|
@@ -268,7 +268,7 @@ module BlommingApi
|
|
268
268
|
def password_resets (email_of_user, params={})
|
269
269
|
url = api_url "/password_resets"
|
270
270
|
|
271
|
-
|
271
|
+
feed_or_retry do
|
272
272
|
# payload JSON ?
|
273
273
|
RestClient.post url, {email_of_user: email_of_user}.merge(params)
|
274
274
|
end
|
@@ -281,7 +281,7 @@ module BlommingApi
|
|
281
281
|
def provinces (province_country_code, params={})
|
282
282
|
url = api_url "/provinces/#{province_country_code}"
|
283
283
|
|
284
|
-
|
284
|
+
feed_or_retry do
|
285
285
|
RestClient.get url, request_params(params)
|
286
286
|
end
|
287
287
|
end
|
@@ -292,7 +292,7 @@ module BlommingApi
|
|
292
292
|
def shops (params={})
|
293
293
|
url = api_url '/shops'
|
294
294
|
|
295
|
-
|
295
|
+
feed_or_retry do
|
296
296
|
RestClient.get url, request_params(params)
|
297
297
|
end
|
298
298
|
end
|
@@ -300,7 +300,7 @@ module BlommingApi
|
|
300
300
|
def shop_items (shop_id, params={})
|
301
301
|
url = api_url "/shops/#{shop_id}/items"
|
302
302
|
|
303
|
-
data =
|
303
|
+
data = feed_or_retry do
|
304
304
|
RestClient.get url, request_params(params)
|
305
305
|
end
|
306
306
|
|
@@ -311,7 +311,7 @@ module BlommingApi
|
|
311
311
|
def shop_item (shop_id, item_id, params={})
|
312
312
|
url = api_url "/shops/#{shop_id}/items/#{item_id}"
|
313
313
|
|
314
|
-
|
314
|
+
feed_or_retry do
|
315
315
|
RestClient.get url, request_params(params)
|
316
316
|
end
|
317
317
|
end
|
@@ -319,7 +319,7 @@ module BlommingApi
|
|
319
319
|
def shops_find (shop_id, params={})
|
320
320
|
url = api_url "/shops/#{shop_id}"
|
321
321
|
|
322
|
-
|
322
|
+
feed_or_retry do
|
323
323
|
RestClient.get url, request_params(params)
|
324
324
|
end
|
325
325
|
end
|
@@ -330,7 +330,7 @@ module BlommingApi
|
|
330
330
|
def tags (params={})
|
331
331
|
url = api_url "/tags"
|
332
332
|
|
333
|
-
|
333
|
+
feed_or_retry do
|
334
334
|
RestClient.get url, request_params(params)
|
335
335
|
end
|
336
336
|
end
|
@@ -338,7 +338,7 @@ module BlommingApi
|
|
338
338
|
def tags_items (tag_id, params={})
|
339
339
|
url = api_url "/tags/#{tag_id}/items"
|
340
340
|
|
341
|
-
|
341
|
+
feed_or_retry do
|
342
342
|
RestClient.get url, request_params(params)
|
343
343
|
end
|
344
344
|
end
|
@@ -19,10 +19,10 @@ module BlommingApi
|
|
19
19
|
end
|
20
20
|
|
21
21
|
#
|
22
|
-
#
|
22
|
+
# feed_or_retry:
|
23
23
|
#
|
24
24
|
# 1. call RestClient verb,
|
25
|
-
# passed in a block (
|
25
|
+
# passed in a block (feed_or_retry is an iterator)
|
26
26
|
#
|
27
27
|
# 2. without any exception (http errors):
|
28
28
|
# return data (convert response data from JSON to Ruby Hash)
|
@@ -35,7 +35,7 @@ module BlommingApi
|
|
35
35
|
# if @survive_on_fatal_error if false (default)
|
36
36
|
# process die with exit
|
37
37
|
# if @survive_on_fatal_error if true (must be specified in config file)
|
38
|
-
#
|
38
|
+
# feed_or_retry return value: nil (no data available!).
|
39
39
|
#
|
40
40
|
# === arguments
|
41
41
|
#
|
@@ -44,9 +44,9 @@ module BlommingApi
|
|
44
44
|
#
|
45
45
|
# === examples
|
46
46
|
#
|
47
|
-
#
|
47
|
+
# feed_or_retry { RestClient.get url, req }
|
48
48
|
#
|
49
|
-
def
|
49
|
+
def feed_or_retry (&restclient_call_block)
|
50
50
|
begin
|
51
51
|
# call RestClient verb
|
52
52
|
json_data = restclient_call_block.call
|
@@ -57,7 +57,7 @@ module BlommingApi
|
|
57
57
|
retry
|
58
58
|
|
59
59
|
# RestClient exceptions, manage HTTP status code
|
60
|
-
rescue => e
|
60
|
+
rescue RestClient::Exception => e
|
61
61
|
|
62
62
|
if http_status_code_401? e
|
63
63
|
authenticate_refresh e
|
@@ -70,11 +70,14 @@ module BlommingApi
|
|
70
70
|
server_error! e
|
71
71
|
retry
|
72
72
|
|
73
|
-
# any other exception
|
73
|
+
# any other RestClient exception
|
74
74
|
else
|
75
75
|
return fatal_error! e
|
76
76
|
end
|
77
77
|
|
78
|
+
rescue => e
|
79
|
+
return unknown_error! e
|
80
|
+
|
78
81
|
else
|
79
82
|
# HTTP status 200: return data (hash from JSON)!
|
80
83
|
MultiJson.load json_data
|
@@ -129,7 +132,7 @@ module BlommingApi
|
|
129
132
|
|
130
133
|
|
131
134
|
def fatal_error!(e)
|
132
|
-
STDERR.puts "#{Time.now}: restclient error. http status code: #{e.response.code}: #{e.response.body}.
|
135
|
+
STDERR.puts "#{Time.now}: restclient error. http status code: #{e.response.code}: #{e.response.body}."
|
133
136
|
|
134
137
|
#
|
135
138
|
# survive_on_fatal_error initialized in config file
|
@@ -143,5 +146,20 @@ module BlommingApi
|
|
143
146
|
end
|
144
147
|
end
|
145
148
|
|
149
|
+
|
150
|
+
def unknown_error!(e)
|
151
|
+
STDERR.puts "#{Time.now}: error: #{e.class}: #{e.message}"
|
152
|
+
|
153
|
+
#
|
154
|
+
# survive_on_fatal_error initialized in config file
|
155
|
+
#
|
156
|
+
unless @survive_on_fatal_error
|
157
|
+
# Process die!
|
158
|
+
exit
|
159
|
+
else
|
160
|
+
# no data!
|
161
|
+
return nil
|
162
|
+
end
|
163
|
+
end
|
146
164
|
end
|
147
165
|
end
|
@@ -12,7 +12,7 @@ module BlommingApi
|
|
12
12
|
url = api_url "/sell/payment_types/user_list"
|
13
13
|
req = request_params(params)
|
14
14
|
|
15
|
-
|
15
|
+
feed_or_retry do
|
16
16
|
RestClient.get url, req
|
17
17
|
end
|
18
18
|
end
|
@@ -22,7 +22,7 @@ module BlommingApi
|
|
22
22
|
load = MultiJson.dump payload
|
23
23
|
req = request_params(params)
|
24
24
|
|
25
|
-
|
25
|
+
feed_or_retry do
|
26
26
|
RestClient.post url, load, req
|
27
27
|
end
|
28
28
|
end
|
@@ -32,7 +32,7 @@ module BlommingApi
|
|
32
32
|
load = MultiJson.dump payload
|
33
33
|
req = request_params(params)
|
34
34
|
|
35
|
-
|
35
|
+
feed_or_retry do
|
36
36
|
RestClient.put url, load, req
|
37
37
|
end
|
38
38
|
end
|
@@ -41,7 +41,7 @@ module BlommingApi
|
|
41
41
|
url = api_url "/sell/payment_types/#{id}"
|
42
42
|
req = request_params(params)
|
43
43
|
|
44
|
-
|
44
|
+
feed_or_retry do
|
45
45
|
RestClient.delete url, req
|
46
46
|
end
|
47
47
|
end
|
@@ -54,7 +54,7 @@ module BlommingApi
|
|
54
54
|
load = MultiJson.dump payload
|
55
55
|
req = request_params(params)
|
56
56
|
|
57
|
-
|
57
|
+
feed_or_retry do
|
58
58
|
RestClient.post url, load, req
|
59
59
|
end
|
60
60
|
end
|
@@ -66,7 +66,7 @@ module BlommingApi
|
|
66
66
|
url = api_url "/sell/shipping_countries/all"
|
67
67
|
req = request_params({locale: @locale}.merge(params))
|
68
68
|
|
69
|
-
|
69
|
+
feed_or_retry do
|
70
70
|
RestClient.get url, req
|
71
71
|
end
|
72
72
|
end
|
@@ -79,7 +79,7 @@ module BlommingApi
|
|
79
79
|
url = api_url "/sell/shipping_profiles"
|
80
80
|
req = request_params(params)
|
81
81
|
|
82
|
-
|
82
|
+
feed_or_retry do
|
83
83
|
RestClient.get url, req
|
84
84
|
end
|
85
85
|
end
|
@@ -89,7 +89,7 @@ module BlommingApi
|
|
89
89
|
load = MultiJson.dump payload
|
90
90
|
req = request_params(params)
|
91
91
|
|
92
|
-
|
92
|
+
feed_or_retry do
|
93
93
|
RestClient.post url, load, req
|
94
94
|
end
|
95
95
|
end
|
@@ -100,7 +100,7 @@ module BlommingApi
|
|
100
100
|
load = MultiJson.dump payload
|
101
101
|
req = request_params(params)
|
102
102
|
|
103
|
-
|
103
|
+
feed_or_retry do
|
104
104
|
RestClient.put url, load, req
|
105
105
|
end
|
106
106
|
end
|
@@ -111,7 +111,7 @@ module BlommingApi
|
|
111
111
|
load = MultiJson.dump payload
|
112
112
|
req = request_params(params)
|
113
113
|
|
114
|
-
|
114
|
+
feed_or_retry do
|
115
115
|
RestClient.put url, load, req
|
116
116
|
end
|
117
117
|
end
|
@@ -120,7 +120,7 @@ module BlommingApi
|
|
120
120
|
url = api_url "/sell/payment_types/#{id}"
|
121
121
|
req = request_params(params)
|
122
122
|
|
123
|
-
|
123
|
+
feed_or_retry do
|
124
124
|
RestClient.delete url, req
|
125
125
|
end
|
126
126
|
end
|
@@ -129,7 +129,7 @@ module BlommingApi
|
|
129
129
|
url = api_url "/sell/payment_types/#{id}"
|
130
130
|
req = request_params(params)
|
131
131
|
|
132
|
-
|
132
|
+
feed_or_retry do
|
133
133
|
RestClient.get url, req
|
134
134
|
end
|
135
135
|
end
|
@@ -139,7 +139,7 @@ module BlommingApi
|
|
139
139
|
load = MultiJson.dump payload
|
140
140
|
req = request_params(params)
|
141
141
|
|
142
|
-
|
142
|
+
feed_or_retry do
|
143
143
|
RestClient.post url, load, req
|
144
144
|
end
|
145
145
|
end
|
@@ -152,7 +152,7 @@ module BlommingApi
|
|
152
152
|
url = api_url "/sell/shipping_regions/all"
|
153
153
|
req = request_params({locale: @locale}.merge(params))
|
154
154
|
|
155
|
-
|
155
|
+
feed_or_retry do
|
156
156
|
RestClient.get url, req
|
157
157
|
end
|
158
158
|
end
|
@@ -164,7 +164,7 @@ module BlommingApi
|
|
164
164
|
url = api_url "/sell/shop/dashboard"
|
165
165
|
req = request_params({locale: @locale}.merge(params))
|
166
166
|
|
167
|
-
|
167
|
+
feed_or_retry do
|
168
168
|
RestClient.get url, req
|
169
169
|
end
|
170
170
|
end
|
@@ -176,7 +176,7 @@ module BlommingApi
|
|
176
176
|
url = api_url '/sell/shop/items'
|
177
177
|
req = request_params(params)
|
178
178
|
|
179
|
-
|
179
|
+
feed_or_retry do
|
180
180
|
RestClient.get url, req
|
181
181
|
end
|
182
182
|
end
|
@@ -186,7 +186,7 @@ module BlommingApi
|
|
186
186
|
load = MultiJson.dump payload
|
187
187
|
req = request_params(params)
|
188
188
|
|
189
|
-
|
189
|
+
feed_or_retry do
|
190
190
|
RestClient.post url, load, req
|
191
191
|
end
|
192
192
|
end
|
@@ -195,7 +195,7 @@ module BlommingApi
|
|
195
195
|
url = api_url "/sell/shop/items/#{item_id}"
|
196
196
|
req = request_params(params)
|
197
197
|
|
198
|
-
|
198
|
+
feed_or_retry do
|
199
199
|
RestClient.get url, req
|
200
200
|
end
|
201
201
|
end
|
@@ -205,7 +205,7 @@ module BlommingApi
|
|
205
205
|
load = MultiJson.dump payload
|
206
206
|
req = request_params(params)
|
207
207
|
|
208
|
-
|
208
|
+
feed_or_retry do
|
209
209
|
RestClient.put url, load, req
|
210
210
|
end
|
211
211
|
end
|
@@ -214,7 +214,7 @@ module BlommingApi
|
|
214
214
|
url = api_url "/sell/shop/items/#{item_id}"
|
215
215
|
req = request_params(params)
|
216
216
|
|
217
|
-
|
217
|
+
feed_or_retry do
|
218
218
|
RestClient.delete url, req
|
219
219
|
end
|
220
220
|
end
|
@@ -226,7 +226,7 @@ module BlommingApi
|
|
226
226
|
# with a hash sends parameters as a urlencoded form body
|
227
227
|
load = {:tags => tags.join(','), :multipart => true}
|
228
228
|
|
229
|
-
|
229
|
+
feed_or_retry do
|
230
230
|
RestClient.post url, load, req
|
231
231
|
end
|
232
232
|
end
|
@@ -238,12 +238,13 @@ module BlommingApi
|
|
238
238
|
# with a hash sends parameters as a urlencoded form body
|
239
239
|
load = {:tags => tags.join(','), :multipart => true}
|
240
240
|
|
241
|
-
|
241
|
+
feed_or_retry do
|
242
242
|
RestClient.post url, load, req
|
243
243
|
end
|
244
244
|
end
|
245
245
|
|
246
246
|
|
247
|
+
|
247
248
|
#
|
248
249
|
# SHOP_ORDERS
|
249
250
|
#
|
@@ -251,7 +252,7 @@ module BlommingApi
|
|
251
252
|
url = api_url "/sell/shop/orders/states"
|
252
253
|
req = request_params(params)
|
253
254
|
|
254
|
-
|
255
|
+
feed_or_retry do
|
255
256
|
RestClient.get url, req
|
256
257
|
end
|
257
258
|
end
|
@@ -260,37 +261,37 @@ module BlommingApi
|
|
260
261
|
url = api_url "/sell/shop/orders"
|
261
262
|
req = request_params({ order_status: order_status, currency: @currency, locale: @locale}.merge(params))
|
262
263
|
|
263
|
-
|
264
|
+
feed_or_retry do
|
264
265
|
RestClient.get url, req
|
265
266
|
end
|
266
267
|
end
|
267
268
|
|
268
|
-
def
|
269
|
+
def sell_shop_orders_find (order_number, params={})
|
269
270
|
url = api_url "/sell/shop/orders/#{order_number}"
|
270
271
|
req = request_params(params)
|
271
272
|
|
272
|
-
|
273
|
+
feed_or_retry do
|
273
274
|
RestClient.get url, req
|
274
275
|
end
|
275
276
|
end
|
276
277
|
|
277
|
-
def
|
278
|
+
def sell_shop_orders_change_state (order_number, state, params={})
|
278
279
|
url = api_url "/sell/shop/orders/#{order_number}/change_state"
|
279
280
|
req = request_params({state: state}.merge(params))
|
280
281
|
|
281
|
-
|
282
|
+
feed_or_retry do
|
282
283
|
# POST with a hash sends parameters as a urlencoded form body
|
283
284
|
RestClient.post url, req
|
284
285
|
end
|
285
286
|
end
|
286
287
|
|
287
288
|
|
288
|
-
def
|
289
|
+
def sell_shop_orders_request_cancellation (order_number, reason_string, params={})
|
289
290
|
url = api_url "/sell/shop/orders/#{order_number}/request_cancellation"
|
290
291
|
req = request_params(params)
|
291
292
|
load = MultiJson.dump reason: reason_string
|
292
293
|
|
293
|
-
|
294
|
+
feed_or_retry do
|
294
295
|
# POST with raw payloads
|
295
296
|
RestClient.post url, load, req
|
296
297
|
end
|
@@ -303,7 +304,7 @@ module BlommingApi
|
|
303
304
|
url = api_url "/sell/shop/shipping_profiles"
|
304
305
|
req = request_params({locale: @locale}.merge(params))
|
305
306
|
|
306
|
-
|
307
|
+
feed_or_retry do
|
307
308
|
RestClient.get url, req
|
308
309
|
end
|
309
310
|
end
|
@@ -315,7 +316,7 @@ module BlommingApi
|
|
315
316
|
url = api_url "/sell/shop/user_details"
|
316
317
|
req = request_params({locale: @locale}.merge(params))
|
317
318
|
|
318
|
-
|
319
|
+
feed_or_retry do
|
319
320
|
RestClient.get url, req
|
320
321
|
end
|
321
322
|
end
|
data/lib/blomming_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blomming_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giorgio Robino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: method_source
|