gerencianet 1.0.2 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. metadata +32 -119
  3. data/.codeclimate.yml +0 -10
  4. data/.gitignore +0 -21
  5. data/.rubocop.yml +0 -18
  6. data/.travis.yml +0 -4
  7. data/CHANGELOG.md +0 -78
  8. data/Gemfile +0 -9
  9. data/Guardfile +0 -5
  10. data/LICENSE +0 -21
  11. data/README.md +0 -96
  12. data/Rakefile +0 -6
  13. data/bin/console +0 -14
  14. data/bin/setup +0 -7
  15. data/examples/.gitignore +0 -1
  16. data/examples/certs/developmentCertificate.pem +0 -0
  17. data/examples/certs/productionCertificate.pem +0 -0
  18. data/examples/credentials.rb +0 -7
  19. data/examples/default/carnet/cancel_carnet.rb +0 -15
  20. data/examples/default/carnet/cancel_parcel.rb +0 -16
  21. data/examples/default/carnet/create_carnet.rb +0 -32
  22. data/examples/default/carnet/create_carnet_history.rb +0 -19
  23. data/examples/default/carnet/detail_carnet.rb +0 -15
  24. data/examples/default/carnet/resend_carnet.rb +0 -19
  25. data/examples/default/carnet/resend_parcel.rb +0 -20
  26. data/examples/default/carnet/settle_carnet_parcel.rb +0 -16
  27. data/examples/default/carnet/update_carnet_metadata.rb +0 -20
  28. data/examples/default/carnet/update_parcel.rb +0 -20
  29. data/examples/default/charge/all_in_one.rb +0 -57
  30. data/examples/default/charge/cancel_charge.rb +0 -15
  31. data/examples/default/charge/charge_link.rb +0 -27
  32. data/examples/default/charge/create_billet_payment.rb +0 -33
  33. data/examples/default/charge/create_card_payment.rb +0 -39
  34. data/examples/default/charge/create_charge.rb +0 -24
  35. data/examples/default/charge/create_charge_balance_sheet.rb +0 -80
  36. data/examples/default/charge/create_charge_history.rb +0 -19
  37. data/examples/default/charge/create_charge_onestep.rb +0 -36
  38. data/examples/default/charge/create_charge_onestep_creditcard.rb +0 -45
  39. data/examples/default/charge/detail_charge.rb +0 -15
  40. data/examples/default/charge/resend_billet.rb +0 -19
  41. data/examples/default/charge/settle_charge.rb +0 -15
  42. data/examples/default/charge/update_billet.rb +0 -19
  43. data/examples/default/charge/update_charge_link.rb +0 -27
  44. data/examples/default/charge/update_charge_metadata.rb +0 -20
  45. data/examples/default/marketplace/create_charge_onestep_billet_marketplace.rb +0 -45
  46. data/examples/default/marketplace/create_charge_onestep_creditcard_marketplace.rb +0 -54
  47. data/examples/default/notification/get_notification.rb +0 -15
  48. data/examples/default/others/get_installments.rb +0 -16
  49. data/examples/default/subscriptions/cancel_subscription.rb +0 -15
  50. data/examples/default/subscriptions/create_plan.rb +0 -17
  51. data/examples/default/subscriptions/create_subscription.rb +0 -31
  52. data/examples/default/subscriptions/create_subscription_history.rb +0 -19
  53. data/examples/default/subscriptions/create_subscription_payment.rb +0 -38
  54. data/examples/default/subscriptions/delete_plan.rb +0 -15
  55. data/examples/default/subscriptions/detail_subscription.rb +0 -15
  56. data/examples/default/subscriptions/get_plans.rb +0 -17
  57. data/examples/default/subscriptions/update_plan.rb +0 -19
  58. data/examples/default/subscriptions/update_subscription_metadata.rb +0 -20
  59. data/examples/gn/account/pix_detail_balance.rb +0 -16
  60. data/examples/gn/account/pix_detail_settings.rb +0 -17
  61. data/examples/gn/account/pix_update_settings.rb +0 -33
  62. data/examples/gn/key/pix_create_evp.rb +0 -17
  63. data/examples/gn/key/pix_delete_evp.rb +0 -20
  64. data/examples/gn/key/pix_list_evp.rb +0 -16
  65. data/examples/pix/charge/pix_create_charge.rb +0 -35
  66. data/examples/pix/charge/pix_create_immediate_charge.rb +0 -31
  67. data/examples/pix/charge/pix_detail_charge.rb +0 -21
  68. data/examples/pix/charge/pix_list_charges.rb +0 -21
  69. data/examples/pix/charge/pix_update_charge.rb +0 -26
  70. data/examples/pix/location/pix_create_location.rb +0 -20
  71. data/examples/pix/location/pix_detail_location.rb +0 -20
  72. data/examples/pix/location/pix_generate_qrcode.rb +0 -26
  73. data/examples/pix/location/pix_list_location.rb +0 -21
  74. data/examples/pix/location/pix_unset_txid.rb +0 -21
  75. data/examples/pix/pix/pix_detail.rb +0 -20
  76. data/examples/pix/pix/pix_detail_devolution.rb +0 -22
  77. data/examples/pix/pix/pix_devolution.rb +0 -27
  78. data/examples/pix/pix/pix_list_received.rb +0 -21
  79. data/examples/pix/pix/pix_send.rb +0 -27
  80. data/examples/pix/webhooks/pix_config_webhook.rb +0 -28
  81. data/examples/pix/webhooks/pix_delete_webhook.rb +0 -22
  82. data/examples/pix/webhooks/pix_detail_webhook.rb +0 -21
  83. data/examples/pix/webhooks/pix_list_webhook.rb +0 -22
  84. data/gerencianet.gemspec +0 -37
  85. data/lib/gerencianet/constants.rb +0 -274
  86. data/lib/gerencianet/endpoints.rb +0 -196
  87. data/lib/gerencianet/status.rb +0 -7
  88. data/lib/gerencianet/version.rb +0 -4
  89. data/lib/gerencianet.rb +0 -9
@@ -1,26 +0,0 @@
1
- require "gerencianet"
2
- require_relative "../../credentials"
3
-
4
- require "uri"
5
- require "net/http"
6
- require "openssl"
7
-
8
- options = {
9
- client_id: CREDENTIALS::CLIENT_ID,
10
- client_secret: CREDENTIALS::CLIENT_SECRET,
11
- pix_cert: CREDENTIALS::PIX_CERT,
12
- sandbox: CREDENTIALS::SANDBOX
13
- }
14
-
15
- params = {
16
- id: " "
17
- }
18
-
19
- gerencianet = Gerencianet.new(options)
20
- response = gerencianet.pix_generate_qrcode(params: params)
21
- puts response['qrcode']
22
-
23
- data = response['imagemQrcode']
24
- image_data = Base64.decode64(data['data:image/png;base64,'.length .. -1])
25
- new_file=File.new("../../../qrCodeImage.png", 'wb') #salva a imagem do qrcode no diretório raiz
26
- new_file.write(image_data)
@@ -1,21 +0,0 @@
1
- require "gerencianet"
2
- require_relative "../../credentials"
3
-
4
- require "uri"
5
- require "net/http"
6
- require "openssl"
7
-
8
- options = {
9
- client_id: CREDENTIALS::CLIENT_ID,
10
- client_secret: CREDENTIALS::CLIENT_SECRET,
11
- pix_cert: CREDENTIALS::PIX_CERT,
12
- sandbox: CREDENTIALS::SANDBOX
13
- }
14
-
15
- params = {
16
- inicio: "2020-10-22T16:01:35Z",
17
- fim: "2021-04-23T16:01:35Z"
18
- }
19
-
20
- gerencianet = Gerencianet.new(options)
21
- puts gerencianet.pix_list_location(params: params)
@@ -1,21 +0,0 @@
1
- require "gerencianet"
2
- require_relative "../../credentials"
3
-
4
- require "uri"
5
- require "net/http"
6
- require "openssl"
7
-
8
- options = {
9
- client_id: CREDENTIALS::CLIENT_ID,
10
- client_secret: CREDENTIALS::CLIENT_SECRET,
11
- pix_cert: CREDENTIALS::PIX_CERT,
12
- sandbox: CREDENTIALS::SANDBOX
13
- }
14
-
15
- params = {
16
- id: " "
17
- }
18
-
19
- gerencianet = Gerencianet.new(options)
20
- puts gerencianet.pix_unset_txid(params: params)
21
-
@@ -1,20 +0,0 @@
1
- require "gerencianet"
2
- require_relative "../../credentials"
3
-
4
- require "uri"
5
- require "net/http"
6
- require "openssl"
7
-
8
- options = {
9
- client_id: CREDENTIALS::CLIENT_ID,
10
- client_secret: CREDENTIALS::CLIENT_SECRET,
11
- pix_cert: CREDENTIALS::PIX_CERT,
12
- sandbox: CREDENTIALS::SANDBOX
13
- }
14
-
15
- params = {
16
- e2eId: " "
17
- }
18
-
19
- gerencianet = Gerencianet.new(options)
20
- puts gerencianet.pix_detail(params: params)
@@ -1,22 +0,0 @@
1
- require "gerencianet"
2
- require_relative "../../credentials"
3
-
4
- require "uri"
5
- require "net/http"
6
- require "openssl"
7
-
8
- options = {
9
- client_id: CREDENTIALS::CLIENT_ID,
10
- client_secret: CREDENTIALS::CLIENT_SECRET,
11
- pix_cert: CREDENTIALS::PIX_CERT,
12
- sandbox: CREDENTIALS::SANDBOX
13
- }
14
-
15
- params = {
16
- e2eId: " ",
17
- id: " "
18
- }
19
-
20
- gerencianet = Gerencianet.new(options)
21
- puts gerencianet.pix_detail_devolution(params: params)
22
-
@@ -1,27 +0,0 @@
1
- require "gerencianet"
2
- require_relative "../../credentials"
3
-
4
- require "uri"
5
- require "net/http"
6
- require "openssl"
7
-
8
- options = {
9
- client_id: CREDENTIALS::CLIENT_ID,
10
- client_secret: CREDENTIALS::CLIENT_SECRET,
11
- pix_cert: CREDENTIALS::PIX_CERT,
12
- sandbox: CREDENTIALS::SANDBOX
13
- }
14
-
15
- params = {
16
- e2eId: " ",
17
- id: " "
18
- }
19
-
20
- body = {
21
- valor: "0.01"
22
- }
23
-
24
-
25
- gerencianet = Gerencianet.new(options)
26
- puts gerencianet.pix_devolution(params: params, body: body)
27
-
@@ -1,21 +0,0 @@
1
- require "gerencianet"
2
- require_relative "../../credentials"
3
-
4
- require "uri"
5
- require "net/http"
6
- require "openssl"
7
-
8
- options = {
9
- client_id: CREDENTIALS::CLIENT_ID,
10
- client_secret: CREDENTIALS::CLIENT_SECRET,
11
- pix_cert: CREDENTIALS::PIX_CERT,
12
- sandbox: CREDENTIALS::SANDBOX
13
- }
14
-
15
- params = {
16
- inicio: "2020-10-22T16:01:35Z",
17
- fim: "2021-04-23T16:01:35Z"
18
- }
19
-
20
- gerencianet = Gerencianet.new(options)
21
- puts gerencianet.pix_list_received(params: params)
@@ -1,27 +0,0 @@
1
- require "gerencianet"
2
- require_relative "../../credentials"
3
-
4
- require "uri"
5
- require "net/http"
6
- require "openssl"
7
-
8
- options = {
9
- client_id: CREDENTIALS::CLIENT_ID,
10
- client_secret: CREDENTIALS::CLIENT_SECRET,
11
- pix_cert: CREDENTIALS::PIX_CERT,
12
- sandbox: CREDENTIALS::SANDBOX
13
- }
14
-
15
- body = {
16
- valor: "0.01",
17
- pagador: {
18
- chave: "sua_chave"
19
- },
20
- favorecido: {
21
- chave: "chave_favorecido"
22
- }
23
- }
24
-
25
- gerencianet = Gerencianet.new(options)
26
- puts gerencianet.pix_send(body: body)
27
-
@@ -1,28 +0,0 @@
1
- require "gerencianet"
2
- require_relative "../../credentials"
3
-
4
- require "uri"
5
- require "net/http"
6
- require "openssl"
7
-
8
- #verificar o mtls
9
-
10
- options = {
11
- client_id: CREDENTIALS::CLIENT_ID,
12
- client_secret: CREDENTIALS::CLIENT_SECRET,
13
- pix_cert: CREDENTIALS::PIX_CERT,
14
- sandbox: CREDENTIALS::SANDBOX,
15
- "x-skip-mtls-checking": "true"
16
- }
17
-
18
-
19
- params = {
20
- chave: "sua_chave"
21
- }
22
-
23
- body = {
24
- webhookUrl: "https://exemplo-pix/webhook"
25
- }
26
-
27
- gerencianet = Gerencianet.new(options)
28
- puts gerencianet.pix_config_webhook(params: params, body: body)
@@ -1,22 +0,0 @@
1
- require "gerencianet"
2
- require_relative "../../credentials"
3
-
4
- require "uri"
5
- require "net/http"
6
- require "openssl"
7
-
8
-
9
- options = {
10
- client_id: CREDENTIALS::CLIENT_ID,
11
- client_secret: CREDENTIALS::CLIENT_SECRET,
12
- pix_cert: CREDENTIALS::PIX_CERT,
13
- sandbox: CREDENTIALS::SANDBOX
14
- }
15
-
16
- params = {
17
- chave: "sua_chave"
18
- }
19
-
20
- gerencianet = Gerencianet.new(options)
21
- puts gerencianet.pix_delete_webhook(params: params)
22
-
@@ -1,21 +0,0 @@
1
- require "gerencianet"
2
- require_relative "../../credentials"
3
-
4
- require "uri"
5
- require "net/http"
6
- require "openssl"
7
-
8
- options = {
9
- client_id: CREDENTIALS::CLIENT_ID,
10
- client_secret: CREDENTIALS::CLIENT_SECRET,
11
- pix_cert: CREDENTIALS::PIX_CERT,
12
- sandbox: CREDENTIALS::SANDBOX
13
- }
14
-
15
- params = {
16
- chave: "sua_chave"
17
- }
18
-
19
- gerencianet = Gerencianet.new(options)
20
- puts gerencianet.pix_detail_webhook(params: params)
21
-
@@ -1,22 +0,0 @@
1
- require "gerencianet"
2
- require_relative "../../credentials"
3
-
4
- require "uri"
5
- require "net/http"
6
- require "openssl"
7
-
8
- options = {
9
- client_id: CREDENTIALS::CLIENT_ID,
10
- client_secret: CREDENTIALS::CLIENT_SECRET,
11
- pix_cert: CREDENTIALS::PIX_CERT,
12
- sandbox: CREDENTIALS::SANDBOX
13
- }
14
-
15
- params = {
16
- inicio: "2020-10-22T16:01:35Z",
17
- fim: "2021-06-25T16:01:35Z"
18
- }
19
-
20
- gerencianet = Gerencianet.new(options)
21
- puts gerencianet.pix_list_webhook(params: params)
22
-
data/gerencianet.gemspec DELETED
@@ -1,37 +0,0 @@
1
- lib = File.expand_path("../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "gerencianet/version"
4
-
5
- files = `git ls-files -z`.split("\x0").reject do |f|
6
- f.match(%r{^(test|spec|features)/})
7
- end
8
-
9
- Gem::Specification.new do |spec|
10
- spec.name = "gerencianet"
11
- spec.version = Gerencianet::VERSION
12
- spec.authors = ["Francisco Carvalho"]
13
- spec.email = ["desenvolvedores@gerencianet.com.br"]
14
-
15
- spec.summary = "Gerencianet API Ruby Gem"
16
- spec.description = "A ruby gem for integration of your backend with the
17
- payment services provided by Gerencianet"
18
-
19
- spec.homepage = "http://gerencianet.github.io/gn-api-sdk-ruby"
20
- spec.license = "MIT"
21
-
22
- spec.files = files
23
-
24
- spec.bindir = "exe"
25
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
- spec.require_paths = ["lib"]
27
-
28
- spec.add_development_dependency "bundler", "~> 2.2.24", ">= 2.2.24"
29
- spec.add_development_dependency "rake", "~> 12.3.3", ">= 12.3.3"
30
- spec.add_development_dependency "rspec", "~> 3.10.0", ">= 3.10.0"
31
- spec.add_development_dependency "guard-rspec", "~> 4.6.4", ">= 4.6.4"
32
- spec.add_development_dependency "webmock", "~> 1.22.3", ">= 1.22.3"
33
- spec.add_development_dependency "rubocop", "~> 0.49.1", ">= 0.49.1"
34
- spec.add_development_dependency "listen", "~> 3.0.4", ">= 3.0.4"
35
-
36
- spec.add_runtime_dependency "http", "~> 0.9", ">= 0.9.8"
37
- end
@@ -1,274 +0,0 @@
1
- module Gerencianet
2
- # Endpoints signatures
3
- module Constants
4
- URL = {
5
- DEFAULT: {
6
- production: "https://api.gerencianet.com.br/v1",
7
- sandbox: "https://sandbox.gerencianet.com.br/v1"
8
- },
9
- PIX: {
10
- production: "https://api-pix.gerencianet.com.br",
11
- sandbox: "https://api-pix-h.gerencianet.com.br"
12
- }
13
- }
14
-
15
- ENDPOINTS = {
16
- DEFAULT: {
17
- authorize: {
18
- route: "/authorize",
19
- method: "post"
20
- },
21
- create_charge: {
22
- route: "/charge",
23
- method: "post"
24
- },
25
- detail_charge: {
26
- route: "/charge/:id",
27
- method: "get"
28
- },
29
- update_charge_metadata: {
30
- route: "/charge/:id/metadata",
31
- method: "put"
32
- },
33
- update_billet: {
34
- route: "/charge/:id/billet",
35
- method: "put"
36
- },
37
- pay_charge: {
38
- route: "/charge/:id/pay",
39
- method: "post"
40
- },
41
- cancel_charge: {
42
- route: "/charge/:id/cancel",
43
- method: "put"
44
- },
45
- create_carnet: {
46
- route: "/carnet",
47
- method: "post"
48
- },
49
- detail_carnet: {
50
- route: "/carnet/:id",
51
- method: "get"
52
- },
53
- update_parcel: {
54
- route: "/carnet/:id/parcel/:parcel",
55
- method: "put"
56
- },
57
- update_carnet_metadata: {
58
- route: "/carnet/:id/metadata",
59
- method: "put"
60
- },
61
- get_notification: {
62
- route: "/notification/:token",
63
- method: "get"
64
- },
65
- get_plans: {
66
- route: "/plans",
67
- method: "get"
68
- },
69
- create_plan: {
70
- route: "/plan",
71
- method: "post"
72
- },
73
- delete_plan: {
74
- route: "/plan/:id",
75
- method: "delete"
76
- },
77
- create_subscription: {
78
- route: "/plan/:id/subscription",
79
- method: "post"
80
- },
81
- detail_subscription: {
82
- route: "/subscription/:id",
83
- method: "get"
84
- },
85
- pay_subscription: {
86
- route: "/subscription/:id/pay",
87
- method: "post"
88
- },
89
- cancel_subscription: {
90
- route: "/subscription/:id/cancel",
91
- method: "put"
92
- },
93
- update_subscription_metadata: {
94
- route: "/subscription/:id/metadata",
95
- method: "put"
96
- },
97
- get_installments: {
98
- route: "/installments",
99
- method: "get"
100
- },
101
- resend_billet: {
102
- route: "/charge/:id/billet/resend",
103
- method: "post"
104
- },
105
- create_charge_history: {
106
- route: "/charge/:id/history",
107
- method: "post"
108
- },
109
- resend_carnet: {
110
- route: "/carnet/:id/resend",
111
- method: "post"
112
- },
113
- resend_parcel: {
114
- route: "/carnet/:id/parcel/:parcel/resend",
115
- method: "post"
116
- },
117
- create_carnet_history: {
118
- route: "/carnet/:id/history",
119
- method: "post"
120
- },
121
- cancel_carnet: {
122
- route: "/carnet/:id/cancel",
123
- method: "put"
124
- },
125
- cancel_parcel: {
126
- route: "/carnet/:id/parcel/:parcel/cancel",
127
- method: "put"
128
- },
129
- link_charge: {
130
- route: "/charge/:id/link",
131
- method: "post"
132
- },
133
- charge_link: {
134
- route: "/charge/:id/link",
135
- method: "post"
136
- },
137
- update_charge_link: {
138
- route: "/charge/:id/link",
139
- method: "put"
140
- },
141
- update_plan: {
142
- route: "/plan/:id",
143
- method: "put"
144
- },
145
- create_subscription_history: {
146
- route: "/subscription/:id/history",
147
- method: "post"
148
- },
149
- create_charge_balance_sheet: {
150
- route: "/charge/:id/balance-sheet",
151
- method: "post"
152
- },
153
- create_charge_onestep: {
154
- route: "/charge/one-step",
155
- method: "post"
156
- },
157
- settle_charge: {
158
- route: "/charge/:id/settle",
159
- method: "put"
160
- },
161
- settle_carnet_parcel: {
162
- route: "/carnet/:id/parcel/:parcel/settle",
163
- method: "put"
164
- }
165
- },
166
- PIX: {
167
- authorize: {
168
- route: "/oauth/token",
169
- method: "post"
170
- },
171
- pix_config_webhook: {
172
- route: "/v2/webhook/:chave",
173
- method: "put"
174
- },
175
- pix_detail_webhook: {
176
- route: "/v2/webhook/:chave",
177
- method: "get"
178
- },
179
- pix_list_webhook: {
180
- route: "/v2/webhook",
181
- method: "get"
182
- },
183
- pix_delete_webhook: {
184
- route: "/v2/webhook/:chave",
185
- method: "delete"
186
- },
187
- pix_create_charge: {
188
- route: "/v2/cob/:txid",
189
- method: "put"
190
- },
191
- pix_create_immediate_charge: {
192
- route: "/v2/cob",
193
- method: "post"
194
- },
195
- pix_detail_charge: {
196
- route: "/v2/cob/:txid",
197
- method: "get"
198
- },
199
- pix_update_charge: {
200
- route: "/v2/cob/:txid",
201
- method: "patch"
202
- },
203
- pix_list_charges: {
204
- route: "/v2/cob",
205
- method: "get"
206
- },
207
- pix_generate_qrcode: {
208
- route: "/v2/loc/:id/qrcode",
209
- method: "get"
210
- },
211
- pix_devolution: {
212
- route: "/v2/pix/:e2eId/devolucao/:id",
213
- method: "put"
214
- },
215
- pix_detail_devolution: {
216
- route: "/v2/pix/:e2eId/devolucao/:id",
217
- method: "get"
218
- },
219
- pix_send: {
220
- route: "/v2/pix",
221
- method: "post"
222
- },
223
- pix_detail: {
224
- route: "/v2/pix/:e2eId",
225
- method: "get"
226
- },
227
- pix_list_received: {
228
- route: "/v2/pix",
229
- method: "get"
230
- },
231
- pix_create_location: {
232
- route: "/v2/loc",
233
- method: "post"
234
- },
235
- pix_list_location: {
236
- route: "/v2/loc",
237
- method: "get"
238
- },
239
- pix_detail_location: {
240
- route: "/v2/loc/:id",
241
- method: "get"
242
- },
243
- pix_unset_txid: {
244
- route: "/v2/loc/:id/txid",
245
- method: "delete"
246
- },
247
- pix_create_evp: {
248
- route: "/v2/gn/evp",
249
- method: "post"
250
- },
251
- pix_list_evp: {
252
- route: "/v2/gn/evp",
253
- method: "get"
254
- },
255
- pix_delete_evp: {
256
- route: "/v2/gn/evp/:chave",
257
- method: "delete"
258
- },
259
- pix_detail_balance: {
260
- route: "/v2/gn/saldo",
261
- method: "get"
262
- },
263
- pix_update_settings: {
264
- route: "/v2/gn/config",
265
- method: "put"
266
- },
267
- pix_detail_settings: {
268
- route: "/v2/gn/config",
269
- method: "get"
270
- }
271
- }
272
- }
273
- end
274
- end