giftery 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/giftery/client.rb +19 -1
- data/lib/giftery/version.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: 7681e0bcc949ceebc6205e458ddca045bd0d27623dd9375e4a4f9de85a4002f9
|
4
|
+
data.tar.gz: 6ff5050fe6b3b17d68ddb79b13bd1852a2fd271653ea6e637df7255b0e66aefb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7970ed5e5e2628d7072c1ac5cdced5c23727d5f0bad5949585c1686b5fb77006a199fc0ad765312985bdafb4d10bee313fefe029eee2edd4ba167527e5cba17b
|
7
|
+
data.tar.gz: 8d5eb8a92262853ddff108fc63d6776158f50d9ffa80d31fca3761dbfb54831c5ca8fb9b3bcbfd46cbd1c5a6035aff112f915be6358213741158b5390794bb99
|
data/lib/giftery/client.rb
CHANGED
@@ -11,7 +11,7 @@ module Giftery
|
|
11
11
|
OUTPUT_FORMAT = 'json'
|
12
12
|
|
13
13
|
# Giftery::Client class needs to be used
|
14
|
-
# for making requests to Giftery API
|
14
|
+
# for making requests to Giftery API https://docs.giftery.tech/b2b-api/
|
15
15
|
class Client
|
16
16
|
def initialize(client_id, secret)
|
17
17
|
@client_id = client_id
|
@@ -22,43 +22,61 @@ module Giftery
|
|
22
22
|
make_request('test')
|
23
23
|
end
|
24
24
|
|
25
|
+
# Creates order
|
26
|
+
# More info here: https://docs.giftery.tech/b2b-api/methods/makeOrder/
|
25
27
|
def make_order(product_id, face, options = {})
|
26
28
|
data = options.merge!(product_id: product_id, face: face)
|
27
29
|
make_request('makeOrder', data)
|
28
30
|
end
|
29
31
|
|
32
|
+
# Returns list of available products
|
33
|
+
# More info here: https://docs.giftery.tech/b2b-api/methods/getProducts/
|
30
34
|
def products
|
31
35
|
make_request('getProducts')
|
32
36
|
end
|
33
37
|
|
38
|
+
# Returns base64 encoded PDF certificate
|
39
|
+
# More info here: https://docs.giftery.tech/b2b-api/methods/getCertificate/
|
34
40
|
def certificate(queue_id)
|
35
41
|
make_request('getCertificate', queue_id: queue_id)
|
36
42
|
end
|
37
43
|
|
44
|
+
# Returns certificate requisites
|
45
|
+
# More info here: https://docs.giftery.tech/b2b-api/methods/getCode/
|
38
46
|
def code(queue_id, order_id)
|
39
47
|
make_request('getCode',
|
40
48
|
queue_id: queue_id,
|
41
49
|
order_id: order_id)
|
42
50
|
end
|
43
51
|
|
52
|
+
# Returns certificate links
|
53
|
+
# More info here: https://docs.giftery.tech/b2b-api/methods/getLinks/
|
44
54
|
def links(queue_id, order_id)
|
45
55
|
make_request('getLinks',
|
46
56
|
queue_id: queue_id,
|
47
57
|
order_id: order_id)
|
48
58
|
end
|
49
59
|
|
60
|
+
# Returns status of order that is created by make_order
|
61
|
+
# More info here: https://docs.giftery.tech/b2b-api/methods/getStatus/
|
50
62
|
def status(id)
|
51
63
|
make_request('getStatus', id: id)
|
52
64
|
end
|
53
65
|
|
66
|
+
# Returns list of available certificate categories
|
67
|
+
# More info here: https://docs.giftery.tech/b2b-api/methods/getCategories/
|
54
68
|
def categories
|
55
69
|
make_request('getCategories')
|
56
70
|
end
|
57
71
|
|
72
|
+
# Returns your available balance
|
73
|
+
# More info here: https://docs.giftery.tech/b2b-api/methods/getBalance/
|
58
74
|
def balance
|
59
75
|
make_request('getBalance')
|
60
76
|
end
|
61
77
|
|
78
|
+
# Returns list of places (with address) where certificate can be accepted
|
79
|
+
# More info here: https://docs.giftery.tech/b2b-api/methods/getAddress/
|
62
80
|
def address(product_id, area_name, locality_name)
|
63
81
|
make_request('getBalance',
|
64
82
|
product_id: product_id,
|
data/lib/giftery/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: giftery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boris Drazhzhov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|