blomming_api 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef281dfa6f26763582a9689b0538f068517e4ba0
4
- data.tar.gz: 522da850bc418c5f24f5047f3ae037adb22cda4b
3
+ metadata.gz: 9ffd881cfdd0c8498bd0392a6b5c0e8922219f9c
4
+ data.tar.gz: 0036add36a945f228b8b0bc67eb6aab79af3ac44
5
5
  SHA512:
6
- metadata.gz: ff0ad8e69dd1181907b9508f6554a1f10143b82c2b602fa25e69685d24ac9d99a949e51a490a32511bf033f3aa6b36537ad723a6493a8f38856947c347f1a37d
7
- data.tar.gz: 59b9c907352eeae6a1021eeef33714a440652294cbe424ccf175deb5dca3ea1dc2ad32c1568da5737ac4d46fcb1039a0a627b9dab7ffc3693f82247ba8855363
6
+ metadata.gz: c206d43a3fb1dbdf5d47aa426e80c2b74179675cab503668fa02bfe48e40c169ee9fc7f7161136e125552bb02f0bdd819fa0a2681dc7549d1524d1a7085bcf79
7
+ data.tar.gz: f004dc99860ce60a36b2be52406ba8172e38695188a3d0727a61ed13257a034712c466c3d4967e725d939479a2b0004423d33908806704c80e2eb65d95bb5131
@@ -13,6 +13,8 @@ module BlommingApi
13
13
  # Create a new Cart on the server, as present in the home page of the web site.
14
14
  # It also redirects to the Cart URL.
15
15
  #
16
+ # :sku_id => SKU identifier (numeric)
17
+ #
16
18
  def carts_create(sku_id, params={})
17
19
  url = api_url "/carts"
18
20
  req = request_params({currency: @currency}.merge(params))
@@ -28,6 +30,8 @@ module BlommingApi
28
30
  #
29
31
  # Returns the Cart with the given ID, as returned from the create cart API.
30
32
  #
33
+ # :cart_id => Cart Identifier (numeric)
34
+ #
31
35
  def carts_find(cart_id, params={})
32
36
  url = api_url "/carts/#{cart_id}"
33
37
  req = request_params({currency: @currency, locale: @locale}.merge(params))
@@ -40,6 +44,13 @@ module BlommingApi
40
44
  #
41
45
  # Add multiple SKUs to the Cart.
42
46
  #
47
+ # params:
48
+ # :*skus => SKU list
49
+ # :cart_id => Cart Identifier (numeric)
50
+ #
51
+ # example:
52
+ # data = blomming.carts_add(608394, 608390, cart_id, {})
53
+ #
43
54
  def carts_add(*skus, cart_id, params)
44
55
  url = api_url "/carts/#{cart_id}/add"
45
56
  req = request_params({currency: @currency, locale: @locale}.merge(params))
@@ -55,6 +66,14 @@ module BlommingApi
55
66
  #
56
67
  # Remove multiple SKUs from the Cart.
57
68
  #
69
+ # params:
70
+ # :*skus => SKU list
71
+ # :cart_id => Cart Identifier (numeric)
72
+ #
73
+ # example:
74
+ # data = blomming.carts_remove(608394, 608390, cart_id, {})
75
+ #
76
+ #
58
77
  def carts_remove(*skus, cart_id, params)
59
78
  url = api_url "/carts/#{cart_id}/remove"
60
79
  req = request_params({currency: @currency, locale: @locale}.merge(params))
@@ -70,6 +89,9 @@ module BlommingApi
70
89
  #
71
90
  # Remove all SKUs from the Cart.
72
91
  #
92
+ # params:
93
+ # :cart_id => Cart Identifier (numeric)
94
+ #
73
95
  def carts_clear(cart_id, params={})
74
96
  url = api_url "/carts/#{cart_id}/clear"
75
97
  req = request_params({currency: @currency, locale: @locale}.merge(params))
@@ -83,6 +105,9 @@ module BlommingApi
83
105
  #
84
106
  # Returns countries to which this Cart can be shipped to.
85
107
  #
108
+ # params:
109
+ # :cart_id => Cart Identifier (numeric)
110
+ #
86
111
  def carts_shipping_countries(cart_id, params={})
87
112
  url = api_url "/carts/#{cart_id}/shipping_countries"
88
113
  req = request_params({currency: @currency, locale: @locale}.merge(params))
@@ -93,7 +118,11 @@ module BlommingApi
93
118
  end
94
119
 
95
120
  #
96
- # order_example = {
121
+ # Returns the Cart with the given ID, as returned from the create cart API.
122
+ #
123
+ # example:
124
+ #
125
+ # order = {
97
126
  # ship_to_first_name: "Andrea",
98
127
  # ship_to_last_name: "Salicetti",
99
128
  # ship_to_address: "via%20Teodosio%2065",
@@ -113,10 +142,8 @@ module BlommingApi
113
142
  # bill_to_vat_number: "IT07199240966",
114
143
  # phone_number3: ""
115
144
  # }
116
- #
117
-
118
- #
119
- # Returns the Cart with the given ID, as returned from the create cart API.
145
+ #
146
+ # data = blomming.carts_validate_order(608394, order, "MOO", {})
120
147
  #
121
148
  def carts_validate_order(cart_id, order, payment_type, params={})
122
149
  url = api_url "/carts/#{cart_id}/validate/#{payment_type}"
@@ -129,6 +156,31 @@ module BlommingApi
129
156
 
130
157
  #
131
158
  # Checkout of the Cart.
159
+ #
160
+ # example:
161
+ #
162
+ # order = {
163
+ # ship_to_first_name: "Andrea",
164
+ # ship_to_last_name: "Salicetti",
165
+ # ship_to_address: "via%20Teodosio%2065",
166
+ # ship_to_postal_code: 20100,
167
+ # ship_to_city: "Milano",
168
+ # ship_to_province: "MI",
169
+ # ship_to_country: "Italy",
170
+ # bill_is_ship: "false",
171
+ # bill_to_first_name: "Nicola%20Junior",
172
+ # bill_to_last_name: "Vitto",
173
+ # bill_to_address: "via%20Teodosio%2065",
174
+ # bill_to_postal_code: "20100",
175
+ # bill_to_city: "Milano",
176
+ # bill_to_province: "MI",
177
+ # bill_to_country: "Italy",
178
+ # bill_to_company: "Blomming%20SpA",
179
+ # bill_to_vat_number: "IT07199240966",
180
+ # phone_number3: ""
181
+ # }
182
+ #
183
+ # data = blomming.carts_checkout_order(608394, order, "MOO", {})
132
184
  #
133
185
  def carts_checkout_order(cart_id, order, payment_type, params={})
134
186
  url = api_url "/carts/#{cart_id}/checkout/#{payment_type}"
@@ -167,7 +219,7 @@ module BlommingApi
167
219
  # Returns the categories
168
220
  #
169
221
  def categories(params={})
170
- url = api_url '/categories'
222
+ url = api_url "/categories"
171
223
  req = request_params({currency: @currency, locale: @locale}.merge(params))
172
224
 
173
225
  feed_or_retry do
@@ -196,7 +248,7 @@ module BlommingApi
196
248
  # Returns the collections
197
249
  #
198
250
  def collections(params={})
199
- url = api_url '/collections'
251
+ url = api_url "/collections"
200
252
  req = request_params({currency: @currency, locale: @locale}.merge(params))
201
253
 
202
254
  feed_or_retry do
@@ -225,7 +277,7 @@ module BlommingApi
225
277
  # Get the full list of the possible Countries, localized.
226
278
  #
227
279
  def countries(params={})
228
- url = api_url '/countries'
280
+ url = api_url "/countries"
229
281
  req = request_params({locale: @locale}.merge(params))
230
282
 
231
283
  feed_or_retry do
@@ -242,7 +294,7 @@ module BlommingApi
242
294
  # Returns currencies accepted by Blomming
243
295
  #
244
296
  def currencies(params={})
245
- url = api_url '/currencies'
297
+ url = api_url "/currencies"
246
298
  req = request_params({locale: @locale}.merge(params))
247
299
 
248
300
  feed_or_retry do
@@ -259,7 +311,7 @@ module BlommingApi
259
311
  # Returns the “discounted” Items, as present in the home page of the web site
260
312
  #
261
313
  def items_discounted(params={})
262
- url = api_url '/items/discounted'
314
+ url = api_url "/items/discounted"
263
315
  req = request_params({currency: @currency, locale: @locale}.merge(params))
264
316
 
265
317
  feed_or_retry do
@@ -271,7 +323,7 @@ module BlommingApi
271
323
  # Returns the “featured” Items, as present in the home page of the web site.
272
324
  #
273
325
  def items_featured(params={})
274
- url = api_url '/items/featured'
326
+ url = api_url "/items/featured"
275
327
  req = request_params({currency: @currency, locale: @locale}.merge(params))
276
328
 
277
329
  feed_or_retry do
@@ -283,7 +335,7 @@ module BlommingApi
283
335
  # Returns the “hand picked” Items, as present in the home page of the web site.
284
336
  #
285
337
  def items_hand_picked(params={})
286
- url = api_url '/items/hand_picked'
338
+ url = api_url "/items/hand_picked"
287
339
  req = request_params({currency: @currency, locale: @locale}.merge(params))
288
340
 
289
341
  feed_or_retry do
@@ -295,7 +347,7 @@ module BlommingApi
295
347
  # Returns the Items with the specified ids.
296
348
  #
297
349
  def items_list (item_id, params={})
298
- url = api_url '/items/list'
350
+ url = api_url "/items/list"
299
351
  req = request_params({id: item_id, currency: @currency, locale: @locale}.merge(params))
300
352
 
301
353
  feed_or_retry do
@@ -307,7 +359,7 @@ module BlommingApi
307
359
  # Returns the “most_liked” Items, as present in the home page of the web site.
308
360
  #
309
361
  def items_most_liked(params={})
310
- url = api_url '/items/most_liked'
362
+ url = api_url "/items/most_liked"
311
363
  req = request_params({currency: @currency, locale: @locale}.merge(params))
312
364
 
313
365
  feed_or_retry do
@@ -319,7 +371,7 @@ module BlommingApi
319
371
  # Search Blomming for items that respond to a query.
320
372
  #
321
373
  def items_search (keyword, params={})
322
- url = api_url '/items/search'
374
+ url = api_url "/items/search"
323
375
  req = request_params({q: keyword, currency: @currency, locale: @locale}.merge(params))
324
376
 
325
377
  feed_or_retry do
@@ -336,7 +388,7 @@ module BlommingApi
336
388
  # Returns the Macrocategories
337
389
  #
338
390
  def macrocategories(params={})
339
- url = api_url '/macrocategories'
391
+ url = api_url "/macrocategories"
340
392
  req = request_params({locale: @locale}.merge(params))
341
393
 
342
394
  feed_or_retry do
@@ -348,7 +400,7 @@ module BlommingApi
348
400
  # Returns the Categories included in the given Macrocategory.
349
401
  #
350
402
  def macrocategory_categories (macrocategory_id​, params={})
351
- url = api_url "/macrocategories​/:macrocategory_id​/categories"
403
+ url = api_url "/macrocategories​/#{macrocategory_id}​/categories"
352
404
  req = request_params({locale: @locale}.merge(params))
353
405
 
354
406
  feed_or_retry do
@@ -360,7 +412,7 @@ module BlommingApi
360
412
  # Returns the Items inside a Macrocategory.
361
413
  #
362
414
  def macrocategory_items (macrocategory_id​, params={})
363
- url = api_url "/macrocategories​/:macrocategory_id​/items"
415
+ url = api_url "/macrocategories​/#{macrocategory_id}/items"
364
416
  req = request_params({locale: @locale}.merge(params))
365
417
 
366
418
  feed_or_retry do
@@ -414,7 +466,7 @@ module BlommingApi
414
466
  # Returns the Shops list
415
467
  #
416
468
  def shops (params={})
417
- url = api_url '/shops'
469
+ url = api_url "/shops"
418
470
 
419
471
  feed_or_retry do
420
472
  RestClient.get url, request_params(params)
@@ -5,7 +5,9 @@ module BlommingApi
5
5
  AUTHORS = ["Giorgio Robino"]
6
6
  EMAILS = ["giorgio.robino@gmail.com"]
7
7
  SUMMARY = %q{www.blomming.com social commerce API's wrapper}
8
- DESCRIPTION = %q{www.blomming.com social commerce API's wrapper: supply a client access layer that embed authentication and communication details, supply API endpoints wrappers.}
8
+ DESCRIPTION = %q{www.blomming.com social commerce API's wrapper. \
9
+ Supply a client access layer embedding authentication and communication details, \
10
+ simple API endpoints.}
9
11
  HOMEPAGE = "https://github.com/solyaris/blomming_api"
10
12
 
11
13
  def BlommingApi::about
@@ -115,9 +115,20 @@ module BlommingApi
115
115
  #
116
116
  # Create a new Shipping Profile
117
117
  #
118
- def sell_shipping_profile_create (payload, params={})
118
+ # example:
119
+ #
120
+ # shipping_profile =
121
+ # { "name":"National shipping",
122
+ # "origin_country_code":"IT",
123
+ # "everywhere_else_cost_single":10,
124
+ # "everywhere_else_cost_shared":5
125
+ # }
126
+ #
127
+ # blomming.sell_shipping_profile_create shipping_profile
128
+ #
129
+ def sell_shipping_profile_create (shipping_profile, params={})
119
130
  url = api_url "/sell/shipping_profiles"
120
- load = MultiJson.dump payload
131
+ load = MultiJson.dump shipping_profile
121
132
  req = request_params(params)
122
133
 
123
134
  feed_or_retry do
@@ -128,9 +139,9 @@ module BlommingApi
128
139
  #
129
140
  # Edit a Shipping Profile
130
141
  #
131
- def sell_shipping_profile_update (id, payload, params={})
142
+ def sell_shipping_profile_update (id, shipping_profile, params={})
132
143
  url = api_url "/sell/shipping_profiles/#{id}"
133
- load = MultiJson.dump payload
144
+ load = MultiJson.dump shipping_profile
134
145
  req = request_params(params)
135
146
 
136
147
  feed_or_retry do
@@ -222,7 +233,7 @@ module BlommingApi
222
233
  # (pubished or not) present on a given shop.
223
234
  #
224
235
  def sell_shop_items (params={})
225
- url = api_url '/sell/shop/items'
236
+ url = api_url "/sell/shop/items"
226
237
  req = request_params(params)
227
238
 
228
239
  feed_or_retry do
@@ -234,7 +245,7 @@ module BlommingApi
234
245
  # Create a new shop item
235
246
  #
236
247
  def sell_shop_item_create (payload, params={})
237
- url = api_url '/sell/shop/items/new'
248
+ url = api_url "/sell/shop/items/new"
238
249
  load = MultiJson.dump payload
239
250
  req = request_params(params)
240
251
 
@@ -1,3 +1,3 @@
1
1
  module BlommingApi
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
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.5.0
4
+ version: 0.5.1
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-15 00:00:00.000000000 Z
11
+ date: 2014-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: method_source
@@ -94,9 +94,9 @@ dependencies:
94
94
  - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description: 'www.blomming.com social commerce API''s wrapper: supply a client access
98
- layer that embed authentication and communication details, supply API endpoints
99
- wrappers.'
97
+ description: "www.blomming.com social commerce API's wrapper. \\\n Supply a client
98
+ access layer embedding authentication and communication details, \\ \n simple API
99
+ endpoints."
100
100
  email:
101
101
  - giorgio.robino@gmail.com
102
102
  executables: