creditario-client 0.0.1.alpha → 0.0.2.alpha
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 +5 -5
- data/.gitlab-ci.yml +17 -0
- data/lib/creditario/api/request.rb +6 -0
- data/lib/creditario/client.rb +13 -1
- data/lib/creditario/client/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 911773f4ae802c4c7697a3cbc1e05f13cfe169fe40b1dde890be3ca7106b634c
|
|
4
|
+
data.tar.gz: 28b815bf72750fb7e0b83724841a92334a440ca7be7c670640ca65164b7bce0c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 78b7353e9f41ee459472f97e0620d4b02fdff2cc509f2bcf8c8beba8c23a5077dfddffdc138fbcb4f4a4a4d437c8a930387529c58b4da034773cdb8001a627b8
|
|
7
|
+
data.tar.gz: a0c981f93b3d99315cb8cb852568e50766e899e11472f77f5556d02cb63e472eec35278a07614da38a659a56daf84e436a6487ccfe93858e948a0bb2960cd17b
|
data/.gitlab-ci.yml
CHANGED
|
@@ -21,3 +21,20 @@ pages:
|
|
|
21
21
|
only:
|
|
22
22
|
- master # this job will affect only the 'master' branch
|
|
23
23
|
|
|
24
|
+
test:
|
|
25
|
+
stage: test
|
|
26
|
+
script:
|
|
27
|
+
- bundle exec rake test
|
|
28
|
+
only:
|
|
29
|
+
- branches
|
|
30
|
+
cache:
|
|
31
|
+
untracked: true
|
|
32
|
+
|
|
33
|
+
lint:
|
|
34
|
+
stage: test
|
|
35
|
+
script:
|
|
36
|
+
- bundle exec rubocop
|
|
37
|
+
only:
|
|
38
|
+
- branches
|
|
39
|
+
cache:
|
|
40
|
+
untracked: true
|
|
@@ -68,6 +68,7 @@ module Creditario # :nodoc:
|
|
|
68
68
|
|
|
69
69
|
def set_request_headers(request)
|
|
70
70
|
request = set_authorization_headers(request)
|
|
71
|
+
request = set_sandbox_header(request)
|
|
71
72
|
|
|
72
73
|
request["Accept"] = "application/vnd.creditar.v#{Creditario::Client.api_version}+json"
|
|
73
74
|
request["Content-Type"] = "application/json"
|
|
@@ -82,6 +83,11 @@ module Creditario # :nodoc:
|
|
|
82
83
|
request
|
|
83
84
|
end
|
|
84
85
|
|
|
86
|
+
def set_sandbox_header(request)
|
|
87
|
+
request["Application-Context"] = !Creditario::Client.sandbox || "sandbox"
|
|
88
|
+
request
|
|
89
|
+
end
|
|
90
|
+
|
|
85
91
|
def set_request_body(request, params)
|
|
86
92
|
request.body = params.to_json
|
|
87
93
|
request
|
data/lib/creditario/client.rb
CHANGED
|
@@ -58,6 +58,10 @@ module Creditario # :nodoc:
|
|
|
58
58
|
# Version a utilizar de la API de creditar.io
|
|
59
59
|
@api_version = 1
|
|
60
60
|
|
|
61
|
+
###
|
|
62
|
+
# Modo entorno de pruebas (Sandbox) por default es false
|
|
63
|
+
@sandbox = false
|
|
64
|
+
|
|
61
65
|
class << self
|
|
62
66
|
###
|
|
63
67
|
# La API Key es necesaria para cualquier interacción con la API de creditar.io
|
|
@@ -72,7 +76,7 @@ module Creditario # :nodoc:
|
|
|
72
76
|
###
|
|
73
77
|
# URL en la cual se ejecutarán las interacciones con la API de creditar.io
|
|
74
78
|
#
|
|
75
|
-
#
|
|
79
|
+
# Útil cuando se desea utilizar el ambiente de *staging* por ejemplo.
|
|
76
80
|
#
|
|
77
81
|
# ==== Ejemplo
|
|
78
82
|
#
|
|
@@ -84,6 +88,14 @@ module Creditario # :nodoc:
|
|
|
84
88
|
# Por default es 1
|
|
85
89
|
attr_accessor :api_version
|
|
86
90
|
|
|
91
|
+
###
|
|
92
|
+
# Modo entorno de pruebas (Sandbox)
|
|
93
|
+
#
|
|
94
|
+
# Útil cuando se desea obtener datos de entorno de pruebas.
|
|
95
|
+
#
|
|
96
|
+
# Por default es false
|
|
97
|
+
attr_accessor :sandbox
|
|
98
|
+
|
|
87
99
|
###
|
|
88
100
|
# Método de acceso al repositorio de Productos.
|
|
89
101
|
#
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: creditario-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2.alpha
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- michelada.io
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-05-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: oj
|
|
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
207
207
|
version: 1.3.1
|
|
208
208
|
requirements: []
|
|
209
209
|
rubyforge_project:
|
|
210
|
-
rubygems_version: 2.
|
|
210
|
+
rubygems_version: 2.7.7
|
|
211
211
|
signing_key:
|
|
212
212
|
specification_version: 4
|
|
213
213
|
summary: Ruby Client for the creditar.io API
|