transbank-sdk 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Dockerfile +1 -2
- data/Makefile +2 -2
- data/README.md +1 -1
- data/docker-compose.yml +1 -1
- data/lib/transbank/sdk/onepay/base.rb +10 -0
- data/lib/transbank/sdk/onepay/requests/transaction_create_request.rb +6 -1
- data/lib/transbank/sdk/onepay/utils/json_utils.rb +4 -0
- data/lib/transbank/sdk/onepay/utils/request_builder.rb +18 -10
- data/lib/transbank/sdk/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33b621b2e0a716808e5c98f3a76188d3816c094188e8e094f6b8b097b842687f
|
4
|
+
data.tar.gz: a88d80d79d4723224d988ccc258642efa8a4902c95535b2d1b3f8ead77948c2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 370f178eace68097e53e81dc271178235480213460d0ca7c81df213c4d3d6b705cfd143af4930fb8cf602069ac18a96317dd91e30400b88795689405b2ab6964
|
7
|
+
data.tar.gz: 2f6bc945ee3620294d750661ad91632f19bdbbb624d2182c34290ed6bf9662ed5f2bd8bfaf42037ac2e9da828a2b95254bafd756e5f213dbc5ba5072974f3399
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ Todos los cambios notables a este proyecto serán documentados en este archivo.
|
|
4
4
|
El formato está basado en [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
y este proyecto adhiere a [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [1.1.0] - 2018-04-08
|
8
|
+
### Added
|
9
|
+
- 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.
|
10
|
+
|
7
11
|
## [1.0.2] - 2018-11-29
|
8
12
|
### Fixed
|
9
13
|
- Corrige problema que evitaba poder utilizar un `CHANNEL` distinto a `WEB`
|
data/Dockerfile
CHANGED
data/Makefile
CHANGED
@@ -11,7 +11,7 @@ build: .built .bundled
|
|
11
11
|
docker-compose build
|
12
12
|
touch .built
|
13
13
|
|
14
|
-
.bundled: Gemfile
|
14
|
+
.bundled: Gemfile
|
15
15
|
docker-compose run --rm web bundle install
|
16
16
|
touch .bundled
|
17
17
|
|
@@ -21,4 +21,4 @@ logs:
|
|
21
21
|
clean:
|
22
22
|
docker-compose rm
|
23
23
|
rm .built
|
24
|
-
rm .bundled
|
24
|
+
rm .bundled
|
data/README.md
CHANGED
data/docker-compose.yml
CHANGED
@@ -55,6 +55,16 @@ module Transbank
|
|
55
55
|
# @return [String] One of the values from Channel.values
|
56
56
|
attr_reader :default_channel
|
57
57
|
|
58
|
+
# The width and height in pixels for the returned QR.
|
59
|
+
# @param [Integer]
|
60
|
+
# @return [Integer]
|
61
|
+
attr_accessor :qr_width_height
|
62
|
+
|
63
|
+
# The url of the commerce logo to be displayed in the Onepay mobile app.
|
64
|
+
# @param [String]
|
65
|
+
# @return [String]
|
66
|
+
attr_accessor :commerce_logo_url
|
67
|
+
|
58
68
|
# @return [String] the URL that is used by the current integration type
|
59
69
|
def current_integration_type_url
|
60
70
|
@integration_types[@integration_type]
|
@@ -5,7 +5,8 @@ module Transbank
|
|
5
5
|
include Request
|
6
6
|
|
7
7
|
attr_accessor :external_unique_number, :total, :items_quantity, :issued_at,
|
8
|
-
:items, :callback_url, :channel, :app_scheme, :signature
|
8
|
+
:items, :callback_url, :channel, :app_scheme, :signature,
|
9
|
+
:commerce_logo_url, :width_height
|
9
10
|
attr_reader :generate_ott_qr_code
|
10
11
|
|
11
12
|
SIGNATURE_PARAMS = [:external_unique_number,
|
@@ -24,6 +25,8 @@ module Transbank
|
|
24
25
|
# are on the [Channel] class
|
25
26
|
# @param app_scheme [String] identificator for the Merchant's app
|
26
27
|
# @param signature [String, nil] a hashstring created for verification purposes
|
28
|
+
# @param commerce_logo_url [String] The URL pointing to the Merchant's logo
|
29
|
+
# @param width_height [Numeric] qr width and height used by the frontend JS SDK.
|
27
30
|
def initialize(opts = {})
|
28
31
|
self.external_unique_number = opts.fetch(:external_unique_number)
|
29
32
|
self.total = opts.fetch(:total)
|
@@ -35,6 +38,8 @@ module Transbank
|
|
35
38
|
self.channel = channel
|
36
39
|
self.app_scheme = opts.fetch(:app_scheme, '')
|
37
40
|
self.signature = nil
|
41
|
+
self.commerce_logo_url = opts.fetch(:commerce_logo_url)
|
42
|
+
self.width_height = opts.fetch(:width_height)
|
38
43
|
# This is never anything but true, but it is required by the server
|
39
44
|
@generate_ott_qr_code = true
|
40
45
|
end
|
@@ -40,6 +40,10 @@ module Transbank
|
|
40
40
|
end
|
41
41
|
resulting_hash
|
42
42
|
end
|
43
|
+
# Some values can't be null and must be removed if they are
|
44
|
+
instance_as_hash.reject! do |key, value|
|
45
|
+
%w[commerce_logo_url width_height].include?(key) && value.nil?
|
46
|
+
end
|
43
47
|
JSON.generate instance_as_hash
|
44
48
|
end
|
45
49
|
|
@@ -15,14 +15,18 @@ module Transbank
|
|
15
15
|
options = complete_options(options)
|
16
16
|
issued_at = Time.now.to_i
|
17
17
|
|
18
|
-
request = TransactionCreateRequest.new(
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
request = TransactionCreateRequest.new(
|
19
|
+
external_unique_number: external_unique_number,
|
20
|
+
total: shopping_cart.total,
|
21
|
+
items_quantity: shopping_cart.items_quantity,
|
22
|
+
issued_at: issued_at,
|
23
|
+
items: shopping_cart.items,
|
24
|
+
callback_url: Base.callback_url,
|
25
|
+
channel: channel,
|
26
|
+
app_scheme: Base.app_scheme,
|
27
|
+
commerce_logo_url: options[:commerce_logo_url],
|
28
|
+
width_height: options[:qr_width_height]
|
29
|
+
)
|
26
30
|
request.set_keys_from_options(options)
|
27
31
|
request.app_key = Base::current_integration_type_app_key
|
28
32
|
request.sign(options.fetch(:shared_secret))
|
@@ -79,8 +83,12 @@ module Transbank
|
|
79
83
|
# shared_secret: Base::shared_secret
|
80
84
|
# @return [Hash] a hash with the aforementioned keys/values
|
81
85
|
def default_options
|
82
|
-
{
|
83
|
-
|
86
|
+
{
|
87
|
+
api_key: Base::api_key,
|
88
|
+
shared_secret: Base::shared_secret,
|
89
|
+
commerce_logo_url: Base::commerce_logo_url,
|
90
|
+
qr_width_height: Base::qr_width_height
|
91
|
+
}
|
84
92
|
end
|
85
93
|
end
|
86
94
|
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: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Transbank Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -212,8 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
212
|
- !ruby/object:Gem::Version
|
213
213
|
version: '0'
|
214
214
|
requirements: []
|
215
|
-
|
216
|
-
rubygems_version: 2.7.8
|
215
|
+
rubygems_version: 3.0.3
|
217
216
|
signing_key:
|
218
217
|
specification_version: 4
|
219
218
|
summary: Transbank SDK for Ruby
|