transbank-sdk 3.0.0 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 0da69d29f9e4d6a1ec20aa068d1b5f96489d3ef09677d32c8489b19196c01e94
4
- data.tar.gz: 84c5739eb799a97ef0e4f69e0ca2765aa911351f16e34d075599062c3e24a1e3
2
+ SHA1:
3
+ metadata.gz: 8a59bcc8731edabd8b65c29379086457abeda4a5
4
+ data.tar.gz: 81f4a5421ea4633ada33442ab969a05db18bd5f8
5
5
  SHA512:
6
- metadata.gz: 4773adc503cd8410601d9ba32d04011339d21b638088077998d11bafab5d5ffed7ff6ce65efaeb9fe1fa7de2c86e9e6bc8e4554ff68e2f5ae352e0abcb36f224
7
- data.tar.gz: f744b9aee837b30e2d228dbc96db66570ed53c10788af624d8b26897fbd9574d3bd0515c3eacc882c5e1e63b63c7d3f318989a173365f09a0bfb183174ad1c9b
6
+ metadata.gz: e1053b5266297a8b7641823aeee4bbac4867e7ffcf0f5ec5bb1471d64c1be343d23492b3a3ed1cefce1fcfcadccbf5920f215e0014c7d5ae5daa617bbba92f33
7
+ data.tar.gz: 846f79b2912f876228f70e3e360603cd31ff040e863b2fcc4b90f5cd6b7dfde9bb7508e88f588001fe134ea2a667a5cd441375616328cae161c3c954bdf20424
@@ -0,0 +1,55 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+
6
+ # GitHub recommends pinning actions to a commit SHA.
7
+ # To get a newer version, you will need to update the SHA.
8
+ # You can also reference a tag or branch, but the action may change without warning.
9
+
10
+ name: Publish Ruby Gem
11
+
12
+ on:
13
+ push:
14
+ tags:
15
+ - '*'
16
+
17
+ jobs:
18
+ build:
19
+ name: Build + Publish
20
+ runs-on: ubuntu-latest
21
+ permissions:
22
+ packages: write
23
+ contents: read
24
+
25
+ steps:
26
+ - uses: actions/checkout@v3
27
+ - name: Set up Ruby 2.4
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: 2.4
31
+ - run: |
32
+ bundle install
33
+
34
+ - name: Publish to GPR
35
+ run: |
36
+ mkdir -p $HOME/.gem
37
+ touch $HOME/.gem/credentials
38
+ chmod 0600 $HOME/.gem/credentials
39
+ printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
40
+ gem build *.gemspec
41
+ gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
42
+ env:
43
+ GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
44
+ OWNER: ${{ github.repository_owner }}
45
+
46
+ - name: Publish to RubyGems
47
+ run: |
48
+ mkdir -p $HOME/.gem
49
+ touch $HOME/.gem/credentials
50
+ chmod 0600 $HOME/.gem/credentials
51
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
52
+ gem build *.gemspec
53
+ gem push *.gem
54
+ env:
55
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
data/CHANGELOG.md CHANGED
@@ -1,10 +1,21 @@
1
1
  # Changelog
2
+
2
3
  Todos los cambios notables a este proyecto serán documentados en este archivo.
3
4
 
4
5
  El formato está basado en [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
6
  y este proyecto adhiere a [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
7
 
7
- ## [4.0.0] - 2022-09-19
8
+ ## [3.0.2] - 2023-03-7
9
+
10
+ ### Fixed
11
+
12
+ - Se corrige el manejo de errores del método delete en Oneclick Mall
13
+
14
+ ## Added
15
+
16
+ - En caso de error se verifica si el response tiene body y en caso de no tenerlo se retorna el status
17
+
18
+ ## [3.0.0] - 2022-09-19
8
19
 
9
20
  ### Fixed
10
21
 
@@ -19,7 +30,9 @@ y este proyecto adhiere a [Semantic Versioning](http://semver.org/spec/v2.0.0.ht
19
30
  - Se agrega los métodos 'increaseAmount', 'increaseAuthorizationDate', 'reversePreAuthorizedAmount', 'deferredCaptureHistory' a las versiones diferidas de WebpayPlus, WebpayPlus Mall, Oneclick Mall, Transaccion Completa y Transaccion Completa Mall
20
31
 
21
32
  ## [2.0.1] - 2022-06-14
33
+
22
34
  ### Fixed
35
+
23
36
  - Se soluciona error en método refund para transacciones Webpay Plus Mall. Muchas gracias por tu aporte @danirod
24
37
 
25
38
  ## [2.0.0] - 2022-01-03
@@ -46,25 +59,34 @@ y este proyecto adhiere a [Semantic Versioning](http://semver.org/spec/v2.0.0.ht
46
59
  - Se agrega un módulo de constantes con las claves de comercio de integración: 'IntegrationApiKeys'
47
60
 
48
61
  ## [1.5.1] - 2021-04-12
62
+
49
63
  ### Added
64
+
50
65
  - Se agrega captura diferida en Transacción Completa y Transacción Completa Mall
51
66
 
52
67
  ## [1.4.1] - 2021-03-30
68
+
53
69
  ### Fixed
70
+
54
71
  - Se agrega parámetro de estado faltante en respuesta de Commit y Status en Webpay Plus
55
72
  - Se agrega dependencia JSON (~> 2.0) para evitar problemas al recibir respuesta de Commit
56
73
  - Se arregla endpoint de captura en Webpay Plus
57
74
 
58
75
  ## [1.4.0] - 2020-12-03
76
+
59
77
  ### Added
78
+
60
79
  - Se agregan métodos de configuración para integración a Webpay Plus en sus modalidades diferidas y mall diferida.
61
80
  - Se agregan métodos de configuración para integración a Webpay Oneclick en su modalidad mall diferida.
62
81
 
63
82
  ### Fixed
83
+
64
84
  - Se arregla forma en que se lee configuración del SDK, estaba tomando valores de una constante en vez de la variable de clase correspondiente. Este arreglo es para todos los productos con la excepción de Onepay
65
85
 
66
86
  ## [1.3.1] - 2020-10-29
87
+
67
88
  ### Fixed
89
+
68
90
  - Se revierte commit que elimina requires necesarios para productos REST
69
91
 
70
92
  ## [1.3.0] - 2020-10-26
@@ -72,33 +94,43 @@ y este proyecto adhiere a [Semantic Versioning](http://semver.org/spec/v2.0.0.ht
72
94
  ### Added
73
95
 
74
96
  - Se agrega soporte para:
75
- - Webpay Plus Rest
76
- - modalidad normal
77
- - modalidad captura diferida
78
- - modalidad mall
79
- - modalidad mall captura diferida
80
- - Patpass by Webpay Rest
81
- - Patpass Comercio Rest
82
- - Transacción completa Rest
83
- - modalidad mall
84
- - Oneclick Mall Captura diferida
97
+ - Webpay Plus Rest
98
+ - modalidad normal
99
+ - modalidad captura diferida
100
+ - modalidad mall
101
+ - modalidad mall captura diferida
102
+ - Patpass by Webpay Rest
103
+ - Patpass Comercio Rest
104
+ - Transacción completa Rest
105
+ - modalidad mall
106
+ - Oneclick Mall Captura diferida
85
107
 
86
108
  ## [1.2.0] - 2019-12-26
109
+
87
110
  ### Added
111
+
88
112
  - Se agrega soporte para Oneclick Mall y Transacción Completa en sus versiones REST.
89
113
 
90
114
  ## [1.1.0] - 2018-04-08
115
+
91
116
  ### Added
117
+
92
118
  - Se agregaron los parámetros `qr_width_height` y `commerce_logo_url` a Options, para definir el tamaño del QR generado para la transacción, y especificar la ubicación del logo de comercio para ser mostrado en la aplicación móvil de Onepay. Puedes configurar estos parámetros globalmente o por transacción.
93
119
 
94
120
  ## [1.0.2] - 2018-11-29
121
+
95
122
  ### Fixed
123
+
96
124
  - Corrige problema que evitaba poder utilizar un `CHANNEL` distinto a `WEB`
97
125
 
98
126
  ## [1.0.1] - 2018-10-24
127
+
99
128
  ### Fixed
129
+
100
130
  - Cambios para subir automáticamente la gema a RubyGems cuando se hace un nuevo release
101
131
 
102
132
  ## [1.0.0] - 2018-10-23
133
+
103
134
  ### Added
135
+
104
136
  - Primer lanzamiento del SDK
data/README.md CHANGED
@@ -82,4 +82,4 @@ En ese PR deben incluirse los siguientes cambios:
82
82
 
83
83
  Luego de obtener aprobación del pull request, debe mezclarse a master e inmediatamente generar un release en GitHub con el tag `vX.Y.Z`. En la descripción del release debes poner lo mismo que agregaste al changelog.
84
84
 
85
- Con eso Travis CI generará automáticamente una nueva versión de la librería y la publicará en RubyGems.
85
+ Con eso Github Actions generará automáticamente una nueva versión de la librería y la publicará en RubyGems.
@@ -46,16 +46,22 @@ module Transbank
46
46
  http_method = build_method(method, uri, body)
47
47
 
48
48
  response = http.request(http_method)
49
+
49
50
  if response.is_a? Net::HTTPSuccess
50
- return nil if response.body.empty?
51
+ return nil if response.body.nil? || response.body.empty?
51
52
  return JSON.parse(response.body)
52
53
  end
53
- body = JSON.parse(response.body)
54
- if body.key?("description")
55
- raise TransbankError, "Transbank Error: #{body['code']} - #{body['description']}"
56
- else
57
- raise TransbankError, "Transbank Error: #{body['error_message']}"
54
+
55
+ if !response.body.blank?
56
+ body = JSON.parse(response.body)
57
+ if body.key?("description")
58
+ raise TransbankError, "Transbank Error: #{body['code']} - #{body['description']}"
59
+ else
60
+ raise TransbankError, "Transbank Error: #{body['error_message']}"
61
+ end
58
62
  end
63
+
64
+ raise TransbankError, "Transbank Error: HTTP-STATUS #{response&.code}"
59
65
  end
60
66
 
61
67
  def build_client
@@ -1,5 +1,5 @@
1
1
  module Transbank
2
2
  module Sdk
3
- VERSION = '3.0.0'
3
+ VERSION = '3.0.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transbank-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Transbank Developers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-19 00:00:00.000000000 Z
11
+ date: 2023-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -160,9 +160,9 @@ files:
160
160
  - ".built"
161
161
  - ".bundled"
162
162
  - ".github/ISSUE_TEMPLATE/reporte-de-error.md"
163
+ - ".github/workflows/publish-lib.yml"
163
164
  - ".gitignore"
164
165
  - ".rakeTasks"
165
- - ".travis.yml"
166
166
  - CHANGELOG.md
167
167
  - Dockerfile
168
168
  - Gemfile
@@ -212,7 +212,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
212
  - !ruby/object:Gem::Version
213
213
  version: '0'
214
214
  requirements: []
215
- rubygems_version: 3.0.8
215
+ rubyforge_project:
216
+ rubygems_version: 2.6.14.4
216
217
  signing_key:
217
218
  specification_version: 4
218
219
  summary: Transbank SDK for Ruby
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- deploy:
2
- provider: rubygems
3
- api_key:
4
- secure: Y3z7qW8UhuDi0AqMr9T6ti46w3jLuLDRLuHUBTff80lYAZhBwCNj7U9UvlgELTiOC/nLREtboGW5ZUf3XIIiRr2oIqCSSWYVR6OCuPGTHS/hvGBi0T5jEL30/YuIEbIuz3xkXqN15WlOouKVgfPsNcL8mfLZBZMHQ9QwB6P0E2rg2GZj1QVqAUjnn/JGet0d2EJb48YyndN4nGVhaXXUQhcyyy1+XWEkC3nCo6v1dwE5pS8QK4kcRevRvL9G8mebxX74IuIbgW2bXBHPLNUbuUOHuNNUrrNIJDFUf8xXouLDT5QN4CsoldcgSIGuBvcJlmoubQFfju4iuGt/xnL8BtsKDy3iZ+xnIji6h7MGNAOpiZ7e2LavGvO5luYVEpuv2iG9V/FpJY5DJcBZ8779LnA97NAV7bz383tjihCfR9kzUh5rs2To42FV0IQj0btWuGesVmPefWjwV/EzjmbN0+PhNmxDwQAJS49cHycZKTeestaR4MgHigXZ2CGRAJSKYr3Tj7/r8KZW6MGY6KgXiwjpu+d3+UidAwI1viiRrCGuWBALkAAaxGR0H8qamMsJr/DQtjAgXDITRlAScpWzicgvEEHyXTos45EIrsJZV72O/jj8Zvbw83rEMv8It3yCS43deLsyw+5a4i9y9HFKuGQPa8w7yR1xEOnh6G3AiWY=
5
- gem: transbank-sdk
6
- on:
7
- tags: true
8
- repo: TransbankDevelopers/transbank-sdk-ruby
9
- rvm:
10
- - 2.4.1