shoptet 0.0.54 → 0.0.55
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/shoptet.rb +7 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3973988132bd7183d479a1e86cca5aea7ea6ac436390806c06bd1f62865f12f7
|
|
4
|
+
data.tar.gz: 897b12f9a8dae2f05f79369854ae04181980ebb854741b7802047634e5f0fbb0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c2016f22a74cab724d270950a0e7fac3005ad3e827321f5998c4c45c0c383cd7355b3ac11fca89e07fb9f56ea32c1a51171e55ba4b92b23f1b9610c3025d3cf
|
|
7
|
+
data.tar.gz: 5a5d57ddaac9532ce0585d9ef13242c328f26c5ae0ccaec74daaced9f52bf9881f3469681278e535eb0638a190de899fed203b9039b68427fb8a3643469e05cb
|
data/lib/shoptet.rb
CHANGED
|
@@ -29,7 +29,7 @@ class Shoptet
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def self.version
|
|
32
|
-
'0.0.
|
|
32
|
+
'0.0.55'
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def self.ar_on_token_error(model)
|
|
@@ -87,7 +87,7 @@ class Shoptet
|
|
|
87
87
|
@shop_url = shop_url
|
|
88
88
|
@client_id = client_id
|
|
89
89
|
@on_token_error = on_token_error || ON_TOKEN_ERROR
|
|
90
|
-
@api_token = api_token
|
|
90
|
+
@api_token = api_token
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
def endpoints api_params = {}
|
|
@@ -245,6 +245,7 @@ class Shoptet
|
|
|
245
245
|
end
|
|
246
246
|
|
|
247
247
|
def get(url, api_params = {}, retry_on_token_error = true)
|
|
248
|
+
@api_token ||= @on_token_error.call(self)
|
|
248
249
|
url = URI(url)
|
|
249
250
|
url.query = URI.encode_www_form(api_params) if api_params.any?
|
|
250
251
|
|
|
@@ -267,6 +268,7 @@ class Shoptet
|
|
|
267
268
|
end
|
|
268
269
|
|
|
269
270
|
def patch(url, data, retry_on_token_error = true)
|
|
271
|
+
@api_token ||= @on_token_error.call(self)
|
|
270
272
|
url = URI(url)
|
|
271
273
|
headers = { 'Shoptet-Access-Token' => @api_token,
|
|
272
274
|
'Content-Type' => 'application/vnd.shoptet.v1.0' }
|
|
@@ -286,6 +288,7 @@ class Shoptet
|
|
|
286
288
|
end
|
|
287
289
|
|
|
288
290
|
def post_json(url, data, retry_on_token_error = true)
|
|
291
|
+
@api_token ||= @on_token_error.call(self)
|
|
289
292
|
url = URI(url)
|
|
290
293
|
headers = { 'Shoptet-Access-Token' => @api_token,
|
|
291
294
|
'Content-Type' => 'application/vnd.shoptet.v1.0' }
|
|
@@ -305,6 +308,7 @@ class Shoptet
|
|
|
305
308
|
end
|
|
306
309
|
|
|
307
310
|
def post_binary(url, data, retry_on_token_error = true)
|
|
311
|
+
@api_token ||= @on_token_error.call(self)
|
|
308
312
|
url = URI(url)
|
|
309
313
|
headers = { 'Shoptet-Access-Token' => @api_token,
|
|
310
314
|
'Content-Type' => 'application/vnd.shoptet.v1.0' }
|
|
@@ -324,6 +328,7 @@ class Shoptet
|
|
|
324
328
|
end
|
|
325
329
|
|
|
326
330
|
def delete(url, retry_on_token_error = true)
|
|
331
|
+
@api_token ||= @on_token_error.call(self)
|
|
327
332
|
url = URI(url)
|
|
328
333
|
headers = { 'Shoptet-Access-Token' => @api_token,
|
|
329
334
|
'Content-Type' => 'application/vnd.shoptet.v1.0' }
|