wire4_auth 1.0.5 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5db70a9c65d3027119cba7948f9995deeb2911f6ced3237c01337902f3533eb
4
- data.tar.gz: e34b2ac873f1ee9ef1651cdbc970a32ae39ac64c882018dc3f06e615b5111fe8
3
+ metadata.gz: c09fada6f331355a7e383a58f25715e280caf45797f200e36ca2bcd42c881a89
4
+ data.tar.gz: a8d38663f14122d13ff6f485e6b407e4fe2dda0a75948459caaf9ccc140ad8ce
5
5
  SHA512:
6
- metadata.gz: b125d3834cffd9f98b232f1bf2625e8458939cdf8defa7a9b3a2a5905c473b45c7dde4d556059e7208f8c994a319f47998e47ecbfa405816a362563e276794c3
7
- data.tar.gz: 795cd67e5326cccf36aac67bb9e5f1418c9d0e5b7849c3990839501ad75ec2498472f358617d1f252214db3694975231df9c0f07d735bd0cef413757fee7c35d
6
+ metadata.gz: f400b6a6505fb87c28df741d4daa01208c0bea583dd4d1b7fc9316cdc2bdb268db5fa7a4030ed92055c2fa4235e00d3eb3ba4647116f95f600ee64e2c34f3195
7
+ data.tar.gz: 650ae52a164020c83aba6178aa53e4e8254b4e656f80839a8017b68e91f6188eba19f52ed5e6cb509a7805525b392a3da07034ea6bc8b620e79aa8c873694a0a
data/Gemfile CHANGED
@@ -4,5 +4,5 @@ gemspec
4
4
 
5
5
  group :development, :test do
6
6
  gem 'oauth2', '~> 1.4.3'
7
- gem 'wire4_client', '~> 1.0.5'
7
+ gem 'wire4_client', '~> 1.1.0'
8
8
  end
@@ -15,5 +15,5 @@ version: 1.0
15
15
  =end
16
16
 
17
17
  module Wire4Auth
18
- VERSION = '1.0.5'
18
+ VERSION = '1.1.0'
19
19
  end
data/wire4_auth.gemspec CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  Fecha de creación: 11 de diciembre, 2019
15
15
  author: Saintiago García
16
- version: 1.0
16
+ version: 1.1.0
17
17
  =end
18
18
 
19
19
  $:.push File.expand_path("../lib", __FILE__)
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  s.required_ruby_version = ">= 1.9"
33
33
 
34
34
  s.add_runtime_dependency 'oauth2', '~> 1.4', '>= 1.4.3'
35
- s.add_runtime_dependency 'wire4_client', '~> 1.0', '>= 1.0.5'
35
+ s.add_runtime_dependency 'wire4_client', '~> 1.0', '>= 1.1.0'
36
36
 
37
37
  s.add_development_dependency 'test-unit', '~> 3.3', '>= 3.3.5'
38
38
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wire4_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wire4
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-23 00:00:00.000000000 Z
11
+ date: 2021-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '1.0'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 1.0.5
42
+ version: 1.1.0
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: '1.0'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 1.0.5
52
+ version: 1.1.0
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: test-unit
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -82,7 +82,6 @@ files:
82
82
  - lib/wire4_auth/auth/oauth_wire4.rb
83
83
  - lib/wire4_auth/core/cached_token.rb
84
84
  - lib/wire4_auth/core/environment_enum.rb
85
- - lib/wire4_auth/testing.rb
86
85
  - lib/wire4_auth/tokens_test.rb
87
86
  - lib/wire4_auth/version.rb
88
87
  - lib/wire4_auth/webhook_verification_signature/utils_compute.rb
@@ -106,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
105
  - !ruby/object:Gem::Version
107
106
  version: '0'
108
107
  requirements: []
109
- rubygems_version: 3.0.6
108
+ rubygems_version: 3.0.3
110
109
  signing_key:
111
110
  specification_version: 4
112
111
  summary: Wire4Auth Ruby Gem
@@ -1,1649 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # -*- encoding: utf-8 -*-
3
-
4
- # COPYRIGHT © 2017. TCPIP.
5
- # PATENT PENDING. ALL RIGHTS RESERVED.
6
- # SPEI GATEWAY IS REGISTERED TRADEMARKS OF TCPIP.
7
- #
8
- # This software is confidential and proprietary information of TCPIP.
9
- # You shall not disclose such Confidential Information and shall use it only
10
- # in accordance with the company policy.
11
-
12
- =begin
13
- #Wire4Auth
14
-
15
- Fecha de creación: 11 de diciembre, 2019
16
- author: Saintiago García
17
- version: 1.0
18
- =end
19
-
20
- require 'test/unit'
21
- require 'wire4_auth/auth/oauth_wire4'
22
- require 'wire4_auth/webhook_verification_signature/utils_compute'
23
- require 'wire4_client'
24
-
25
- #noinspection RubyTooManyMethodsInspection
26
- class Wire4ExamplesTest < Test::Unit::TestCase
27
-
28
- CLIENT_ID = "FxUWmqYGZuv8O1qjxstvIyJothMa"
29
-
30
- CLIENT_SECRET = "kjwbkrPVgXsnaUGzthj55dsFhx4a"
31
-
32
- USER_KEY = "071e2b59b354186b3a0158de493536@sandbox.wire4.mx"
33
-
34
- SECRET_KEY = "0d1e33e94604f01b4e00d2fcb6b48f"
35
-
36
- SUBSCRIPTION = "f1504fea-3a8f-475a-a50a-90d3c40efc59"
37
-
38
- def test_send_contact
39
- omit('Reason')
40
- # Create the authenticator to obtain access token
41
- # The token URL and Service URL are defined for this environment enum value.
42
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
43
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
44
-
45
- begin
46
- # Obtain an access token use application flow and scope "general" and add to request
47
- oauth_wire4.config_default_api_client
48
- authorization = oauth_wire4.obtain_access_token_app('general')
49
- rescue Wire4Client::ApiError => e
50
- puts "Exception to obtain access token #{e.response_body}"
51
- # Optional manage exception in access token flow
52
- return
53
- end
54
-
55
- # create an instance of the API class
56
- api_instance = Wire4Client::ContactoApi.new
57
-
58
- # build body with info (check references for more info: types, required fields, etc.)
59
- body = Wire4Client::ContactRequest.new
60
- body.address = "Calle Falsa 123, Col Fantasía"
61
- body.company = "Compu Mundo Hiper Mega Red"
62
- body.contact_person = "Homer J Simpson"
63
- body.email = "homer.simpson@compumundohipermegared.com"
64
- body.phone_number = "4422102030"
65
-
66
- begin
67
- # Call the API
68
- response = api_instance.send_contact_using_post_with_http_info(authorization, body)
69
- p response
70
- rescue Wire4Client::ApiError => e
71
- puts "Exception to obtain access token #{e.response_body}"
72
- # Optional manage exception in access token flow
73
- return
74
- end
75
- end
76
-
77
- def test_obtain_cep
78
- omit('Reason')
79
- # Create the authenticator to obtain access token
80
- # The token URL and Service URL are defined for this environment enum value.
81
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
82
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
83
-
84
- begin
85
- # Obtain an access token use application flow and scope "general" and add to request
86
- oauth_wire4.config_default_api_client
87
- authorization = oauth_wire4.obtain_access_token_app('general')
88
- rescue Wire4Client::ApiError => e
89
- puts "Exception to obtain access token #{e.response_body}"
90
- # Optional manage exception in access token flow
91
- return
92
- end
93
-
94
- # create an instance of the API class
95
- api_instance = Wire4Client::ComprobanteElectrnicoDePagoCEPApi.new
96
-
97
- # build body with info (check references for more info: types, required fields, etc.)
98
- cep_data = Wire4Client::CepSearchBanxico.new # CepSearchBanxico | Información para buscar un CEP
99
- cep_data.amount = 8963.25
100
- cep_data.beneficiary_account = '072680004657656853'
101
- cep_data.beneficiary_bank_key = '40072'
102
- cep_data.clave_rastreo = '58735618'
103
- cep_data.operation_date = '05-12-2018'
104
- cep_data.reference = '1122334'
105
- cep_data.sender_account = '112680000156896531'
106
- cep_data.sender_bank_key = '40112'
107
-
108
- begin
109
- # Call the API
110
- response = api_instance.obtain_transaction_cep_using_post(authorization, cep_data)
111
- p response
112
- rescue Wire4Client::ApiError => e
113
- puts "Exception when calling the API: #{e.response_body}"
114
- # Optional manage exception in call API
115
- return
116
- end
117
- end
118
-
119
- def test_make_pre_subscription
120
- omit('Reason')
121
- # Create the authenticator to obtain access token
122
- # The token URL and Service URL are defined for this environment enum value.
123
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
124
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
125
-
126
- begin
127
- # Obtain an access token use application flow and scope "general" and add to request
128
- oauth_wire4.config_default_api_client
129
- authorization = oauth_wire4.obtain_access_token_app('general')
130
- rescue Wire4Client::ApiError => e
131
- puts "Exception to obtain access token #{e.response_body}"
132
- # Optional manage exception in access token flow
133
- return
134
- end
135
-
136
- # create an instance of the API class
137
- api_instance = Wire4Client::SuscripcionesApi.new
138
-
139
- # build body with info (check references for more info: types, required fields, etc.)
140
- body = Wire4Client::PreEnrollmentData.new
141
- body.cancel_return_url = "https://your-app-url.mx/return"
142
- body.return_url = "https://your-app-url.mx/cancel"
143
-
144
- begin
145
- # Call the API
146
- response = api_instance.pre_enrollment_monex_user_using_post(authorization, body)
147
- p response
148
- rescue Wire4Client::ApiError => e
149
- puts "Exception when calling the API: #{e.response_body}"
150
- # Optional manage exception in call API
151
- return
152
- end
153
- end
154
-
155
- def test_delete_pre_subscription
156
- omit('Reason')
157
- # Create the authenticator to obtain access token
158
- # The token URL and Service URL are defined for this environment enum value.
159
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
160
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
161
-
162
- begin
163
- # Obtain an access token use application flow and scope "general" and add to request
164
- oauth_wire4.config_default_api_client
165
- authorization = oauth_wire4.obtain_access_token_app('general')
166
- rescue Wire4Client::ApiError => e
167
- puts "Exception to obtain access token #{e.response_body}"
168
- # Optional manage exception in access token flow
169
- return
170
- end
171
-
172
- # create an instance of the API class
173
- api_instance = Wire4Client::SuscripcionesApi.new
174
-
175
- # build body with info (check references for more info, types, required fields)
176
- subscription = "55af515a-43ec-4537-96a4-489d1deef127"
177
-
178
- begin
179
- # Call the API
180
- response = api_instance.remove_subscription_pending_status_using_delete_with_http_info(authorization, subscription)
181
- p response
182
- rescue Wire4Client::ApiError => e
183
- puts "Exception when calling the API: #{e.response_body}"
184
- # Optional manage exception in call API
185
- return
186
- end
187
- end
188
-
189
- #noinspection RubyLocalVariableNamingConvention
190
- def test_delete_subscription
191
- omit('Reason')
192
- subscription_to_remove_user_key = "e7446202e95421dbb3c1b914e15c74@sandbox.wire4.mx"
193
- subscription_to_remove_user_secret = "8617fa525ca4140b545b66c5adcbb1"
194
-
195
- # Create the authenticator to obtain access token
196
- # The token URL and Service URL are defined for this environment enum value.
197
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
198
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
199
-
200
- begin
201
- # Obtain an access token use application flow and scope "spei_admin" and add to request
202
- oauth_wire4.config_default_api_client
203
- authorization = oauth_wire4.obtain_access_token_app_user(subscription_to_remove_user_key,
204
- subscription_to_remove_user_secret, 'spei_admin')
205
- rescue Wire4Client::ApiError => e
206
- puts "Exception to obtain access token #{e.response_body}"
207
- # Optional manage exception in access token flow
208
- return
209
- end
210
-
211
- # create an instance of the API class
212
- api_instance = Wire4Client::SuscripcionesApi.new
213
-
214
- # build body with info (check references for more info, types, required fields)
215
- subscription = "5873240b-cf69-456a-ab5a-88f5e79ab4b8"
216
-
217
- begin
218
- # Call the API
219
- response = api_instance.remove_enrollment_user_using_delete_with_http_info(authorization, subscription)
220
- p response
221
- rescue Wire4Client::ApiError => e
222
- puts "Exception when calling the API: #{e.response_body}"
223
- # Optional manage exception in call API
224
- return
225
- end
226
- end
227
-
228
- def test_obtain_relationships
229
- omit('Reason')
230
- # Create the authenticator to obtain access token
231
- # The token URL and Service URL are defined for this environment enum value.
232
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
233
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
234
-
235
- begin
236
- # Obtain an access token use application flow and scope "spei_admin" and add to request
237
- oauth_wire4.config_default_api_client
238
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
239
- rescue Wire4Client::ApiError => e
240
- puts "Exception to obtain access token #{e.response_body}"
241
- # Optional manage exception in access token flow
242
- return
243
- end
244
-
245
- # create an instance of the API class
246
- api_instance = Wire4Client::CuentasDeBeneficiariosSPEIApi.new
247
-
248
- # build body with info (check references for more info, types, required fields)
249
- subscription = SUBSCRIPTION
250
-
251
- begin
252
- # Call the API
253
- response = api_instance.get_available_relationships_monex_using_get(authorization, subscription)
254
- p response
255
- rescue Wire4Client::ApiError => e
256
- puts "Exception when calling the API: #{e.response_body}"
257
- # Optional manage exception in call API
258
- return
259
- end
260
- end
261
-
262
- #noinspection RubyInstanceMethodNamingConvention
263
- def test_pre_register_beneficiaries
264
- omit('Reason')
265
- # Create the authenticator to obtain access token
266
- # The token URL and Service URL are defined for this environment enum value.
267
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
268
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
269
-
270
- begin
271
- # Obtain an access token use application flow and scope "spei_admin" and add to request
272
- oauth_wire4.config_default_api_client
273
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
274
- rescue Wire4Client::ApiError => e
275
- puts "Exception to obtain access token #{e.response_body}"
276
- # Optional manage exception in access token flow
277
- return
278
- end
279
-
280
- # create an instance of the API class
281
- api_instance = Wire4Client::CuentasDeBeneficiariosSPEIApi.new
282
-
283
- # build body with info (check references for more info: types, required fields, etc.)
284
- subscription = SUBSCRIPTION
285
- body = Wire4Client::AccountRequest.new
286
- body.return_url = "https://your-app-url.mx/return"
287
- body.cancel_return_url = "https://your-app-url.mx/cancel"
288
- account = Wire4Client::Account.new
289
- account.amount_limit = 10000.00
290
- account.beneficiary_account = "112680000156896531"
291
- account.email = ["beneficiary@wire4.mx"]
292
- account.kind_of_relationship = "RECURRENTE"
293
- account.numeric_reference_spei = "1234567"
294
- account.payment_concept_spei = "concept spei"
295
- person = Wire4Client::Person.new
296
- person.last_name = "Simpson"
297
- person.middle_name = "Jay"
298
- person.name = "Bartolomeo"
299
- account.person = person
300
- account.relationship = "ACREEDOR"
301
- account.rfc = "SJBA920125AB1"
302
- body.accounts = [account]
303
-
304
- begin
305
- # Call the API
306
- response = api_instance.pre_register_accounts_using_post(authorization, body, subscription)
307
- p response
308
- rescue Wire4Client::ApiError => e
309
- puts "Exception when calling the API: #{e.response_body}"
310
- # Optional manage exception in call API
311
- return
312
- end
313
- end
314
-
315
- #noinspection RubyInstanceMethodNamingConvention
316
- def test_remove_beneficiaries_pending
317
- omit('Reason')
318
- # Create the authenticator to obtain access token
319
- # The token URL and Service URL are defined for this environment enum value.
320
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
321
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
322
-
323
- begin
324
- # Obtain an access token use application flow and scope "spei_admin" and add to request
325
- oauth_wire4.config_default_api_client
326
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
327
- rescue Wire4Client::ApiError => e
328
- puts "Exception to obtain access token #{e.response_body}"
329
- # Optional manage exception in access token flow
330
- return
331
- end
332
-
333
- # create an instance of the API class
334
- api_instance = Wire4Client::CuentasDeBeneficiariosSPEIApi.new
335
-
336
- # build body with info (check references for more info: types, required fields, etc.)
337
- subscription = SUBSCRIPTION
338
- request_id = "b782a20b-d92c-4fd9-a5cc-33a88e9b0a79"
339
-
340
- begin
341
- # Call the API
342
- response = api_instance.remove_beneficiaries_pending_using_delete_with_http_info(authorization, request_id, subscription)
343
- p response
344
- rescue Wire4Client::ApiError => e
345
- puts "Exception when calling the API: #{e.response_body}"
346
- # Optional manage exception in call API
347
- return
348
- end
349
- end
350
-
351
- def test_obtain_beneficiaries
352
- omit('Reason')
353
- # Create the authenticator to obtain access token
354
- # The token URL and Service URL are defined for this environment enum value.
355
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
356
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
357
-
358
- begin
359
- # Obtain an access token use application flow and scope "spei_admin" and add to request
360
- oauth_wire4.config_default_api_client
361
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
362
- rescue Wire4Client::ApiError => e
363
- puts "Exception to obtain access token #{e.response_body}"
364
- # Optional manage exception in access token flow
365
- return
366
- end
367
-
368
- # create an instance of the API class
369
- api_instance = Wire4Client::CuentasDeBeneficiariosSPEIApi.new
370
-
371
- # build body with info (check references for more info: types, required fields, etc.)
372
- subscription = SUBSCRIPTION
373
-
374
- begin
375
- # Call the API
376
- # response = api_instance.get_beneficiaries_for_account_using_get(subscription, rfc: "RFCE010980AR3")
377
- # response = api_instance.get_beneficiaries_for_account_using_get(subscription, account: "RFCE010980AR3")
378
- # response = api_instance.get_beneficiaries_for_account_using_get(subscription, rfc: "RFCE010980AR3, account: "RFCE010980AR3")
379
- response = api_instance.get_beneficiaries_for_account_using_get(authorization, subscription)
380
- p response
381
- rescue Wire4Client::ApiError => e
382
- puts "Exception when calling the API: #{e.response_body}"
383
- # Optional manage exception in call API
384
- return
385
- end
386
- end
387
-
388
- #noinspection RubyInstanceMethodNamingConvention
389
- def test_obtain_beneficiaries_by_request_id
390
- omit('Reason')
391
- # Create the authenticator to obtain access token
392
- # The token URL and Service URL are defined for this environment enum value.
393
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
394
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
395
-
396
- begin
397
- # Obtain an access token use application flow and scope "spei_admin" and add to request
398
- oauth_wire4.config_default_api_client
399
- authorization = oauth_wire4.obtain_access_token_app_user("0bb13bfb99d461a8a0e18746b25e7d@develop.wire4.mx", "0b6ea839f33467a81631b380d37472", 'spei_admin')
400
- # USER_KEY, SECRET_KEY, 'spei_admin')
401
- rescue Wire4Client::ApiError => e
402
- puts "Exception to obtain access token #{e.response_body}"
403
- # Optional manage exception in access token flow
404
- return
405
- end
406
-
407
- # create an instance of the API class
408
- api_instance = Wire4Client::CuentasDeBeneficiariosSPEIApi.new
409
-
410
- # build body with info (check references for more info: types, required fields, etc.)
411
- subscription = SUBSCRIPTION
412
- request_id = ""
413
-
414
- begin
415
- # Call the API
416
- response = api_instance.get_beneficiaries_by_request_id(authorization, request_id, subscription)
417
- p response
418
- rescue Wire4Client::ApiError => e
419
- puts "Exception when calling the API: #{e.response_body}"
420
- # Optional manage exception in call API
421
- return
422
- end
423
- end
424
-
425
- #noinspection RubyInstanceMethodNamingConvention
426
- def test_change_amount_limit_beneficiary
427
- omit('Reason')
428
- # Create the authenticator to obtain access token
429
- # The token URL and Service URL are defined for this environment enum value.
430
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
431
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
432
-
433
- begin
434
- # Obtain an access token use application flow and scope "spei_admin" and add to request
435
- oauth_wire4.config_default_api_client
436
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
437
- rescue Wire4Client::ApiError => e
438
- puts "Exception to obtain access token #{e.response_body}"
439
- # Optional manage exception in access token flow
440
- return
441
- end
442
-
443
- # create an instance of the API class
444
- api_instance = Wire4Client::CuentasDeBeneficiariosSPEIApi.new
445
-
446
- # build body with info (check references for more info: types, required fields, etc.)
447
- subscription = SUBSCRIPTION
448
- account = "112680000156896531"
449
- body = Wire4Client::AmountRequest.new
450
- body.amount_limit = 20000.00
451
- body.currency_code = "MXP"
452
- body.previous_amount_limit = 10000.00
453
- body.return_url = "https://your-app-url.mx/return"
454
- body.cancel_return_url = "https://your-app-url.mx/cancel"
455
-
456
- begin
457
- # Call the API
458
- response = api_instance.update_amount_limit_account_using_put_with_http_info(authorization, account, body, subscription)
459
- p response
460
- rescue Wire4Client::ApiError => e
461
- puts "Exception when calling the API: #{e.response_body}"
462
- # Optional manage exception in call API
463
- return
464
- end
465
- end
466
-
467
- def test_delete_beneficiary
468
- omit('Reason')
469
- # Create the authenticator to obtain access token
470
- # The token URL and Service URL are defined for this environment enum value.
471
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
472
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
473
-
474
- begin
475
- # Obtain an access token use application flow and scope "spei_admin" and add to request
476
- oauth_wire4.config_default_api_client
477
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
478
- rescue Wire4Client::ApiError => e
479
- puts "Exception to obtain access token #{e.response_body}"
480
- # Optional manage exception in access token flow
481
- return
482
- end
483
-
484
- # create an instance of the API class
485
- api_instance = Wire4Client::CuentasDeBeneficiariosSPEIApi.new
486
-
487
- # build body with info (check references for more info: types, required fields, etc.)
488
- subscription = SUBSCRIPTION
489
- account = "112680000156896531"
490
-
491
- begin
492
- # Call the API
493
- response = api_instance.delete_account_using_delete_with_http_info(authorization, account, subscription)
494
- p response
495
- rescue Wire4Client::ApiError => e
496
- puts "Exception when calling the API: #{e.response_body}"
497
- # Optional manage exception in call API
498
- return
499
- end
500
- end
501
-
502
- def test_obtain_institutions
503
- omit('Reason')
504
- # Create the authenticator to obtain access token
505
- # The token URL and Service URL are defined for this environment enum value.
506
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
507
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
508
-
509
- begin
510
- # Obtain an access token use application flow and scope "general" and add to request
511
- oauth_wire4.config_default_api_client
512
- authorization = oauth_wire4.obtain_access_token_app('general')
513
- rescue Wire4Client::ApiError => e
514
- puts "Exception to obtain access token #{e.response_body}"
515
- # Optional manage exception in access token flow
516
- return
517
- end
518
-
519
- # create an instance of the API class
520
- api_instance = Wire4Client::InstitucionesApi.new
521
-
522
- begin
523
- # Call the API
524
- response = api_instance.get_all_institutions_using_get(authorization)
525
- p response
526
- rescue Wire4Client::ApiError => e
527
- puts "Exception when calling the API: #{e.response_body}"
528
- # Optional manage exception in call API
529
- return
530
- end
531
- end
532
-
533
- def test_obtain_balance
534
- omit('Reason')
535
- # Create the authenticator to obtain access token
536
- # The token URL and Service URL are defined for this environment enum value.
537
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
538
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
539
-
540
- begin
541
- # Obtain an access token use application flow and scope "spei_admin" and add to request
542
- oauth_wire4.config_default_api_client
543
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
544
- rescue Wire4Client::ApiError => e
545
- puts "Exception to obtain access token #{e.response_body}"
546
- # Optional manage exception in access token flow
547
- return
548
- end
549
-
550
- # create an instance of the API class
551
- api_instance = Wire4Client::SaldoApi.new
552
-
553
- # build body with info (check references for more info, types, required fields)
554
- subscription = SUBSCRIPTION
555
-
556
- begin
557
- # Call the API
558
- response = api_instance.get_balance_using_get(authorization, subscription)
559
- p response
560
- rescue Wire4Client::ApiError => e
561
- puts "Exception when calling the API: #{e.response_body}"
562
- # Optional manage exception in call API
563
- return
564
- end
565
- end
566
-
567
- #noinspection RubyInstanceMethodNamingConvention
568
- def test_obtain_SPID_classifications
569
- omit('Reason')
570
- # Create the authenticator to obtain access token
571
- # The token URL and Service URL are defined for this environment enum value.
572
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
573
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
574
-
575
- begin
576
- # Obtain an access token use application flow and scope "spid_admin" and add to request
577
- oauth_wire4.config_default_api_client
578
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spid_admin')
579
- rescue Wire4Client::ApiError => e
580
- puts "Exception to obtain access token #{e.response_body}"
581
- # Optional manage exception in access token flow
582
- return
583
- end
584
-
585
- # create an instance of the API class
586
- api_instance = Wire4Client::TransferenciasSPIDApi.new
587
-
588
- # build body with info (check references for more info, types, required fields)
589
- subscription = SUBSCRIPTION
590
-
591
- begin
592
- # Call the API
593
- response = api_instance.get_spid_classifications_using_get(authorization, subscription)
594
- p response
595
- rescue Wire4Client::ApiError => e
596
- puts "Exception when calling the API: #{e.response_body}"
597
- # Optional manage exception in call API
598
- return
599
- end
600
- end
601
-
602
- #noinspection RubyInstanceMethodNamingConvention
603
- def test_pre_register_beneficiaries_SPID
604
- omit('Reason')
605
- # Create the authenticator to obtain access token
606
- # The token URL and Service URL are defined for this environment enum value.
607
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
608
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
609
-
610
- begin
611
- # Obtain an access token use application flow and scope "spid_admin" and add to request
612
- oauth_wire4.config_default_api_client
613
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spid_admin')
614
- rescue Wire4Client::ApiError => e
615
- puts "Exception to obtain access token #{e.response_body}"
616
- # Optional manage exception in access token flow
617
- return
618
- end
619
-
620
- # create an instance of the API class
621
- api_instance = Wire4Client::CuentasDeBeneficiariosSPIDApi.new
622
-
623
- # build body with info (check references for more info: types, required fields, etc.)
624
- subscription = SUBSCRIPTION
625
- body = Wire4Client::AccountSpid.new
626
- body.return_url = "https://your-app-url.mx/return"
627
- body.cancel_return_url = "https://your-app-url.mx/cancel"
628
- body.amount_limit = 10000.00
629
- body.beneficiary_account = "112680000156896531"
630
- body.email = ["beneficiary.spid@wire4.mx"]
631
- body.institution = Wire4Client::BeneficiaryInstitution.new(name: "BMONEX")
632
- body.kind_of_relationship = "RECURRENTE"
633
- body.numeric_reference = "1234567"
634
- body.payment_concept = "concept spei"
635
- body.relationship = "ACREEDOR"
636
- body.rfc = "SJBA920125AB1"
637
-
638
- begin
639
- # Call the API
640
- response = api_instance.pre_register_accounts_using_post1(authorization, body, subscription)
641
- p response
642
- rescue Wire4Client::ApiError => e
643
- puts "Exception when calling the API: #{e.response_body}"
644
- # Optional manage exception in call API
645
- return
646
- end
647
- end
648
-
649
- def test_obtain_beneficiaries_spid
650
- omit('Reason')
651
- # Create the authenticator to obtain access token
652
- # The token URL and Service URL are defined for this environment enum value.
653
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
654
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
655
-
656
- begin
657
- # Obtain an access token use application flow and scope "spei_admin" and add to request
658
- oauth_wire4.config_default_api_client
659
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spid_admin')
660
- rescue Wire4Client::ApiError => e
661
- puts "Exception to obtain access token #{e.response_body}"
662
- # Optional manage exception in access token flow
663
- return
664
- end
665
-
666
- # create an instance of the API class
667
- api_instance = Wire4Client::CuentasDeBeneficiariosSPIDApi.new
668
-
669
- # build body with info (check references for more info: types, required fields, etc.)
670
- subscription = SUBSCRIPTION
671
-
672
- begin
673
- # Call the API
674
- # response = api_instance.get_beneficiaries_for_account_using_get(subscription, rfc: "RFCE010980AR3")
675
- # response = api_instance.get_beneficiaries_for_account_using_get(subscription, account: "RFCE010980AR3")
676
- # response = api_instance.get_beneficiaries_for_account_using_get(subscription, rfc: "RFCE010980AR3, account: "RFCE010980AR3")
677
- response = api_instance.get_spid_beneficiaries_for_account(authorization, subscription)
678
- p response
679
- rescue Wire4Client::ApiError => e
680
- puts "Exception when calling the API: #{e.response_body}"
681
- # Optional manage exception in call API
682
- return
683
- end
684
- end
685
-
686
- def test_get_depositants
687
- omit('Reason')
688
- # Create the authenticator to obtain access token
689
- # The token URL and Service URL are defined for this environment enum value.
690
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
691
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
692
-
693
- begin
694
- # Obtain an access token use application flow and scope "spei_admin" and add to request
695
- oauth_wire4.config_default_api_client
696
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
697
- rescue Wire4Client::ApiError => e
698
- puts "Exception to obtain access token #{e.response_body}"
699
- # Optional manage exception in access token flow
700
- return
701
- end
702
-
703
- # create an instance of the API class
704
- api_instance = Wire4Client::DepositantesApi.new
705
-
706
- # build body with info (check references for more info: types, required fields, etc.)
707
- subscription = SUBSCRIPTION
708
-
709
- begin
710
- # Call the API
711
- response = api_instance.get_depositants_using_get(authorization, subscription)
712
- p response
713
- rescue Wire4Client::ApiError => e
714
- puts "Exception when calling the API: #{e.response_body}"
715
- # Optional manage exception in call API
716
- return
717
- end
718
- end
719
-
720
- def test_register_depositants
721
- omit('Reason')
722
- # Create the authenticator to obtain access token
723
- # The token URL and Service URL are defined for this environment enum value.
724
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
725
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
726
-
727
- begin
728
- # Obtain an access token use application flow and scope "spei_admin" and add to request
729
- oauth_wire4.config_default_api_client
730
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
731
- rescue Wire4Client::ApiError => e
732
- puts "Exception to obtain access token #{e.response_body}"
733
- # Optional manage exception in access token flow
734
- return
735
- end
736
-
737
- # create an instance of the API class
738
- api_instance = Wire4Client::DepositantesApi.new
739
-
740
- # build body with info (check references for more info: types, required fields, etc.)
741
- subscription = SUBSCRIPTION
742
- body = Wire4Client::DepositantsRegister.new
743
- body._alias = "Depositant 0292921"
744
- body.currency_code = "MXP"
745
- body.email = ["depositant@wire4.mx"]
746
- body.name = "Marge Bouvier"
747
-
748
- begin
749
- # Call the API
750
- response = api_instance.register_depositants_using_post(authorization, body, subscription)
751
- p response
752
- rescue Wire4Client::ApiError => e
753
- puts "Exception when calling the API: #{e.response_body}"
754
- # Optional manage exception in call API
755
- return
756
- end
757
- end
758
-
759
- #noinspection RubyInstanceMethodNamingConvention
760
- def test_incoming_SPEI_transactions_report
761
- omit('Reason')
762
- # Create the authenticator to obtain access token
763
- # The token URL and Service URL are defined for this environment enum value.
764
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
765
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
766
-
767
- begin
768
- # Obtain an access token use application flow and scope "spei_admin" and add to request
769
- oauth_wire4.config_default_api_client
770
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
771
- rescue Wire4Client::ApiError => e
772
- puts "Exception to obtain access token #{e.response_body}"
773
- # Optional manage exception in access token flow
774
- return
775
- end
776
-
777
- # create an instance of the API class
778
- api_instance = Wire4Client::TransferenciasSPEIApi.new
779
-
780
- # build body with info (check references for more info: types, required fields, etc.)
781
- subscription = SUBSCRIPTION
782
-
783
- begin
784
- # Call the API
785
- response = api_instance.incoming_spei_transactions_report_using_get(authorization, subscription)
786
- p response
787
- rescue Wire4Client::ApiError => e
788
- puts "Exception when calling the API: #{e.response_body}"
789
- # Optional manage exception in call API
790
- return
791
- end
792
- end
793
-
794
- #noinspection RubyInstanceMethodNamingConvention
795
- def test_outgoing_SPEI_transactions_report
796
- omit('Reason')
797
- # Create the authenticator to obtain access token
798
- # The token URL and Service URL are defined for this environment enum value.
799
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
800
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
801
-
802
- begin
803
- # Obtain an access token use application flow and scope "spei_admin" and add to request
804
- oauth_wire4.config_default_api_client
805
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
806
- rescue Wire4Client::ApiError => e
807
- puts "Exception to obtain access token #{e.response_body}"
808
- # Optional manage exception in access token flow
809
- return
810
- end
811
-
812
- # create an instance of the API class
813
- api_instance = Wire4Client::TransferenciasSPEIApi.new
814
-
815
- # build body with info (check references for more info: types, required fields, etc.)
816
- subscription = SUBSCRIPTION
817
-
818
- begin
819
- # Call the API
820
- response = api_instance.outgoing_spei_transactions_report_using_get(authorization, subscription)
821
- p response
822
- rescue Wire4Client::ApiError => e
823
- puts "Exception when calling the API: #{e.response_body}"
824
- # Optional manage exception in call API
825
- return
826
- end
827
- end
828
-
829
- #noinspection RubyInstanceMethodNamingConvention
830
- def test_out_comming_spei_request_id_transactions_report_using_get
831
- omit('Reason')
832
- # Create the authenticator to obtain access token
833
- # The token URL and Service URL are defined for this environment enum value.
834
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
835
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
836
-
837
- begin
838
- # Obtain an access token use application flow and scope "spei_admin" and add to request
839
- oauth_wire4.config_default_api_client
840
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
841
- rescue Wire4Client::ApiError => e
842
- puts "Exception to obtain access token #{e.response_body}"
843
- # Optional manage exception in access token flow
844
- return
845
- end
846
-
847
- # create an instance of the API class
848
- api_instance = Wire4Client::TransferenciasSPEIApi.new
849
-
850
- # build body with info (check references for more info: types, required fields, etc.)
851
- subscription = SUBSCRIPTION
852
- request_id = '6a9efe39-a795-4e09-8f7f-197e647a0f8b'
853
-
854
- begin
855
- # Call the API
856
- response = api_instance.out_comming_spei_request_id_transactions_report_using_get(authorization, request_id, subscription)
857
- p response
858
- rescue Wire4Client::ApiError => e
859
- puts "Exception when calling TransferenciasSPEIApi->out_comming_spei_request_id_transactions_report_using_get: #{e.response_body}"
860
- # Optional manage exception in call API
861
- return
862
- end
863
- end
864
-
865
- #noinspection RubyInstanceMethodNamingConvention
866
- def test_register_outgoing_SPEI_transaction
867
- omit('Reason')
868
- # Create the authenticator to obtain access token
869
- # The token URL and Service URL are defined for this environment enum value.
870
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
871
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
872
-
873
- begin
874
- # Obtain an access token use application flow and scope "spei_admin" and add to request
875
- oauth_wire4.config_default_api_client
876
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
877
- rescue Wire4Client::ApiError => e
878
- puts "Exception to obtain access token #{e.response_body}"
879
- # Optional manage exception in access token flow
880
- return
881
- end
882
-
883
- # create an instance of the API class
884
- api_instance = Wire4Client::TransferenciasSPEIApi.new
885
-
886
- # build body with info (check references for more info: types, required fields, etc.)
887
- subscription = SUBSCRIPTION
888
- body = Wire4Client::TransactionsOutgoingRegister.new
889
- body.return_url = "https://your-app-url.mx/return"
890
- body.cancel_return_url = "https://your-app-url.mx/cancel"
891
- transaction = Wire4Client::TransactionOutgoing.new
892
- transaction.order_id = "137f14a4-9e12-4a98-bbd1-ab347753e68a"
893
- transaction.amount = 1259.69
894
- transaction.beneficiary_account = "112680000156896531"
895
- transaction.currency_code = "MXP"
896
- transaction.email = ["notificar@wire4.mx"]
897
- transaction.reference = 1234567
898
- transaction.concept = "Transfer out test 1"
899
- body.transactions = [transaction]
900
-
901
- begin
902
- # Call the API
903
- response = api_instance.register_outgoing_spei_transaction_using_post(authorization, subscription, body)
904
- p response
905
- rescue Wire4Client::ApiError => e
906
- puts "Exception when calling the API: #{e.response_body}"
907
- # Optional manage exception in call API
908
- return
909
- end
910
- end
911
-
912
- #noinspection RubyInstanceMethodNamingConvention
913
- def test_delete_outgoing_pending_SPEI_transaction
914
- omit('Reason')
915
- # Create the authenticator to obtain access token
916
- # The token URL and Service URL are defined for this environment enum value.
917
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
918
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
919
-
920
- begin
921
- # Obtain an access token use application flow and scope "spei_admin" and add to request
922
- oauth_wire4.config_default_api_client
923
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
924
- rescue Wire4Client::ApiError => e
925
- puts "Exception to obtain access token #{e.response_body}"
926
- # Optional manage exception in access token flow
927
- return
928
- end
929
-
930
- # create an instance of the API class
931
- api_instance = Wire4Client::TransferenciasSPEIApi.new
932
-
933
- # build body with info (check references for more info: types, required fields, etc.)
934
- subscription = SUBSCRIPTION
935
- request_id = "8abc184f-c3ac-4abd-9045-a9b4a501f007"
936
-
937
- begin
938
- # Call the API
939
- response = api_instance.drop_transactions_pending_using_delete_with_http_info(authorization, request_id, subscription)
940
- p response
941
- rescue Wire4Client::ApiError => e
942
- puts "Exception when calling the API: #{e.response_body}"
943
- # Optional manage exception in call API
944
- return
945
- end
946
- end
947
-
948
- #noinspection RubyInstanceMethodNamingConvention
949
- def test_register_outgoing_SPID_transaction
950
- omit('Reason')
951
- # Create the authenticator to obtain access token
952
- # The token URL and Service URL are defined for this environment enum value.
953
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
954
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
955
-
956
- begin
957
- # Obtain an access token use application flow and scope "spid_admin" and add to request
958
- oauth_wire4.config_default_api_client
959
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spid_admin')
960
- rescue Wire4Client::ApiError => e
961
- puts "Exception to obtain access token #{e.response_body}"
962
- # Optional manage exception in access token flow
963
- return
964
- end
965
-
966
- # create an instance of the API class
967
- api_instance = Wire4Client::TransferenciasSPIDApi.new
968
-
969
- # build body with info (check references for more info: types, required fields, etc.)
970
- subscription = SUBSCRIPTION
971
- body = Wire4Client::TransactionOutgoingSpid.new
972
- body.return_url = "https://your-app-url.mx/return"
973
- body.cancel_return_url = "https://your-app-url.mx/cancel"
974
- body.amount = 1259.69
975
- body.beneficiary_account = "112680000156896531"
976
- body.classification_id = "01"
977
- body.currency_code = "USD"
978
- body.email = ["notificar@wire4.mx"]
979
- body.numeric_reference_spid = 1234567
980
- body.order_id = "77baa78f-be22-4f6a-b79e-60b20a198324"
981
- body.payment_concept_spid = "Transfer out test 1"
982
-
983
- begin
984
- # Call the API
985
- response = api_instance.register_outgoing_spid_transaction_using_post(authorization, subscription, body)
986
- p response
987
- rescue Wire4Client::ApiError => e
988
- puts "Exception when calling the API: #{e.response_body}"
989
- # Optional manage exception in call API
990
- return
991
- end
992
- end
993
-
994
- def test_register_web_hook
995
- omit('Reason')
996
- # Create the authenticator to obtain access token
997
- # The token URL and Service URL are defined for this environment enum value.
998
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
999
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1000
-
1001
- begin
1002
- # Obtain an access token use application flow and scope "general" and add to request
1003
- oauth_wire4.config_default_api_client
1004
- authorization = oauth_wire4.obtain_access_token_app('general')
1005
- rescue Wire4Client::ApiError => e
1006
- puts "Exception to obtain access token #{e.response_body}"
1007
- # Optional manage exception in access token flow
1008
- return
1009
- end
1010
-
1011
- # create an instance of the API class
1012
- api_instance = Wire4Client::WebhooksApi.new
1013
-
1014
- # build body with info (check references for more info: types, required fields, etc.)
1015
- body = Wire4Client::WebhookRequest.new # CepSearchBanxico | Información para buscar un CEP
1016
- body.events = %w(ACCOUNT.CREATED TRANSACTION.OUTGOING.RECEIVED ENROLLMENT.CREATED)
1017
- body.name = "RUBY TEST SDK WEBHOOK-REGISTER"
1018
- body.url = "https://www.webhook.site/39034a03-8faf-424e-bb4a-7c3fee2bbfd3"
1019
-
1020
- begin
1021
- # Call the API
1022
- response = api_instance.register_webhook(authorization, body)
1023
- p response
1024
- rescue Wire4Client::ApiError => e
1025
- puts "Exception when calling the API: #{e.response_body}"
1026
- # Optional manage exception in call API
1027
- return
1028
- end
1029
- end
1030
-
1031
- def test_get_web_hooks
1032
- omit('Reason')
1033
- # Create the authenticator to obtain access token
1034
- # The token URL and Service URL are defined for this environment enum value.
1035
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1036
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1037
-
1038
- begin
1039
- # Obtain an access token use application flow and scope "general" and add to request
1040
- oauth_wire4.config_default_api_client
1041
- authorization = oauth_wire4.obtain_access_token_app('general')
1042
- rescue Wire4Client::ApiError => e
1043
- puts "Exception to obtain access token #{e.response_body}"
1044
- # Optional manage exception in access token flow
1045
- return
1046
- end
1047
-
1048
- # create an instance of the API class
1049
- api_instance = Wire4Client::WebhooksApi.new
1050
-
1051
- begin
1052
- # Call the API
1053
- response = api_instance.get_webhooks(authorization)
1054
- p response
1055
- rescue Wire4Client::ApiError => e
1056
- puts "Exception when calling the API: #{e.response_body}"
1057
- # Optional manage exception in call API
1058
- return
1059
- end
1060
- end
1061
-
1062
- def test_get_web_hook_by_id
1063
- omit('Reason')
1064
- # Create the authenticator to obtain access token
1065
- # The token URL and Service URL are defined for this environment enum value.
1066
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1067
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1068
-
1069
- begin
1070
- # Obtain an access token use application flow and scope "general" and add to request
1071
- oauth_wire4.config_default_api_client
1072
- authorization = oauth_wire4.obtain_access_token_app('general')
1073
- rescue Wire4Client::ApiError => e
1074
- puts "Exception to obtain access token #{e.response_body}"
1075
- # Optional manage exception in access token flow
1076
- return
1077
- end
1078
-
1079
- # create an instance of the API class
1080
- api_instance = Wire4Client::WebhooksApi.new
1081
-
1082
- begin
1083
- # Call the API
1084
- response = api_instance.get_webhook(authorization, "wh_3fe3e5f4849f4cabb147804fd55c86fc")
1085
- p response
1086
- rescue Wire4Client::ApiError => e
1087
- puts "Exception when calling the API: #{e.response_body}"
1088
- # Optional manage exception in call API
1089
- return
1090
- end
1091
- end
1092
-
1093
- def test_get_facturas
1094
- omit('Reason')
1095
- # Create the authenticator to obtain access token
1096
- # The token URL and Service URL are defined for this environment enum value.
1097
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1098
-
1099
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1100
-
1101
- begin
1102
- # Obtain an access token use application flow and scope "general" and add to request
1103
- oauth_wire4.config_default_api_client
1104
- authorization = oauth_wire4.obtain_access_token_app('general')
1105
- rescue Wire4Client::ApiError => e
1106
- puts "Exception to obtain access token #{e.response_body}"
1107
- # Optional manage exception in access token flow
1108
- return
1109
- end
1110
-
1111
- # create an instance of the API class
1112
- api_instance = Wire4Client::FacturasApi.new
1113
-
1114
- begin
1115
- # Call the API
1116
- response = api_instance.billings_report_using_get(authorization, period: "2019-10")
1117
- p response
1118
- rescue Wire4Client::ApiError => e
1119
- puts "Exception when calling the API: #{e.response_body}"
1120
- # Optional manage exception in call API
1121
- return
1122
- end
1123
- end
1124
-
1125
- def test_get_facturas_by_id
1126
- omit('Reason')
1127
- # Create the authenticator to obtain access token
1128
- # The token URL and Service URL are defined for this environment enum value.
1129
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1130
-
1131
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1132
-
1133
- begin
1134
- # Obtain an access token use application flow and scope "general" and add to request
1135
- oauth_wire4.config_default_api_client
1136
- authorization = oauth_wire4.obtain_access_token_app('general')
1137
- rescue Wire4Client::ApiError => e
1138
- puts "Exception to obtain access token #{e.response_body}"
1139
- # Optional manage exception in access token flow
1140
- return
1141
- end
1142
-
1143
- # create an instance of the API class
1144
- api_instance = Wire4Client::FacturasApi.new
1145
-
1146
- begin
1147
- # Call the API
1148
- response = api_instance.billings_report_by_id_using_get(authorization, "834BA74A-BBBB-43C4-8400-A4528153C2BD")
1149
- p response
1150
- rescue Wire4Client::ApiError => e
1151
- puts "Exception when calling the API: #{e.response_body}"
1152
- # Optional manage exception in call API
1153
- return
1154
- end
1155
- end
1156
-
1157
- def test_check_web_hook_sign
1158
-
1159
- omit('Reason')
1160
- puts `cd .. && cd .. && find *`.split("\n").uniq.sort.select { |f| !f.empty? }
1161
-
1162
- payload = "{ \"responseCode\":0, \n" + \
1163
- " \"message\":\"Ya existe este beneficiario de pago a ctas nacionales en el contrato\",\n" + \
1164
- " \"statusCode\":\"ERROR\",\n" + \
1165
- " \"externalReference\":\"8939TR\"\n" + \
1166
- "}"
1167
- expected_key = "8e63e88434679473bdb28546d7d91537601f4588e801972376d5c5addcb8fd706e6c92421b73151de3c1945ce000a8a" + \
1168
- +"5aa1d5cc3cdd73f2769ee9980db420db9"
1169
-
1170
- result = Wire4Auth::UtilsCompute.compare_webhook_msg_signatures(payload, "9ie93030?=", expected_key)
1171
- puts "WebHook signature verification, correct: #{result}"
1172
-
1173
- assert result
1174
- end
1175
-
1176
- #noinspection RubyInstanceMethodNamingConvention
1177
- def test_authorize_accounts_pending
1178
- omit('Reason')
1179
- # Create the authenticator to obtain access token
1180
- # The token URL and Service URL are defined for this environment enum value.
1181
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1182
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1183
-
1184
- begin
1185
- # Obtain an access token use application flow and scope "spei_admin" and add to request
1186
- oauth_wire4.config_default_api_client
1187
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
1188
- rescue Wire4Client::ApiError => e
1189
- puts "Exception to obtain access token #{e.response_body}"
1190
- # Optional manage exception in access token flow
1191
- return
1192
- end
1193
-
1194
- # create an instance of the API class
1195
- api_instance = Wire4Client::CuentasDeBeneficiariosSPEIApi.new
1196
-
1197
- # build body with info (check references for more info, types, required fields)
1198
- subscription = SUBSCRIPTION
1199
- body = Wire4Client::UrlsRedirect.new
1200
- body.cancel_return_url = "https://your-app-url.mx/return"
1201
- body.return_url = "https://your-app-url.mx/cancel"
1202
-
1203
- begin
1204
- # Call the API
1205
- response = api_instance.authorize_accounts_pending_put(authorization, subscription, body)
1206
- p response
1207
- rescue Wire4Client::ApiError => e
1208
- puts "Exception when calling the API: #{e.response_body}"
1209
- # Optional manage exception in call API
1210
- return
1211
- end
1212
- end
1213
-
1214
- #noinspection RubyInstanceMethodNamingConvention
1215
- def test_create_authorization_transactions_group
1216
- omit('Reason')
1217
- # Create the authenticator to obtain access token
1218
- # The token URL and Service URL are defined for this environment enum value.
1219
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1220
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1221
-
1222
- begin
1223
- # Obtain an access token use application flow and scope "spei_admin" and add to request
1224
- oauth_wire4.config_default_api_client
1225
- authorization = oauth_wire4.obtain_access_token_app_user(USER_KEY, SECRET_KEY, 'spei_admin')
1226
- rescue Wire4Client::ApiError => e
1227
- puts "Exception to obtain access token #{e.response_body}"
1228
- # Optional manage exception in access token flow
1229
- return
1230
- end
1231
-
1232
- # create an instance of the API class
1233
- api_instance = Wire4Client::TransferenciasSPEIApi.new
1234
-
1235
- # build body with info (check references for more info, types, required fields)
1236
- subscription = SUBSCRIPTION
1237
- body = Wire4Client::AuthorizationTransactionGroup.new
1238
- body.transactions = ["2454ffb2-a699-408f-9812-9a12eed11bfc"] # Add N transactions order identifiers
1239
-
1240
- body.redirect_urls = Wire4Client::UrlsRedirect.new
1241
- body.redirect_urls.cancel_return_url = "https://your-app-url.mx/return"
1242
- body.redirect_urls.return_url = "https://your-app-url.mx/cancel"
1243
-
1244
- begin
1245
- # Call the API
1246
- response = api_instance.create_authorization_transactions_group(authorization, body, subscription)
1247
- p response
1248
- rescue Wire4Client::ApiError => e
1249
- puts "Exception when calling the API: #{e.response_body}"
1250
- # Optional manage exception in call API
1251
- return
1252
- end
1253
- end
1254
-
1255
- def test_register_company_using
1256
- omit('Reason')
1257
- # Create the authenticator to obtain access token
1258
- # The token URL and Service URL are defined for this environment enum value.
1259
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1260
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1261
-
1262
- begin
1263
- # Obtain an access token use application flow and scope "codi_general" and add to request
1264
- oauth_wire4.config_default_api_client
1265
- authorization = oauth_wire4.obtain_access_token_app('codi_general')
1266
- rescue Wire4Client::ApiError => e
1267
- puts "Exception to obtain access token #{e.response_body}"
1268
- # Optional manage exception in access token flow
1269
- return
1270
- end
1271
-
1272
- # create an instance of the API class
1273
- api_instance = Wire4Client::EmpresasCoDiApi.new
1274
-
1275
- # build body with info (check references for more info, types, required fields)
1276
- body = Wire4Client::CompanyRequested.new
1277
- body.business_name = "Tacos"
1278
- body.comercial_name = "Tacos el Compa"
1279
- body.rfc = "TACO580926LA1"
1280
- body.certificate = Wire4Client::CertificateRequest.new
1281
- body.certificate.certificate_number = "4908439084390849084"
1282
- body.certificate._alias = "00040390904903904909"
1283
- body.certificate.check_digit = "1"
1284
- body.certificate.cipher_data = "4309jij3490j43jf0j3490fFFFDSDS4393490"
1285
-
1286
- begin
1287
- # Call the API
1288
- response = api_instance.register_company_using_post(authorization, body)
1289
- p response
1290
- rescue Wire4Client::ApiError => e
1291
- puts "Exception when calling the API: #{e.response_body}"
1292
- # Optional manage exception in call API
1293
- return
1294
- end
1295
- end
1296
-
1297
- def test_obtain_companies
1298
- #omit('Reason')
1299
- # Create the authenticator to obtain access token
1300
- # The token URL and Service URL are defined for this environment enum value.
1301
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1302
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1303
-
1304
- begin
1305
- # Obtain an access token use application flow and scope "codi_general" and add to request
1306
- oauth_wire4.config_default_api_client
1307
- authorization = oauth_wire4.obtain_access_token_app('codi_general')
1308
- rescue Wire4Client::ApiError => e
1309
- puts "Exception to obtain access token #{e.response_body}"
1310
- # Optional manage exception in access token flow
1311
- return
1312
- end
1313
-
1314
- # create an instance of the API class
1315
- api_instance = Wire4Client::EmpresasCoDiApi.new
1316
-
1317
- begin
1318
- # Call the API
1319
- response = api_instance.obtain_companies(authorization)
1320
- p response
1321
- rescue Wire4Client::ApiError => e
1322
- puts "Exception when calling the API: #{e.response_body}"
1323
- # Optional manage exception in call API
1324
- return
1325
- end
1326
- end
1327
-
1328
- COMPANY_ID = "0b43cbd2-2a86-4eb5-a51c-49a53d521295"
1329
-
1330
- def test_create_sales_point
1331
- omit('Reason')
1332
- # Create the authenticator to obtain access token
1333
- # The token URL and Service URL are defined for this environment enum value.
1334
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1335
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1336
-
1337
- begin
1338
- # Obtain an access token use application flow and scope "spei_admin" and add to request
1339
- oauth_wire4.config_default_api_client
1340
- authorization = oauth_wire4.obtain_access_token_app('codi_general')
1341
- rescue Wire4Client::ApiError => e
1342
- puts "Exception to obtain access token #{e.response_body}"
1343
- # Optional manage exception in access token flow
1344
- return
1345
- end
1346
-
1347
- # create an instance of the API class
1348
- api_instance = Wire4Client::PuntosDeVentaCoDiApi.new
1349
-
1350
- # build body with info (check references for more info, types, required fields)
1351
- company_id = COMPANY_ID
1352
- body = Wire4Client::SalesPointRequest.new
1353
- body.name = "Taqueria Sur, caja 1"
1354
- body.access_ip = "189.180.255.229"
1355
- body.notifications_url = "https://webhook.site/3e32e1c4-1346-4f5a-92d5-2a921c5c85df"
1356
- body.account = "044680035044988526"
1357
-
1358
- begin
1359
- # Call the API
1360
- response = api_instance.create_sales_point(authorization, company_id, body)
1361
- p response
1362
- rescue Wire4Client::ApiError => e
1363
- puts "Exception when calling the API: #{e.response_body}"
1364
- # Optional manage exception in call API
1365
- return
1366
- end
1367
- end
1368
-
1369
- def test_obtain_sale_points
1370
- omit('Reason')
1371
- # Create the authenticator to obtain access token
1372
- # The token URL and Service URL are defined for this environment enum value.
1373
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1374
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1375
-
1376
- begin
1377
- # Obtain an access token use application flow and scope "codi_general" and add to request
1378
- oauth_wire4.config_default_api_client
1379
- authorization = oauth_wire4.obtain_access_token_app('codi_general')
1380
- rescue Wire4Client::ApiError => e
1381
- puts "Exception to obtain access token #{e.response_body}"
1382
- # Optional manage exception in access token flow
1383
- return
1384
- end
1385
-
1386
- # create an instance of the API class
1387
- api_instance = Wire4Client::PuntosDeVentaCoDiApi.new
1388
-
1389
- # build body with info (check references for more info, types, required fields)
1390
- company_id = COMPANY_ID
1391
-
1392
- begin
1393
- # Call the API
1394
- response = api_instance.obtain_sale_points(authorization, company_id)
1395
- p response
1396
- rescue Wire4Client::ApiError => e
1397
- puts "Exception when calling the API: #{e.response_body}"
1398
- # Optional manage exception in call API
1399
- return
1400
- end
1401
- end
1402
-
1403
- SALES_POINT_ID = "465ffc2c-10b5-4475-8d64-bc58e4ff098d"
1404
- SALES_POINT_KEY = "097db4157b74619b88f40550e7c1ee@develop.wire4.mx"
1405
- SALES_POINT_SECRET = "b722b8c8fc24d4bae0b1cd41b4c6af"
1406
-
1407
- def test_generate_codi_code_qr
1408
- omit('Reason')
1409
- # Create the authenticator to obtain access token
1410
- # The token URL and Service URL are defined for this environment enum value.
1411
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1412
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1413
-
1414
- begin
1415
- # Obtain an access token use application flow and scope "codi_admin" and add to request
1416
- oauth_wire4.config_default_api_client
1417
- authorization = oauth_wire4.obtain_access_token_app_user(SALES_POINT_KEY, SALES_POINT_SECRET, 'codi_admin')
1418
- rescue Wire4Client::ApiError => e
1419
- puts "Exception to obtain access token #{e.response_body}"
1420
- # Optional manage exception in access token flow
1421
- return
1422
- end
1423
-
1424
- # create an instance of the API class
1425
- api_instance = Wire4Client::PeticionesDePagoPorCoDiApi.new
1426
-
1427
- # build body with info (check references for more info, types, required fields)
1428
- sales_point_id = SALES_POINT_ID
1429
- body = Wire4Client::CodiCodeRequestDTO.new
1430
- body.amount = 178.8
1431
- body.concept = "consumo saintiago"
1432
- body.order_id = "b4408b4d-17a0-4d39-85f2-f3da1e2825e9"
1433
- body.due_date = "2020-08-25T13:45:00"
1434
- body.type = "QR_CODE"
1435
-
1436
- begin
1437
- # Call the API
1438
- response = api_instance.generate_codi_code_qr(authorization, body, sales_point_id)
1439
- p response
1440
- rescue Wire4Client::ApiError => e
1441
- puts "Exception when calling the API: #{e.response_body}"
1442
- # Optional manage exception in call API
1443
- return
1444
- end
1445
- end
1446
-
1447
- ORDER_ID = "b4408b4d-17a0-4d39-85f2-f3da1e2825e9"
1448
-
1449
- #noinspection RubyInstanceMethodNamingConvention
1450
- def test_consult_codi_request_by_order_id
1451
- omit('Reason')
1452
- # Create the authenticator to obtain access token
1453
- # The token URL and Service URL are defined for this environment enum value.
1454
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1455
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1456
-
1457
- begin
1458
- # Obtain an access token use application flow and scope "codi_admin" and add to request
1459
- oauth_wire4.config_default_api_client
1460
- authorization = oauth_wire4.obtain_access_token_app_user(SALES_POINT_KEY, SALES_POINT_SECRET, 'codi_admin')
1461
- rescue Wire4Client::ApiError => e
1462
- puts "Exception to obtain access token #{e.response_body}"
1463
- # Optional manage exception in access token flow
1464
- return
1465
- end
1466
-
1467
- # create an instance of the API class
1468
- api_instance = Wire4Client::PeticionesDePagoPorCoDiApi.new
1469
-
1470
- # build body with info (check references for more info, types, required fields)
1471
- sales_point_id = SALES_POINT_ID # Sales point identifier
1472
- order_id = ORDER_ID # Order identifier
1473
-
1474
- begin
1475
- # Call the API
1476
- response = api_instance.consult_codi_request_by_order_id(authorization, order_id, sales_point_id)
1477
- p response
1478
- rescue Wire4Client::ApiError => e
1479
- puts "Exception when calling the API: #{e.response_body}"
1480
- # Optional manage exception in call API
1481
- return
1482
- end
1483
- end
1484
-
1485
- def test_consult_codi_operations
1486
- omit('Reason')
1487
- # Create the authenticator to obtain access token
1488
- # The token URL and Service URL are defined for this environment enum value.
1489
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1490
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1491
-
1492
- begin
1493
- # Obtain an access token use application flow and scope "codi_report" and add to request
1494
- oauth_wire4.config_default_api_client
1495
- authorization = oauth_wire4.obtain_access_token_app_user(SALES_POINT_KEY, SALES_POINT_SECRET, 'codi_report')
1496
- rescue Wire4Client::ApiError => e
1497
- puts "Exception to obtain access token #{e.response_body}"
1498
- # Optional manage exception in access token flow
1499
- return
1500
- end
1501
-
1502
- # create an instance of the API class
1503
- api_instance = Wire4Client::OperacionesCoDiApi.new
1504
-
1505
- # build body with info (check references for more info, types, required fields)
1506
- company_id = COMPANY_ID # Company identifier
1507
- sales_point_id = SALES_POINT_ID # Sales point identifier
1508
-
1509
- body = Wire4Client::CodiOperationsFiltersRequestDTO.new
1510
- # All filters options are optional
1511
- # order_id,
1512
- # operation_date_from, operation_date_to,
1513
- # request_date_from, request_date_to,
1514
- # status (RECEIVED, COMPLETED, CANCELLED),
1515
- # amount_from, amount_to
1516
- body.order_id = ORDER_ID
1517
-
1518
- begin
1519
- # Call the API
1520
- # consult_codi_operations(authorization, company_id: company_id, sales_point_id: sales_point_id,
1521
- # page: "0", size: "20")
1522
- # With filters:
1523
- # consult_codi_operations(authorization, company_id: company_id, sales_point_id: sales_point_id,
1524
- # page: "0", size: "20", request_filters: body)
1525
- response = api_instance.consult_codi_operations(authorization, company_id: company_id, sales_point_id: sales_point_id,
1526
- page: "0", size: "20", request_filters: body)
1527
- p response
1528
- rescue Wire4Client::ApiError => e
1529
- puts "Exception when calling the API: #{e.response_body}"
1530
- # Optional manage exception in call API
1531
- return
1532
- end
1533
- end
1534
-
1535
- ACCESS_KEY = "AccessK3y!" #"YOUR_ACCESS_KEY_HERE"
1536
- def test_obtain_contract_details
1537
- omit('Reason')
1538
- # Create the authenticator to obtain access token
1539
- # The token URL and Service URL are defined for this environment enum value.
1540
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1541
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1542
-
1543
- begin
1544
- # Obtain an access token use application flow and scope "general" and add to request
1545
- oauth_wire4.config_default_api_client
1546
- authorization = oauth_wire4.obtain_access_token_app('general')
1547
- rescue Wire4Client::ApiError => e
1548
- puts "Exception to obtain access token #{e.response_body}"
1549
- # Optional manage exception in access token flow
1550
- return
1551
- end
1552
-
1553
- # create an instance of the API class
1554
- api_instance = Wire4Client::ContractsDetailsApi.new
1555
-
1556
- # build body with info (check references for more info, types, required fields)
1557
- x_access_key = ACCESS_KEY
1558
- body = Wire4Client::ContractDetailRequest.new
1559
- body.contract = "1234567"
1560
- body.user_name = "amolina"
1561
- body.password = "whatever"
1562
- body.token_code = "258963"
1563
-
1564
- begin
1565
- # Call the API
1566
- response = api_instance.obtain_contract_details(authorization, x_access_key, body)
1567
- p response
1568
- rescue Wire4Client::ApiError => e
1569
- puts "Exception when calling the API: #{e.response_body}"
1570
- # Optional manage exception in call API
1571
- return
1572
- end
1573
- end
1574
-
1575
- def test_create_authorization
1576
- omit('Reason')
1577
- # Create the authenticator to obtain access token
1578
- # The token URL and Service URL are defined for this environment enum value.
1579
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1580
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1581
-
1582
- begin
1583
- # Obtain an access token use application flow and scope "general" and add to request
1584
- oauth_wire4.config_default_api_client
1585
- authorization = oauth_wire4.obtain_access_token_app('general')
1586
- rescue Wire4Client::ApiError => e
1587
- puts "Exception to obtain access token #{e.response_body}"
1588
- # Optional manage exception in access token flow
1589
- return
1590
- end
1591
-
1592
- # create an instance of the API class
1593
- api_instance = Wire4Client::ContractsDetailsApi.new
1594
-
1595
- # build body with info (check references for more info, types, required fields)
1596
- body = Wire4Client::PreMonexAuthorization.new
1597
- body.return_url = "https://your-app-url.mx/return"
1598
- body.cancel_return_url = "https://your-app-url.mx/cancel"
1599
- body.rfc = "TACO890101LO0"
1600
- body.business_name = "Compa Tacos"
1601
-
1602
- begin
1603
- # Call the API
1604
- response = api_instance.create_authorization(authorization, body)
1605
- p response
1606
- rescue Wire4Client::ApiError => e
1607
- puts "Exception when calling the API: #{e.response_body}"
1608
- # Optional manage exception in call API
1609
- return
1610
- end
1611
- end
1612
-
1613
- REQUEST_ID = "17fa79db-759f-4105-bc47-688fed75ddac"
1614
-
1615
- def test_obtain_authorized_users
1616
- omit('Reason')
1617
- # Create the authenticator to obtain access token
1618
- # The token URL and Service URL are defined for this environment enum value.
1619
- # e.g. for Sandbox environment: Wire4Auth::EnvironmentEnum::SANDBOX
1620
- oauth_wire4 = Wire4Auth::OAuthWire4.new(CLIENT_ID, CLIENT_SECRET, Wire4Auth::EnvironmentEnum::SANDBOX)
1621
-
1622
- begin
1623
- # Obtain an access token use application flow and scope "general" and add to request
1624
- oauth_wire4.config_default_api_client
1625
- authorization = oauth_wire4.obtain_access_token_app('general')
1626
- rescue Wire4Client::ApiError => e
1627
- puts "Exception to obtain access token #{e.response_body}"
1628
- # Optional manage exception in access token flow
1629
- return
1630
- end
1631
-
1632
- # create an instance of the API class
1633
- api_instance = Wire4Client::ContractsDetailsApi.new
1634
-
1635
- # build body with info (check references for more info, types, required fields)
1636
- x_access_key = ACCESS_KEY; # This ACCESS_KEY is provider from Wire4, contact support
1637
- request_id = REQUEST_ID
1638
-
1639
- begin
1640
- # Call the API
1641
- response = api_instance.obtain_authorized_users(authorization, x_access_key, request_id)
1642
- p response
1643
- rescue Wire4Client::ApiError => e
1644
- puts "Exception when calling the API: #{e.response_body}"
1645
- # Optional manage exception in call API
1646
- return
1647
- end
1648
- end
1649
- end