tbk-sdk 1.5.0.pre.ruby2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.built +0 -0
- data/.bundled +0 -0
- data/.github/ISSUE_TEMPLATE/reporte-de-error.md +40 -0
- data/.gitignore +16 -0
- data/.rakeTasks +7 -0
- data/.travis.yml +10 -0
- data/CHANGELOG.md +63 -0
- data/Dockerfile +5 -0
- data/Gemfile +6 -0
- data/LICENSE.md +11 -0
- data/Makefile +24 -0
- data/README.md +87 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docker-compose.yml +20 -0
- data/lib/transbank/sdk/oneclick/base.rb +64 -0
- data/lib/transbank/sdk/oneclick/errors/oneclick_error.rb +16 -0
- data/lib/transbank/sdk/oneclick/inscription/errors/mall_inscription_delete_error.rb +16 -0
- data/lib/transbank/sdk/oneclick/inscription/errors/mall_inscription_finish_error.rb +16 -0
- data/lib/transbank/sdk/oneclick/inscription/errors/mall_inscription_start_error.rb +16 -0
- data/lib/transbank/sdk/oneclick/inscription/errors/oneclick_mall_inscription_errors.rb +3 -0
- data/lib/transbank/sdk/oneclick/inscription/inscription.rb +3 -0
- data/lib/transbank/sdk/oneclick/inscription/responses/mall_inscription_delete_response.rb +18 -0
- data/lib/transbank/sdk/oneclick/inscription/responses/mall_inscription_finish_response.rb +15 -0
- data/lib/transbank/sdk/oneclick/inscription/responses/mall_inscription_start_response.rb +14 -0
- data/lib/transbank/sdk/oneclick/inscription/responses/oneclick_mall_inscription_responses.rb +3 -0
- data/lib/transbank/sdk/oneclick/mall/errors/mall_transaction_authorize_error.rb +16 -0
- data/lib/transbank/sdk/oneclick/mall/errors/mall_transaction_refund_error.rb +16 -0
- data/lib/transbank/sdk/oneclick/mall/errors/mall_transaction_status_error.rb +16 -0
- data/lib/transbank/sdk/oneclick/mall/errors/oneclick_mall_errors.rb +4 -0
- data/lib/transbank/sdk/oneclick/mall/mall_inscription.rb +73 -0
- data/lib/transbank/sdk/oneclick/mall/mall_transaction.rb +97 -0
- data/lib/transbank/sdk/oneclick/mall/oneclick_mall.rb +4 -0
- data/lib/transbank/sdk/oneclick/mall/responses/mall_transaction_authorize_response.rb +16 -0
- data/lib/transbank/sdk/oneclick/mall/responses/mall_transaction_refund_response.rb +16 -0
- data/lib/transbank/sdk/oneclick/mall/responses/mall_transaction_status_response.rb +15 -0
- data/lib/transbank/sdk/oneclick/mall/responses/oneclick_mall_responses.rb +4 -0
- data/lib/transbank/sdk/oneclick/mall_deferred/errors/mall_deferred_transaction_capture_error.rb +16 -0
- data/lib/transbank/sdk/oneclick/mall_deferred/mall_deferred_inscription.rb +20 -0
- data/lib/transbank/sdk/oneclick/mall_deferred/mall_deferred_transaction.rb +42 -0
- data/lib/transbank/sdk/oneclick/mall_deferred/responses/mall_deferred_transaction_capture_response.rb +16 -0
- data/lib/transbank/sdk/oneclick/oneclick.rb +12 -0
- data/lib/transbank/sdk/onepay/base.rb +125 -0
- data/lib/transbank/sdk/onepay/errors/errors.rb +17 -0
- data/lib/transbank/sdk/onepay/errors/integration_type_error.rb +8 -0
- data/lib/transbank/sdk/onepay/errors/invalid_options_error.rb +8 -0
- data/lib/transbank/sdk/onepay/errors/item_error.rb +8 -0
- data/lib/transbank/sdk/onepay/errors/refund_create_error.rb +8 -0
- data/lib/transbank/sdk/onepay/errors/response_error.rb +8 -0
- data/lib/transbank/sdk/onepay/errors/shopping_cart_error.rb +8 -0
- data/lib/transbank/sdk/onepay/errors/signature_error.rb +8 -0
- data/lib/transbank/sdk/onepay/errors/transaction_commit_error.rb +8 -0
- data/lib/transbank/sdk/onepay/errors/transaction_create_error.rb +8 -0
- data/lib/transbank/sdk/onepay/errors/transbank_error.rb +9 -0
- data/lib/transbank/sdk/onepay/models/channels.rb +15 -0
- data/lib/transbank/sdk/onepay/models/item.rb +103 -0
- data/lib/transbank/sdk/onepay/models/models.rb +10 -0
- data/lib/transbank/sdk/onepay/models/refund.rb +50 -0
- data/lib/transbank/sdk/onepay/models/shopping_cart.rb +65 -0
- data/lib/transbank/sdk/onepay/models/transaction.rb +143 -0
- data/lib/transbank/sdk/onepay/requests/refund_create_request.rb +45 -0
- data/lib/transbank/sdk/onepay/requests/request.rb +18 -0
- data/lib/transbank/sdk/onepay/requests/requests.rb +9 -0
- data/lib/transbank/sdk/onepay/requests/transaction_commit_request.rb +48 -0
- data/lib/transbank/sdk/onepay/requests/transaction_create_request.rb +85 -0
- data/lib/transbank/sdk/onepay/responses/refund_create_response.rb +24 -0
- data/lib/transbank/sdk/onepay/responses/response.rb +18 -0
- data/lib/transbank/sdk/onepay/responses/responses.rb +9 -0
- data/lib/transbank/sdk/onepay/responses/transaction_commit_response.rb +39 -0
- data/lib/transbank/sdk/onepay/responses/transaction_create_response.rb +32 -0
- data/lib/transbank/sdk/patpass/errors/integration_type_error.rb +8 -0
- data/lib/transbank/sdk/patpass/errors/patpass_error.rb +15 -0
- data/lib/transbank/sdk/patpass/patpass_by_webpay/base.rb +47 -0
- data/lib/transbank/sdk/patpass/patpass_by_webpay/errors/patpass_by_webpay_errors.rb +12 -0
- data/lib/transbank/sdk/patpass/patpass_by_webpay/errors/transaction_commit_error.rb +15 -0
- data/lib/transbank/sdk/patpass/patpass_by_webpay/errors/transaction_create_error.rb +15 -0
- data/lib/transbank/sdk/patpass/patpass_by_webpay/errors/transaction_status_error.rb +15 -0
- data/lib/transbank/sdk/patpass/patpass_by_webpay/options.rb +9 -0
- data/lib/transbank/sdk/patpass/patpass_by_webpay/patpass_by_webpay.rb +16 -0
- data/lib/transbank/sdk/patpass/patpass_by_webpay/responses/patpass_by_webpay_responses.rb +3 -0
- data/lib/transbank/sdk/patpass/patpass_by_webpay/responses/transaction_commit_response.rb +20 -0
- data/lib/transbank/sdk/patpass/patpass_by_webpay/responses/transaction_create_response.rb +15 -0
- data/lib/transbank/sdk/patpass/patpass_by_webpay/responses/transaction_status_response.rb +21 -0
- data/lib/transbank/sdk/patpass/patpass_by_webpay/transaction.rb +93 -0
- data/lib/transbank/sdk/patpass/patpass_comercio/base.rb +47 -0
- data/lib/transbank/sdk/patpass/patpass_comercio/errors/inscription_start_error.rb +15 -0
- data/lib/transbank/sdk/patpass/patpass_comercio/errors/inscription_status_error.rb +15 -0
- data/lib/transbank/sdk/patpass/patpass_comercio/errors/patpass_comercio_errors.rb +2 -0
- data/lib/transbank/sdk/patpass/patpass_comercio/inscription.rb +79 -0
- data/lib/transbank/sdk/patpass/patpass_comercio/options.rb +9 -0
- data/lib/transbank/sdk/patpass/patpass_comercio/patpass_comercio.rb +5 -0
- data/lib/transbank/sdk/patpass/patpass_comercio/responses/inscription_start_response.rb +13 -0
- data/lib/transbank/sdk/patpass/patpass_comercio/responses/inscription_status_response.rb +13 -0
- data/lib/transbank/sdk/patpass/patpass_comercio/responses/patpass_comercio_responses.rb +2 -0
- data/lib/transbank/sdk/transaccion_completa/base.rb +51 -0
- data/lib/transbank/sdk/transaccion_completa/errors/transaccion_completa_error.rb +16 -0
- data/lib/transbank/sdk/transaccion_completa/errors/transaccion_completa_errors.rb +7 -0
- data/lib/transbank/sdk/transaccion_completa/errors/transaction_capture_error.rb +14 -0
- data/lib/transbank/sdk/transaccion_completa/errors/transaction_commit_error.rb +14 -0
- data/lib/transbank/sdk/transaccion_completa/errors/transaction_create_error.rb +14 -0
- data/lib/transbank/sdk/transaccion_completa/errors/transaction_installments_error.rb +14 -0
- data/lib/transbank/sdk/transaccion_completa/errors/transaction_refund_error.rb +14 -0
- data/lib/transbank/sdk/transaccion_completa/errors/transaction_status_error.rb +14 -0
- data/lib/transbank/sdk/transaccion_completa/mall/mall_transaction.rb +197 -0
- data/lib/transbank/sdk/transaccion_completa/mall/responses/mall_transaction_capture_response.rb +12 -0
- data/lib/transbank/sdk/transaccion_completa/mall/responses/mall_transaction_commit_response.rb +15 -0
- data/lib/transbank/sdk/transaccion_completa/mall/responses/mall_transaction_installments_response.rb +11 -0
- data/lib/transbank/sdk/transaccion_completa/mall/responses/mall_transaction_responses.rb +4 -0
- data/lib/transbank/sdk/transaccion_completa/mall/responses/mall_transaction_status_response.rb +14 -0
- data/lib/transbank/sdk/transaccion_completa/options.rb +7 -0
- data/lib/transbank/sdk/transaccion_completa/responses/transaccion_completa_responses.rb +6 -0
- data/lib/transbank/sdk/transaccion_completa/responses/transaction_capture_response.rb +12 -0
- data/lib/transbank/sdk/transaccion_completa/responses/transaction_commit_response.rb +16 -0
- data/lib/transbank/sdk/transaccion_completa/responses/transaction_create_response.rb +10 -0
- data/lib/transbank/sdk/transaccion_completa/responses/transaction_installments_response.rb +13 -0
- data/lib/transbank/sdk/transaccion_completa/responses/transaction_refund_response.rb +14 -0
- data/lib/transbank/sdk/transaccion_completa/responses/transaction_status_response.rb +16 -0
- data/lib/transbank/sdk/transaccion_completa/transaccion_completa.rb +7 -0
- data/lib/transbank/sdk/transaccion_completa/transaction.rb +144 -0
- data/lib/transbank/sdk/transbank_error.rb +6 -0
- data/lib/transbank/sdk/utils/json_utils.rb +75 -0
- data/lib/transbank/sdk/utils/net_helper.rb +82 -0
- data/lib/transbank/sdk/utils/request_builder.rb +96 -0
- data/lib/transbank/sdk/utils/signature_utils.rb +49 -0
- data/lib/transbank/sdk/utils/utils.rb +9 -0
- data/lib/transbank/sdk/version.rb +5 -0
- data/lib/transbank/sdk/webpay/errors/integration_type_error.rb +8 -0
- data/lib/transbank/sdk/webpay/errors/webpay_error.rb +14 -0
- data/lib/transbank/sdk/webpay/webpay_plus/base.rb +74 -0
- data/lib/transbank/sdk/webpay/webpay_plus/deferred/deferred_transaction.rb +108 -0
- data/lib/transbank/sdk/webpay/webpay_plus/deferred/errors/transaction_capture_error.rb +16 -0
- data/lib/transbank/sdk/webpay/webpay_plus/deferred/errors/webpay_plus_deferred_errors.rb +1 -0
- data/lib/transbank/sdk/webpay/webpay_plus/deferred/responses/transaction_capture_response.rb +22 -0
- data/lib/transbank/sdk/webpay/webpay_plus/deferred/responses/webpay_plus_deferred_responses.rb +1 -0
- data/lib/transbank/sdk/webpay/webpay_plus/errors/transaction_commit_error.rb +17 -0
- data/lib/transbank/sdk/webpay/webpay_plus/errors/transaction_create_error.rb +16 -0
- data/lib/transbank/sdk/webpay/webpay_plus/errors/transaction_refund_error.rb +16 -0
- data/lib/transbank/sdk/webpay/webpay_plus/errors/transaction_status_error.rb +16 -0
- data/lib/transbank/sdk/webpay/webpay_plus/errors/webpay_plus_errors.rb +13 -0
- data/lib/transbank/sdk/webpay/webpay_plus/mall/mall_transaction.rb +88 -0
- data/lib/transbank/sdk/webpay/webpay_plus/mall/responses/mall_transaction_commit_response.rb +23 -0
- data/lib/transbank/sdk/webpay/webpay_plus/mall/responses/mall_transaction_status_response.rb +21 -0
- data/lib/transbank/sdk/webpay/webpay_plus/mall/responses/webpay_plus_mall_responses.rb +2 -0
- data/lib/transbank/sdk/webpay/webpay_plus/mall_deferred/mall_deferred_transaction.rb +109 -0
- data/lib/transbank/sdk/webpay/webpay_plus/options.rb +9 -0
- data/lib/transbank/sdk/webpay/webpay_plus/responses/transaction_commit_response.rb +20 -0
- data/lib/transbank/sdk/webpay/webpay_plus/responses/transaction_create_response.rb +15 -0
- data/lib/transbank/sdk/webpay/webpay_plus/responses/transaction_refund_response.rb +19 -0
- data/lib/transbank/sdk/webpay/webpay_plus/responses/transaction_status_response.rb +21 -0
- data/lib/transbank/sdk/webpay/webpay_plus/responses/webpay_plus_responses.rb +4 -0
- data/lib/transbank/sdk/webpay/webpay_plus/transaction.rb +89 -0
- data/lib/transbank/sdk/webpay/webpay_plus/webpay_plus.rb +24 -0
- data/lib/transbank/sdk.rb +27 -0
- data/sdk_test.sh +2 -0
- data/transbank-sdk.gemspec +35 -0
- metadata +340 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7203860bdc591c825f096a01225c33ea3a1e32921a0c207014fdc704c496d099
|
4
|
+
data.tar.gz: 949595ed5790f89f3059367657674800618c44fe8e803e1365e1f44c7419bf70
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: af8ba797a204f8c1fe24845602ec0b8f82a5585c50fd8cc2adb1ebe1f38be9441a35e02669c32cc54fa67cf8333f97969be7fa999b4f493c92065457a4aa899a
|
7
|
+
data.tar.gz: 921866efa565682ee7f03f1e7b8eb00cddffc04fc8233e3701fbd07cd076433eee67e51269f2093fee7e14827d5eb7152aafbe1e246b9e60c87ebdbf3dd2bfef
|
data/.built
ADDED
File without changes
|
data/.bundled
ADDED
File without changes
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
name: Reporte de Error
|
3
|
+
about: Crea un reporte para ayudarnos a mejorar
|
4
|
+
title: ''
|
5
|
+
labels: bug
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Describe el bug**
|
11
|
+
|
12
|
+
Una descripción concisa sobre el bug.
|
13
|
+
|
14
|
+
**Para reproducir**
|
15
|
+
|
16
|
+
1. Configura '...'
|
17
|
+
2. Crea un objeto '...'
|
18
|
+
3. Ejecuta el método '...'
|
19
|
+
4. Se ve el error en '...'
|
20
|
+
|
21
|
+
**Comportamiento observado**
|
22
|
+
|
23
|
+
Describe de forma concisa lo que observaste siguiendo los pasos para reproducir el error.
|
24
|
+
|
25
|
+
**Comportamiento esperado**
|
26
|
+
|
27
|
+
Una explicación concisa y clara de qué es lo que esperas que ocurra.
|
28
|
+
|
29
|
+
**Capturas de pantalla**
|
30
|
+
|
31
|
+
Si aplica, agrega aquí capturas de pantalla que ayuden a explicar tu problema.
|
32
|
+
|
33
|
+
**Versiones (por favor agrega aquí la siguiente información):**
|
34
|
+
- SDK: [e.g. 1.1.0]
|
35
|
+
- Ruby: [e.g. 2.5.2]
|
36
|
+
- Bundler: [e.g. 2.0.1]
|
37
|
+
|
38
|
+
**Contexto adicional**
|
39
|
+
|
40
|
+
Agrega cualquier otro información sobre el problema aquí.
|
data/.gitignore
ADDED
data/.rakeTasks
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
+
You are allowed to:
|
4
|
+
1. Remove rake task
|
5
|
+
2. Add existing rake tasks
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build transbank-sdk-1.1.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install transbank-sdk-1.1.0.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install transbank-sdk-1.1.0.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v1.1.0 and build and push transbank-sdk-1.1.0.gem to rubygems.org" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run tests" fullCmd="test" taksId="test" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
|
data/.travis.yml
ADDED
@@ -0,0 +1,10 @@
|
|
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
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Changelog
|
2
|
+
Todos los cambios notables a este proyecto serán documentados en este archivo.
|
3
|
+
|
4
|
+
El formato está basado en [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
|
+
y este proyecto adhiere a [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [1.5.1] - 2021-04-12
|
8
|
+
### Added
|
9
|
+
- Se agrega captura diferida en Transacción Completa y Transacción Completa Mall
|
10
|
+
|
11
|
+
## [1.4.1] - 2021-03-30
|
12
|
+
### Fixed
|
13
|
+
- Se agrega parámetro de estado faltante en respuesta de Commit y Status en Webpay Plus
|
14
|
+
- Se agrega dependencia JSON (~> 2.0) para evitar problemas al recibir respuesta de Commit
|
15
|
+
- Se arregla endpoint de captura en Webpay Plus
|
16
|
+
|
17
|
+
## [1.4.0] - 2020-12-03
|
18
|
+
### Added
|
19
|
+
- Se agregan métodos de configuración para integración a Webpay Plus en sus modalidades diferidas y mall diferida.
|
20
|
+
- Se agregan métodos de configuración para integración a Webpay Oneclick en su modalidad mall diferida.
|
21
|
+
|
22
|
+
### Fixed
|
23
|
+
- 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
|
24
|
+
|
25
|
+
## [1.3.1] - 2020-10-29
|
26
|
+
### Fixed
|
27
|
+
- Se revierte commit que elimina requires necesarios para productos REST
|
28
|
+
|
29
|
+
## [1.3.0] - 2020-10-26
|
30
|
+
|
31
|
+
### Added
|
32
|
+
|
33
|
+
- Se agrega soporte para:
|
34
|
+
- Webpay Plus Rest
|
35
|
+
- modalidad normal
|
36
|
+
- modalidad captura diferida
|
37
|
+
- modalidad mall
|
38
|
+
- modalidad mall captura diferida
|
39
|
+
- Patpass by Webpay Rest
|
40
|
+
- Patpass Comercio Rest
|
41
|
+
- Transacción completa Rest
|
42
|
+
- modalidad mall
|
43
|
+
- Oneclick Mall Captura diferida
|
44
|
+
|
45
|
+
## [1.2.0] - 2019-12-26
|
46
|
+
### Added
|
47
|
+
- Se agrega soporte para Oneclick Mall y Transacción Completa en sus versiones REST.
|
48
|
+
|
49
|
+
## [1.1.0] - 2018-04-08
|
50
|
+
### Added
|
51
|
+
- 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.
|
52
|
+
|
53
|
+
## [1.0.2] - 2018-11-29
|
54
|
+
### Fixed
|
55
|
+
- Corrige problema que evitaba poder utilizar un `CHANNEL` distinto a `WEB`
|
56
|
+
|
57
|
+
## [1.0.1] - 2018-10-24
|
58
|
+
### Fixed
|
59
|
+
- Cambios para subir automáticamente la gema a RubyGems cuando se hace un nuevo release
|
60
|
+
|
61
|
+
## [1.0.0] - 2018-10-23
|
62
|
+
### Added
|
63
|
+
- Primer lanzamiento del SDK
|
data/Dockerfile
ADDED
data/Gemfile
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
Copyright 2018 Transbank
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
4
|
+
|
5
|
+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
6
|
+
|
7
|
+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
8
|
+
|
9
|
+
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
10
|
+
|
11
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/Makefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
SHELL := /bin/bash
|
2
|
+
|
3
|
+
all: build run
|
4
|
+
|
5
|
+
run: build
|
6
|
+
docker-compose run --rm web
|
7
|
+
|
8
|
+
build: .built .bundled
|
9
|
+
|
10
|
+
.built: Dockerfile
|
11
|
+
docker-compose build
|
12
|
+
touch .built
|
13
|
+
|
14
|
+
.bundled: Gemfile
|
15
|
+
docker-compose run web bundle install
|
16
|
+
touch .bundled
|
17
|
+
|
18
|
+
logs:
|
19
|
+
docker-compose logs
|
20
|
+
|
21
|
+
clean:
|
22
|
+
docker-compose rm
|
23
|
+
rm .built
|
24
|
+
rm .bundled
|
data/README.md
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
# Transbank SDK Ruby
|
2
|
+
|
3
|
+
SDK Oficial de Transbank downgraded para maconline
|
4
|
+
|
5
|
+
## Requisitos:
|
6
|
+
|
7
|
+
- Ruby 2.3
|
8
|
+
|
9
|
+
# Instalación
|
10
|
+
|
11
|
+
Puedes instalar el SDK directamente
|
12
|
+
```bash
|
13
|
+
gem install transbank-sdk
|
14
|
+
```
|
15
|
+
|
16
|
+
o añadirlo a tu `Gemfile`
|
17
|
+
```ruby
|
18
|
+
gem 'tbk-sdk-ruby2-3'
|
19
|
+
```
|
20
|
+
y luego ejecutar
|
21
|
+
```bash
|
22
|
+
bundle install
|
23
|
+
```
|
24
|
+
## Documentación
|
25
|
+
|
26
|
+
Puedes encontrar toda la documentación de cómo usar este SDK en el sitio https://www.transbankdevelopers.cl.
|
27
|
+
|
28
|
+
Actualmente este SDK contiene sólo Onepay.
|
29
|
+
|
30
|
+
La documentación relevante para usar este SDK es:
|
31
|
+
|
32
|
+
- Documentación general sobre [Onepay](https://www.transbankdevelopers.cl/producto/onepay).
|
33
|
+
- Documentación sobre [ambientes, deberes del comercio, puesta en producción,
|
34
|
+
etc](https://www.transbankdevelopers.cl/documentacion/como_empezar#ambientes).
|
35
|
+
- Referencia detallada sobre [Onepay](https://www.transbankdevelopers.cl/referencia/onepay).
|
36
|
+
|
37
|
+
## Información para contribuir y desarrollar este SDK
|
38
|
+
|
39
|
+
### Requerimientos
|
40
|
+
- Docker
|
41
|
+
- Make
|
42
|
+
- Plugin de editorconfig para tu editor favorito.
|
43
|
+
|
44
|
+
### Standares
|
45
|
+
|
46
|
+
- Para los commits respetamos las siguientes normas: https://chris.beams.io/posts/git-commit/
|
47
|
+
- Usamos ingles, para los mensajes de commit.
|
48
|
+
- Se pueden usar tokens como WIP, en el subject de un commit, separando el token con `:`, por ejemplo:
|
49
|
+
`WIP: This is a useful commit message`
|
50
|
+
- Para los nombres de ramas también usamos ingles.
|
51
|
+
- Se asume, que una rama de feature no mezclada, es un feature no terminado.
|
52
|
+
- El nombre de las ramas va en minúsculas.
|
53
|
+
- Las palabras se separan con `-`.
|
54
|
+
- Las ramas comienzan con alguno de los short lead tokens definidos, por ejemplo: `feat/tokens-configuration`
|
55
|
+
|
56
|
+
#### Short lead tokens
|
57
|
+
##### Commits
|
58
|
+
- WIP = Trabajo en progreso.
|
59
|
+
##### Ramas
|
60
|
+
- feat = Nuevos features
|
61
|
+
- chore = Tareas, que no son visibles al usuario.
|
62
|
+
- bug = Resolución de bugs.
|
63
|
+
|
64
|
+
### Todas las mezclas a master se hacen mediante Pull Request.
|
65
|
+
|
66
|
+
### Test
|
67
|
+
Primero y solamente una vez para instalar gemas debes usar el siguiente comando en una terminal.
|
68
|
+
```bash
|
69
|
+
make build
|
70
|
+
```
|
71
|
+
|
72
|
+
Para ejecutar los test localmente debes usar el siguiente comando en una terminal.
|
73
|
+
```bash
|
74
|
+
make
|
75
|
+
```
|
76
|
+
|
77
|
+
### Deploy de una nueva versión.
|
78
|
+
Para generar una nueva versión, se debe crear un PR (con un título "Prepare release X.Y.Z" con los valores que correspondan para `X`, `Y` y `Z`). Se debe seguir el estándar semver para determinar si se incrementa el valor de `X` (si hay cambios no retrocompatibles), `Y` (para mejoras retrocompatibles) o `Z` (si sólo hubo correcciones a bugs).
|
79
|
+
|
80
|
+
En ese PR deben incluirse los siguientes cambios:
|
81
|
+
|
82
|
+
1. Modificar el archivo `CHANGELOG.md` para incluir una nueva entrada (al comienzo) para `X.Y.Z` que explique en español los cambios **de cara al usuario del SDK**.
|
83
|
+
2. Modificar [version.rb](./lib/transbank/sdk/version.rb) para poner la nueva versión que corresponde.
|
84
|
+
|
85
|
+
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.
|
86
|
+
|
87
|
+
Con eso Travis CI generará automáticamente una nueva versión de la librería y la publicará en RubyGems.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "transbank/sdk"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/docker-compose.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
version: '2'
|
2
|
+
services:
|
3
|
+
web: &web
|
4
|
+
tty: true
|
5
|
+
stdin_open: true
|
6
|
+
build:
|
7
|
+
context: .
|
8
|
+
dockerfile: Dockerfile
|
9
|
+
command: rake test
|
10
|
+
volumes:
|
11
|
+
- .:/sdk
|
12
|
+
volumes_from:
|
13
|
+
- bundle_cache
|
14
|
+
ports:
|
15
|
+
- "8000:8000"
|
16
|
+
|
17
|
+
bundle_cache:
|
18
|
+
image: ruby:2.3.8-jessie # Should be the same as the app Dockerfile.dev base image
|
19
|
+
volumes:
|
20
|
+
- /usr/local/bundle
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module Transbank
|
2
|
+
module Webpay
|
3
|
+
module Oneclick
|
4
|
+
class Base
|
5
|
+
DEFAULT_API_KEY = '579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C'.freeze
|
6
|
+
|
7
|
+
DEFAULT_ONECLICK_MALL_COMMERCE_CODE = '597055555541'.freeze
|
8
|
+
DEFAULT_ONECLICK_MALL_CHILD_COMMERCE_CODES = [
|
9
|
+
'597055555542'.freeze,
|
10
|
+
'597055555543'.freeze
|
11
|
+
].freeze
|
12
|
+
|
13
|
+
DEFAULT_ONECLICK_MALL_DEFERRED_COMMERCE_CODE = '597055555547'.freeze
|
14
|
+
DEFAULT_ONECLICK_MALL_DEFERRED_CHILD_COMMERCE_CODES = [
|
15
|
+
'597055555548'.freeze,
|
16
|
+
'597055555549'.freeze
|
17
|
+
].freeze
|
18
|
+
|
19
|
+
@api_key = DEFAULT_API_KEY
|
20
|
+
@commerce_code = DEFAULT_ONECLICK_MALL_COMMERCE_CODE
|
21
|
+
@integration_type = :TEST
|
22
|
+
@integration_types = {
|
23
|
+
LIVE: "https://webpay3g.transbank.cl/",
|
24
|
+
TEST: "https://webpay3gint.transbank.cl/"
|
25
|
+
}
|
26
|
+
|
27
|
+
class << self
|
28
|
+
attr_reader :integration_types
|
29
|
+
attr_accessor :api_key, :integration_type, :commerce_code
|
30
|
+
|
31
|
+
def integration_type_url(integration_type)
|
32
|
+
type = integration_type.upcase.to_sym
|
33
|
+
return @integration_types[type] unless @integration_types[type].nil?
|
34
|
+
valid_values = @integration_types.keys.join(', ')
|
35
|
+
raise Transbank::Webpay::Errors::IntegrationTypeError, "Invalid integration type, valid values are #{valid_values}"
|
36
|
+
end
|
37
|
+
|
38
|
+
def current_integration_type_url
|
39
|
+
@integration_types[@integration_type]
|
40
|
+
end
|
41
|
+
|
42
|
+
def integration_type=(integration_type)
|
43
|
+
type = integration_type.upcase.to_sym
|
44
|
+
return @integration_type = type unless @integration_types[type].nil?
|
45
|
+
valid_values = @integration_types.keys.join(', ')
|
46
|
+
raise Transbank::Webpay::Errors::IntegrationTypeError, "Invalid integration type, valid values are #{valid_values}"
|
47
|
+
end
|
48
|
+
|
49
|
+
def configure_mall_for_testing
|
50
|
+
@api_key = DEFAULT_API_KEY
|
51
|
+
@commerce_code = DEFAULT_ONECLICK_MALL_COMMERCE_CODE
|
52
|
+
self.integration_type = :TEST
|
53
|
+
end
|
54
|
+
|
55
|
+
def configure_mall_deferred_for_testing
|
56
|
+
@api_key = DEFAULT_API_KEY
|
57
|
+
@commerce_code = DEFAULT_ONECLICK_MALL_DEFERRED_COMMERCE_CODE
|
58
|
+
self.integration_type = :TEST
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Transbank
|
2
|
+
module Webpay
|
3
|
+
module Oneclick
|
4
|
+
module Errors
|
5
|
+
class OneclickError < StandardError
|
6
|
+
attr_accessor :code, :message
|
7
|
+
def initialize(message, code)
|
8
|
+
@code = code
|
9
|
+
@message = message
|
10
|
+
super(message)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Transbank
|
2
|
+
module Webpay
|
3
|
+
module Oneclick
|
4
|
+
module Errors
|
5
|
+
class MallInscriptionDeleteError < OneclickError
|
6
|
+
attr_accessor :code, :message
|
7
|
+
def initialize(message, code)
|
8
|
+
@code = code
|
9
|
+
@message = message
|
10
|
+
super(message, code)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Transbank
|
2
|
+
module Webpay
|
3
|
+
module Oneclick
|
4
|
+
module Errors
|
5
|
+
class MallInscriptionFinishError < OneclickError
|
6
|
+
attr_accessor :code, :message
|
7
|
+
def initialize(message, code)
|
8
|
+
@code = code
|
9
|
+
@message = message
|
10
|
+
super(message, code)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Transbank
|
2
|
+
module Webpay
|
3
|
+
module Oneclick
|
4
|
+
module Errors
|
5
|
+
class MallInscriptionStartError < OneclickError
|
6
|
+
attr_accessor :code, :message
|
7
|
+
def initialize(message, code)
|
8
|
+
@code = code
|
9
|
+
@message = message
|
10
|
+
super(message, code)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Transbank
|
2
|
+
module Webpay
|
3
|
+
module Oneclick
|
4
|
+
class MallInscriptionDeleteResponse
|
5
|
+
attr_accessor :status, :code
|
6
|
+
def initialize(code)
|
7
|
+
code = code.to_i
|
8
|
+
@code = code
|
9
|
+
if code == 204
|
10
|
+
@status = 'OK'
|
11
|
+
elsif code == 404
|
12
|
+
@status = 'Not found'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Transbank
|
2
|
+
module Webpay
|
3
|
+
module Oneclick
|
4
|
+
class MallInscriptionFinishResponse
|
5
|
+
FIELDS = [:response_code, :tbk_user, :authorization_code,
|
6
|
+
:card_type, :card_number]
|
7
|
+
attr_accessor *FIELDS
|
8
|
+
def initialize(json)
|
9
|
+
FIELDS.each {|field| send("#{field}=", json["#{field}"]) }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Transbank
|
2
|
+
module Webpay
|
3
|
+
module Oneclick
|
4
|
+
module Errors
|
5
|
+
class MallTransactionAuthorizeError < OneclickError
|
6
|
+
attr_accessor :code, :message
|
7
|
+
def initialize(message, code)
|
8
|
+
@code = code
|
9
|
+
@message = message
|
10
|
+
super(message, code)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Transbank
|
2
|
+
module Webpay
|
3
|
+
module Oneclick
|
4
|
+
module Errors
|
5
|
+
class MallTransactionRefundError < OneclickError
|
6
|
+
attr_accessor :code, :message
|
7
|
+
def initialize(message, code)
|
8
|
+
@code = code
|
9
|
+
@message = message
|
10
|
+
super(message, code)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Transbank
|
2
|
+
module Webpay
|
3
|
+
module Oneclick
|
4
|
+
module Errors
|
5
|
+
class MallTransactionStatusError < OneclickError
|
6
|
+
attr_accessor :code, :message
|
7
|
+
def initialize(message, code)
|
8
|
+
@code = code
|
9
|
+
@message = message
|
10
|
+
super(message, code)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,4 @@
|
|
1
|
+
require 'transbank/sdk/oneclick/mall/errors/mall_transaction_authorize_error'
|
2
|
+
require 'transbank/sdk/oneclick/mall/errors/mall_transaction_status_error'
|
3
|
+
require 'transbank/sdk/oneclick/mall/errors/mall_transaction_refund_error'
|
4
|
+
require 'transbank/sdk/oneclick/mall_deferred/errors/mall_deferred_transaction_capture_error'
|