apibanca-client 0.0.1
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 +7 -0
- data/.gitignore +17 -0
- data/.rvmrc +62 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +22 -0
- data/Rakefile +8 -0
- data/apibanca-client.gemspec +28 -0
- data/lib/apibanca/client/bank.rb +80 -0
- data/lib/apibanca/client/deposit.rb +18 -0
- data/lib/apibanca/client/deposit_version.rb +10 -0
- data/lib/apibanca/client/exceptions.rb +14 -0
- data/lib/apibanca/client/proxy_base.rb +15 -0
- data/lib/apibanca/client/routine.rb +35 -0
- data/lib/apibanca/client/version.rb +5 -0
- data/lib/apibanca/client.rb +101 -0
- data/lib/faraday/request/apibanca_request_logger.rb +13 -0
- data/lib/faraday/response/apibanca_errors.rb +28 -0
- data/test/minitest_helper.rb +4 -0
- data/test/test_apibanca/client.rb +11 -0
- metadata +150 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8675cb95bc5d494b86e15a41228a64319b874cec
|
4
|
+
data.tar.gz: 4cf002c3f6709a47fbd01aa0a4c743ed04a28317
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f886239319af97a59f1e46970b68fe358a446ae0cd044b0589ac3ac6950da84acfcc652024ba1feb64ece67f890a65504f3e8af2cbb9b2b8300a374c69fb778f
|
7
|
+
data.tar.gz: b506ef352697aa3d6e580a1d2b31a0063e917c7057c633da8bf099c89d723e891e27397a824335bb48d983d1d1a12b2499110d10bb3fbdd56976a88ec24be0f6
|
data/.gitignore
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
+
# development environment upon cd'ing into the directory
|
5
|
+
|
6
|
+
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
|
7
|
+
# Only full ruby name is supported here, for short names use:
|
8
|
+
# echo "rvm use 2.0.0" > .rvmrc
|
9
|
+
environment_id="ruby-2.0.0-p353@apibanca-client"
|
10
|
+
|
11
|
+
# Uncomment the following lines if you want to verify rvm version per project
|
12
|
+
# rvmrc_rvm_version="1.24.7 (stable)" # 1.10.1 seems like a safe start
|
13
|
+
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | __rvm_awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
|
14
|
+
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
|
15
|
+
# return 1
|
16
|
+
# }
|
17
|
+
|
18
|
+
# First we attempt to load the desired environment directly from the environment
|
19
|
+
# file. This is very fast and efficient compared to running through the entire
|
20
|
+
# CLI and selector. If you want feedback on which environment was used then
|
21
|
+
# insert the word 'use' after --create as this triggers verbose mode.
|
22
|
+
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
|
23
|
+
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
24
|
+
then
|
25
|
+
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
26
|
+
for __hook in "${rvm_path:-$HOME/.rvm}/hooks/after_use"*
|
27
|
+
do
|
28
|
+
if [[ -f "${__hook}" && -x "${__hook}" && -s "${__hook}" ]]
|
29
|
+
then \. "${__hook}" || true
|
30
|
+
fi
|
31
|
+
done
|
32
|
+
unset __hook
|
33
|
+
if (( ${rvm_use_flag:=1} >= 1 )) # display automatically
|
34
|
+
then
|
35
|
+
if [[ $- == *i* ]] # check for interactive shells
|
36
|
+
then printf "%b" "Using: $(tput setaf 2 2>/dev/null)$GEM_HOME$(tput sgr0 2>/dev/null)
|
37
|
+
" # show the user the ruby and gemset they are using in green
|
38
|
+
else printf "%b" "Using: $GEM_HOME
|
39
|
+
" # don't use colors in non-interactive shells
|
40
|
+
fi
|
41
|
+
fi
|
42
|
+
else
|
43
|
+
# If the environment file has not yet been created, use the RVM CLI to select.
|
44
|
+
rvm --create use "$environment_id" || {
|
45
|
+
echo "Failed to create RVM environment '${environment_id}'."
|
46
|
+
return 1
|
47
|
+
}
|
48
|
+
fi
|
49
|
+
|
50
|
+
# If you use bundler, this might be useful to you:
|
51
|
+
# if [[ -s Gemfile ]] && {
|
52
|
+
# ! builtin command -v bundle >/dev/null ||
|
53
|
+
# builtin command -v bundle | GREP_OPTIONS="" \grep $rvm_path/bin/bundle >/dev/null
|
54
|
+
# }
|
55
|
+
# then
|
56
|
+
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
|
57
|
+
# gem install bundler
|
58
|
+
# fi
|
59
|
+
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
|
60
|
+
# then
|
61
|
+
# bundle install | GREP_OPTIONS="" \grep -vE '^Using|Your bundle is complete'
|
62
|
+
# fi
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Pablo Marambio
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Cliente Ruby de API-Banca
|
2
|
+
|
3
|
+
`Apibanca::Client` es el cliente de Ruby para `API-Banca`, el wrapper REST sobre los sitios web de los bancos de Chile.
|
4
|
+
|
5
|
+
## API-Banca
|
6
|
+
|
7
|
+
API-Banca es un wrapper de servicios web REST que simplifica el acceso automatizado a los sitios web de los bancos chilenos. Soporta operaciones como la descarga de cartola y transferencias recibidas. Los bancos soportados por ahora son: `BICE` (banca personas) y `SCOTIA` (banca empresas). Obtén una llave para pruebas ingresando a http://api-banca.herokuapp.com
|
8
|
+
|
9
|
+
## Instalación
|
10
|
+
|
11
|
+
Agrega esta línea a tu Gemfile
|
12
|
+
|
13
|
+
gem 'apibanca-client'
|
14
|
+
|
15
|
+
Y luego ejecuta:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
O bien instálala tú mismo:
|
20
|
+
|
21
|
+
$ gem install apibanca-client
|
22
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'apibanca/client/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "apibanca-client"
|
8
|
+
spec.version = Apibanca::Client::VERSION
|
9
|
+
spec.authors = ["Pablo Marambio"]
|
10
|
+
spec.email = ["yo@pablomarambio.cl"]
|
11
|
+
spec.summary = "Cliente de API-Banca"
|
12
|
+
spec.description = "Cliente de API-Banca"
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "minitest"
|
24
|
+
|
25
|
+
spec.add_dependency "hashie"
|
26
|
+
spec.add_dependency "faraday"
|
27
|
+
spec.add_dependency "faraday_middleware"
|
28
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
class Apibanca::Bank < Apibanca::ProxyBase
|
2
|
+
|
3
|
+
set_relative_url "banks"
|
4
|
+
|
5
|
+
class << self
|
6
|
+
def create bank_params
|
7
|
+
raise ArgumentError, "Los parámetros deben ser ApiBanca::Bank::BankCreationParams" unless bank_params.is_a? Apibanca::Bank::BankCreationParams
|
8
|
+
r = Apibanca::Client.post url, { bank: bank_params.to_hash }
|
9
|
+
bank = Apibanca::Bank.new(r.body)
|
10
|
+
bank.routines.map! { |r| Apibanca::Routine.new(r) }
|
11
|
+
bank
|
12
|
+
end
|
13
|
+
|
14
|
+
def load id, recursive=true
|
15
|
+
r = Apibanca::Client.get url("#{id}")
|
16
|
+
bank = Apibanca::Bank.new(r.body)
|
17
|
+
bank.routines.map! { |r| Apibanca::Routine.new(r) }
|
18
|
+
bank.routines.each { |r| r.refresh! } if recursive
|
19
|
+
bank
|
20
|
+
end
|
21
|
+
|
22
|
+
def index recursive=false
|
23
|
+
r = Apibanca::Client.get url
|
24
|
+
r.body.map do |raw|
|
25
|
+
bank = Apibanca::Bank.new(raw)
|
26
|
+
bank.routines.map! { |r| Apibanca::Routine.new(r) }
|
27
|
+
bank.routines.each { |r| r.refresh! } if recursive
|
28
|
+
bank
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def refresh! recursive=true
|
34
|
+
r = Apibanca::Client.get url
|
35
|
+
old_routines = self.routines
|
36
|
+
self.merge! r.body
|
37
|
+
self.routines = old_routines
|
38
|
+
self.routines.each { |r| r.refresh! } if recursive
|
39
|
+
self
|
40
|
+
end
|
41
|
+
|
42
|
+
def change_password new_pass
|
43
|
+
r = Apibanca::Client.patch url("change_password"), pass: new_pass
|
44
|
+
true
|
45
|
+
end
|
46
|
+
|
47
|
+
def add_routine routine_params
|
48
|
+
raise ArgumentError, "Los parámetros deben ser ApiBanca::Bank::RoutineCreationParams" unless routine_params.is_a? Apibanca::Bank::RoutineCreationParams
|
49
|
+
r = Apibanca::Client.post url("add_routine"), { routine: routine_params.to_hash }
|
50
|
+
r.body.routines.each do |routine|
|
51
|
+
new_routine = Apibanca::Routine.new(routine) unless self.routines.map { |i| i.id }.include?(routine.id)
|
52
|
+
next unless new_routine
|
53
|
+
new_routine.refresh!
|
54
|
+
self.routines << new_routine
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def delete
|
59
|
+
r = Apibanca::Client.delete url
|
60
|
+
true
|
61
|
+
end
|
62
|
+
|
63
|
+
def load_deposits params=nil
|
64
|
+
r = Apibanca::Client.get url("deposits"), params
|
65
|
+
self.deposits = r.body.map { |d| nd = Apibanca::Deposit.new(d); nd.obj_bank = self; nd }
|
66
|
+
end
|
67
|
+
|
68
|
+
class BankCreationParams < Hashie::Dash
|
69
|
+
property :name, :required => true
|
70
|
+
property :user, :required => true
|
71
|
+
property :account, :required => true
|
72
|
+
property :pass, :required => true
|
73
|
+
end
|
74
|
+
|
75
|
+
class RoutineCreationParams < Hashie::Dash
|
76
|
+
property :nombre, :required => true
|
77
|
+
property :target, :required => true
|
78
|
+
property :what_to_do, :required => true
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class Apibanca::Deposit < Apibanca::ProxyBase
|
2
|
+
def load_history
|
3
|
+
h = Apibanca::Client.get obj_bank.url("deposits/#{self.id}/history")
|
4
|
+
@history = h.body.map { |d| dv = Apibanca::DepositVersion.new(d); dv.obj_deposit = self; dv }
|
5
|
+
end
|
6
|
+
|
7
|
+
def to_s
|
8
|
+
"#{self.raw_date} #{self.psd_type ? self.psd_type : self.raw_comment} [#{self.raw_amount}]"
|
9
|
+
end
|
10
|
+
|
11
|
+
def inspect
|
12
|
+
to_s
|
13
|
+
end
|
14
|
+
|
15
|
+
def history
|
16
|
+
@history ||= load_history
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class Apibanca::DepositVersion < Apibanca::Deposit
|
2
|
+
|
3
|
+
def load_history
|
4
|
+
raise "Para cargar la historia, debes hacerlo en la versión actual del depósito"
|
5
|
+
end
|
6
|
+
|
7
|
+
def history
|
8
|
+
raise "Para revisar la historia, debes hacerlo en la versión actual del depósito"
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class Apibanca::Client
|
2
|
+
|
3
|
+
class InvalidOperationError < StandardError
|
4
|
+
attr_reader :remote_backtrace, :remote_errors
|
5
|
+
def initialize remote_backtrace, remote_errors
|
6
|
+
@remote_backtrace = remote_backtrace
|
7
|
+
@remote_errors = remote_errors
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class UnauthorizedError < InvalidOperationError; end
|
12
|
+
|
13
|
+
class NotFoundError < InvalidOperationError; end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class Apibanca::ProxyBase < Hashie::Mash
|
2
|
+
class << self
|
3
|
+
def set_relative_url relative
|
4
|
+
self.class_eval(<<-EOM, __FILE__, __LINE__ + 1)
|
5
|
+
def url extra=nil
|
6
|
+
"#{relative}/\#{self.id}\#{extra ? "/" + extra : ""}"
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.url extra=nil
|
10
|
+
"#{relative}/\#{extra ? "/" + extra : ""}"
|
11
|
+
end
|
12
|
+
EOM
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class Apibanca::Routine < Apibanca::ProxyBase
|
2
|
+
|
3
|
+
set_relative_url "routines"
|
4
|
+
|
5
|
+
def refresh!
|
6
|
+
r = Apibanca::Client.get url
|
7
|
+
self.merge! r.body
|
8
|
+
end
|
9
|
+
|
10
|
+
def turn_on
|
11
|
+
r = Apibanca::Client.patch url("turn_on")
|
12
|
+
self.merge! r.body
|
13
|
+
end
|
14
|
+
|
15
|
+
def turn_off
|
16
|
+
r = Apibanca::Client.patch url("turn_off")
|
17
|
+
self.merge! r.body
|
18
|
+
end
|
19
|
+
|
20
|
+
def schedule params
|
21
|
+
raise ArgumentError, "Los parámetros deben ser ApiBanca::Routine::ScheduleParams" unless params.is_a? Apibanca::Routine::ScheduleParams
|
22
|
+
r = Apibanca::Client.patch url("schedule"), params.to_hash
|
23
|
+
self.merge! r.body
|
24
|
+
end
|
25
|
+
|
26
|
+
def load_tasks
|
27
|
+
r = Apibanca::Client.get url("tasks")
|
28
|
+
self.tasks = r.body
|
29
|
+
end
|
30
|
+
|
31
|
+
class ScheduleParams < Hashie::Dash
|
32
|
+
property :unit, required: true
|
33
|
+
property :interval, required: true
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
require "hashie"
|
2
|
+
require "faraday"
|
3
|
+
require "faraday_middleware"
|
4
|
+
require "apibanca/client/version"
|
5
|
+
require "apibanca/client/exceptions"
|
6
|
+
require "faraday/request/apibanca_request_logger"
|
7
|
+
require "faraday/response/apibanca_errors"
|
8
|
+
|
9
|
+
module Apibanca
|
10
|
+
class Client
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def get uri, params=nil
|
14
|
+
Apibanca::Client.conn_url.get do |req|
|
15
|
+
req.url uri, params
|
16
|
+
req.headers['bc-auth-token'] = @secret
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def post uri, body=nil
|
21
|
+
Apibanca::Client.conn_form.post do |req|
|
22
|
+
req.url uri
|
23
|
+
req.headers['bc-auth-token'] = @secret
|
24
|
+
req.body = body if body
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def patch uri, body=nil
|
29
|
+
Apibanca::Client.conn_form.patch do |req|
|
30
|
+
req.url uri
|
31
|
+
req.headers['bc-auth-token'] = @secret
|
32
|
+
req.body = body if body
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def delete uri
|
37
|
+
Apibanca::Client.conn_form.delete do |req|
|
38
|
+
req.url uri
|
39
|
+
req.headers['bc-auth-token'] = @secret
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def conn_form
|
44
|
+
check_requirements!
|
45
|
+
@conn ||= Faraday.new(:url => @base_uri) do |f|
|
46
|
+
f.request :apibanca_request_logger
|
47
|
+
f.request :json
|
48
|
+
f.response :apibanca_errors
|
49
|
+
f.response :mashify
|
50
|
+
f.response :json, :content_type => /\bjson$/
|
51
|
+
f.adapter Faraday.default_adapter
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def conn_url
|
56
|
+
check_requirements!
|
57
|
+
@conn ||= Faraday.new(:url => @base_uri) do |f|
|
58
|
+
f.request :apibanca_request_logger
|
59
|
+
f.request :url_encoded
|
60
|
+
f.response :apibanca_errors
|
61
|
+
f.response :mashify
|
62
|
+
f.response :json, :content_type => /\bjson$/
|
63
|
+
f.adapter Faraday.default_adapter
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def configure &block
|
68
|
+
raise ArgumentError, "El bloque debe recibir un argumento" unless block.arity == 1
|
69
|
+
yield self
|
70
|
+
end
|
71
|
+
|
72
|
+
def secret= value
|
73
|
+
@secret = value
|
74
|
+
end
|
75
|
+
|
76
|
+
def secret
|
77
|
+
@secret
|
78
|
+
end
|
79
|
+
|
80
|
+
def base_uri= value
|
81
|
+
@base_uri = value
|
82
|
+
end
|
83
|
+
|
84
|
+
def base_uri
|
85
|
+
@base_uri ||= "http://localhost:3000/api/2013-11-4"
|
86
|
+
end
|
87
|
+
|
88
|
+
private
|
89
|
+
def check_requirements!
|
90
|
+
raise ArgumentError, "Debe indicar el secreto" unless secret
|
91
|
+
raise ArgumentError, "Debe indicar la URI" unless base_uri
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
require "apibanca/client/proxy_base"
|
98
|
+
require "apibanca/client/bank"
|
99
|
+
require "apibanca/client/deposit"
|
100
|
+
require "apibanca/client/deposit_version"
|
101
|
+
require "apibanca/client/routine"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Faraday
|
2
|
+
class Request
|
3
|
+
class ApibancaRequestLogger < Middleware
|
4
|
+
|
5
|
+
def call(env)
|
6
|
+
puts " -> #{env[:method].upcase} #{env[:url]} #{env[:body] ? "[#{env[:body]} params]" : "" }"
|
7
|
+
@app.call(env)
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
Faraday.register_middleware :request, apibanca_request_logger: lambda { ApibancaRequestLogger }
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Faraday
|
2
|
+
class Response
|
3
|
+
class ApibancaErrors < Middleware
|
4
|
+
|
5
|
+
def call(env)
|
6
|
+
@app.call(env).on_complete do
|
7
|
+
resp = env[:response].body
|
8
|
+
if env[:status] >= 400 && env[:status] <= 500
|
9
|
+
if resp.respond_to? :backtrace
|
10
|
+
case env[:status]
|
11
|
+
when 401, 403
|
12
|
+
raise Apibanca::Client::UnauthorizedError.new(resp.backtrace, nil), resp.error
|
13
|
+
when 404
|
14
|
+
raise Apibanca::Client::UnauthorizedError.new(resp.backtrace, nil), resp.error
|
15
|
+
else
|
16
|
+
raise Apibanca::Client::InvalidOperationError.new(resp.backtrace, resp[:"object-errors"]), resp.error
|
17
|
+
end
|
18
|
+
else
|
19
|
+
raise "Error inesperado #{env[:status]}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
Faraday.register_middleware :response, apibanca_errors: lambda { ApibancaErrors }
|
27
|
+
end
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: apibanca-client
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Pablo Marambio
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-01-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: hashie
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: faraday
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: faraday_middleware
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: Cliente de API-Banca
|
98
|
+
email:
|
99
|
+
- yo@pablomarambio.cl
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- .gitignore
|
105
|
+
- .rvmrc
|
106
|
+
- .travis.yml
|
107
|
+
- Gemfile
|
108
|
+
- LICENSE.txt
|
109
|
+
- README.md
|
110
|
+
- Rakefile
|
111
|
+
- apibanca-client.gemspec
|
112
|
+
- lib/apibanca/client.rb
|
113
|
+
- lib/apibanca/client/bank.rb
|
114
|
+
- lib/apibanca/client/deposit.rb
|
115
|
+
- lib/apibanca/client/deposit_version.rb
|
116
|
+
- lib/apibanca/client/exceptions.rb
|
117
|
+
- lib/apibanca/client/proxy_base.rb
|
118
|
+
- lib/apibanca/client/routine.rb
|
119
|
+
- lib/apibanca/client/version.rb
|
120
|
+
- lib/faraday/request/apibanca_request_logger.rb
|
121
|
+
- lib/faraday/response/apibanca_errors.rb
|
122
|
+
- test/minitest_helper.rb
|
123
|
+
- test/test_apibanca/client.rb
|
124
|
+
homepage: ''
|
125
|
+
licenses:
|
126
|
+
- MIT
|
127
|
+
metadata: {}
|
128
|
+
post_install_message:
|
129
|
+
rdoc_options: []
|
130
|
+
require_paths:
|
131
|
+
- lib
|
132
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - '>='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
|
+
requirements:
|
139
|
+
- - '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
requirements: []
|
143
|
+
rubyforge_project:
|
144
|
+
rubygems_version: 2.1.11
|
145
|
+
signing_key:
|
146
|
+
specification_version: 4
|
147
|
+
summary: Cliente de API-Banca
|
148
|
+
test_files:
|
149
|
+
- test/minitest_helper.rb
|
150
|
+
- test/test_apibanca/client.rb
|