bs2_api 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -14
- data/Gemfile.lock +7 -5
- data/README.md +78 -80
- data/bs2_api.gemspec +14 -3
- data/lib/bs2_api.rb +7 -1
- data/lib/bs2_api/entities/account.rb +7 -2
- data/lib/bs2_api/errors/confirmation_error.rb +7 -0
- data/lib/bs2_api/errors/invalid_bank.rb +7 -0
- data/lib/bs2_api/errors/missing_bank.rb +7 -0
- data/lib/bs2_api/payment/base.rb +10 -3
- data/lib/bs2_api/payment/confirmation.rb +38 -0
- data/lib/bs2_api/payment/manual.rb +1 -0
- data/lib/bs2_api/util/bank_service.rb +3 -1
- data/lib/bs2_api/version.rb +1 -1
- metadata +157 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac4d8162e93c876cdd61a6be56abde26d704a31797aef6b815274c98b8e5da29
|
4
|
+
data.tar.gz: fc30a8fbac319e4b810dedac2582902a59ceeacc037f2e8a3f8fc2a8f3d87a1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 783bbec0c5ad81733d817f0958506bbfc300c75983256454d8f050e13ef7b00640ece3fb4d59858cf5aae36656435e7164893972f103a8f495661d10be5551b2
|
7
|
+
data.tar.gz: c2e1e9df5dd5040ccebcf481e6e3bb649ab2dd134a3f0be4ed50014a1543cf0de67508de31809582ddf4a850bf7333970f6284394d905c94d6c0cd4168fa90c4
|
data/Gemfile
CHANGED
@@ -2,17 +2,4 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gemspec
|
6
|
-
|
7
|
-
gem "rake", "~> 13.0"
|
8
|
-
gem "httparty", "~> 0.18.1"
|
9
|
-
gem "activesupport", "~> 6.1", ">= 6.1.3.2"
|
10
|
-
|
11
|
-
group :test do
|
12
|
-
gem "pry-byebug", "~> 3.9"
|
13
|
-
gem "uuid", "~> 2.3", ">= 2.3.9"
|
14
|
-
gem "rspec", "~> 3.10"
|
15
|
-
gem "webmock", "~> 3.13"
|
16
|
-
gem "vcr", "~> 6.0"
|
17
|
-
gem "dotenv", "~> 2.7", ">= 2.7.6"
|
18
|
-
end
|
5
|
+
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bs2_api (0.
|
5
|
-
activesupport
|
4
|
+
bs2_api (0.3.0)
|
5
|
+
activesupport
|
6
|
+
builder
|
7
|
+
bundler
|
8
|
+
httparty (~> 0.18.1)
|
9
|
+
rake
|
6
10
|
|
7
11
|
GEM
|
8
12
|
remote: https://rubygems.org/
|
@@ -15,6 +19,7 @@ GEM
|
|
15
19
|
zeitwerk (~> 2.3)
|
16
20
|
addressable (2.7.0)
|
17
21
|
public_suffix (>= 2.0.2, < 5.0)
|
22
|
+
builder (3.2.4)
|
18
23
|
byebug (11.1.3)
|
19
24
|
coderay (1.1.3)
|
20
25
|
concurrent-ruby (1.1.9)
|
@@ -74,12 +79,9 @@ PLATFORMS
|
|
74
79
|
x86_64-linux
|
75
80
|
|
76
81
|
DEPENDENCIES
|
77
|
-
activesupport (~> 6.1, >= 6.1.3.2)
|
78
82
|
bs2_api!
|
79
83
|
dotenv (~> 2.7, >= 2.7.6)
|
80
|
-
httparty (~> 0.18.1)
|
81
84
|
pry-byebug (~> 3.9)
|
82
|
-
rake (~> 13.0)
|
83
85
|
rspec (~> 3.10)
|
84
86
|
uuid (~> 2.3, >= 2.3.9)
|
85
87
|
vcr (~> 6.0)
|
data/README.md
CHANGED
@@ -2,6 +2,18 @@
|
|
2
2
|
|
3
3
|
Integração com a API do Banco BS2: https://devs.bs2.com/manual/pix-clientes
|
4
4
|
|
5
|
+
TO-DO:
|
6
|
+
- Pagamentos (**Transfere** dinheiro para alguém)
|
7
|
+
- [x] Criar pagamento por Chave
|
8
|
+
- [x] Criar pagamento Manual
|
9
|
+
- [x] Confirmar pagamento
|
10
|
+
- [ ] Consultar pagamento
|
11
|
+
- Recebimentos (**Recebe** dinheiro de alguém)
|
12
|
+
- [ ] Cobrança estático
|
13
|
+
- [ ] Cobrança dinâmico
|
14
|
+
- [ ] Consultar cobrança
|
15
|
+
|
16
|
+
|
5
17
|
## Instalação
|
6
18
|
|
7
19
|
Adicionar no seu Gemfile:
|
@@ -33,11 +45,11 @@ ou via initializer:
|
|
33
45
|
Bs2Api.configure do |config|
|
34
46
|
config.client_id = 'you_bs2_client_id'
|
35
47
|
config.client_secret = 'you_bs2_client_secret'
|
36
|
-
config.pix_environment = '
|
48
|
+
config.pix_environment = 'sandbox' # ou production
|
37
49
|
end
|
38
50
|
```
|
39
51
|
|
40
|
-
###
|
52
|
+
### Inicia ordem de Transferência PIX via: Chave
|
41
53
|
|
42
54
|
```ruby
|
43
55
|
pix_key = Bs2Api::Entities::PixKey.new(
|
@@ -45,100 +57,86 @@ pix_key = Bs2Api::Entities::PixKey.new(
|
|
45
57
|
type: 'EMAIL'
|
46
58
|
)
|
47
59
|
|
48
|
-
|
49
|
-
|
60
|
+
# Caso ocorra algum problema na criação, um erro será lançado
|
61
|
+
# Veja abaixo (Classes de errors) quais erros que podem ser lançados
|
62
|
+
pay_key = Bs2Api::Payment::Key.new(pix_key).call
|
50
63
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
EMAIL
|
57
|
-
EVP (Chave aleatória)
|
58
|
-
```
|
64
|
+
pay_key.payment.id
|
65
|
+
=> "96f0b3c4-4c76-4a7a-9933-9c9f86df7490" # pagamentoId gerado no BS2
|
66
|
+
|
67
|
+
pay_key.payment.merchantId
|
68
|
+
=> "E710278662021061618144401750781P" # endToEndId gerado no BS2
|
59
69
|
|
70
|
+
```
|
60
71
|
|
61
|
-
###
|
72
|
+
### Inicia ordem de Transferência PIX via: Manual
|
62
73
|
|
63
74
|
```ruby
|
64
75
|
account = Bs2Api::Entities::Account.new(
|
65
|
-
bank_code:
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
type: 'ContaCorrente'
|
76
|
+
bank_code: "218",
|
77
|
+
agency: "0993",
|
78
|
+
number: "042312",
|
79
|
+
type: "ContaCorrente" # ContaCorrente, ContaSalario ou Poupanca
|
70
80
|
)
|
71
81
|
|
72
82
|
customer = Bs2Api::Entities::Customer.new(
|
73
|
-
document:
|
74
|
-
type:
|
75
|
-
name:
|
83
|
+
document: "88899988811",
|
84
|
+
type: "CPF",
|
85
|
+
name: "Rick Sanches",
|
86
|
+
business_name: "Nome fantasia" # Utilizar apenas se for type CNPJ
|
76
87
|
)
|
77
88
|
|
78
|
-
|
79
|
-
account: account,
|
89
|
+
receiver_bank = Bs2Api::Entities::Bank.new(
|
90
|
+
account: account,
|
80
91
|
customer: customer
|
81
92
|
)
|
82
93
|
|
83
|
-
|
94
|
+
pay_manual = Bs2Api::Payment::Manual.new(receiver_bank).call
|
95
|
+
|
96
|
+
pay_manual.payment.id
|
97
|
+
=> "96f0b3c4-4c76-4a7a-9933-9c9f86df7490" # UUID gerado no BS2
|
98
|
+
|
99
|
+
pay_manual.payment.merchantId
|
100
|
+
=> "E710278662021061618144401750781P" # endToEndId gerado no BS2
|
84
101
|
```
|
85
102
|
|
86
|
-
###
|
103
|
+
### Confirmar ordem de transferência
|
104
|
+
```ruby
|
105
|
+
# Após criar um Payment é necessário confirmar
|
106
|
+
# Nessa etapa o dinheiro é de fato transferido
|
107
|
+
|
108
|
+
# Tanto a ordem de transferência via chave ou manual tem o mesmo payment.
|
109
|
+
# Caso tenha criado via chave no passo anterior:
|
110
|
+
payment = pay_key.payment
|
111
|
+
|
112
|
+
# Ou caso tenha criado a ordem via Manual no passo anterior:
|
113
|
+
payment = pay_manual.payment
|
87
114
|
|
88
|
-
|
115
|
+
amount = 10.50
|
116
|
+
confirmation = Bs2Api::Payment::Confirmation.new(payment, value: amount).call
|
117
|
+
|
118
|
+
# Caso a confirmação de problema, um erro será lançado.
|
119
|
+
raise Bs2Api::Errors::ConfirmationError
|
120
|
+
|
121
|
+
# Caso nenhum erro seja lançado (já é sucesso) porém, você pode ter certeza com
|
122
|
+
confirmation.success?
|
123
|
+
```
|
124
|
+
---
|
125
|
+
### Classes de erros:
|
89
126
|
```ruby
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
=> Bs2Api::Entities::Customer
|
106
|
-
|
107
|
-
payment.to_hash
|
108
|
-
{
|
109
|
-
"pagamentoId"=>"123",
|
110
|
-
"endToEndId"=>"456",
|
111
|
-
"recebedor"=>{
|
112
|
-
"ispb"=>"71027866",
|
113
|
-
"conta"=>{
|
114
|
-
"banco"=>"218",
|
115
|
-
"bancoNome"=>"BCO BS2 S.A.",
|
116
|
-
"agencia"=>"0001",
|
117
|
-
"numero"=>"3134806",
|
118
|
-
"tipo"=>"ContaCorrente"
|
119
|
-
},
|
120
|
-
"pessoa"=>{
|
121
|
-
"documento"=>"25215188000116",
|
122
|
-
"tipoDocumento"=>"CNPJ",
|
123
|
-
"nome"=>"Teste Automatizado",
|
124
|
-
"nomeFantasia"=>nil
|
125
|
-
}
|
126
|
-
},
|
127
|
-
"pagador"=>{
|
128
|
-
"ispb"=>"71027866",
|
129
|
-
"conta"=>{
|
130
|
-
"banco"=>"218",
|
131
|
-
"bancoNome"=>"BCO BS2 S.A.",
|
132
|
-
"agencia"=>"0001",
|
133
|
-
"numero"=>"3134806",
|
134
|
-
"tipo"=>"ContaCorrente"
|
135
|
-
},
|
136
|
-
"pessoa"=>{
|
137
|
-
"documento"=>"25215188000116",
|
138
|
-
"tipoDocumento"=>"CNPJ",
|
139
|
-
"nome"=>"Teste Automatizado",
|
140
|
-
"nomeFantasia"=>nil
|
141
|
-
}
|
142
|
-
}
|
143
|
-
}
|
127
|
+
# Todos erros herdam de:
|
128
|
+
Bs2Api::Errors::Base
|
129
|
+
|
130
|
+
Bs2Api::Errors::BadRequest
|
131
|
+
Bs2Api::Errors::ConfirmationError
|
132
|
+
Bs2Api::Errors::InvalidCustomer
|
133
|
+
Bs2Api::Errors::InvalidPixKey
|
134
|
+
Bs2Api::Errors::MissingConfiguration
|
135
|
+
Bs2Api::Errors::ServerError
|
136
|
+
Bs2Api::Errors::Unauthorized
|
137
|
+
|
138
|
+
# Caso não queira tratar um erro em específico basta fazer rescue do Base
|
139
|
+
rescue Bs2Api::Errors::Base => e
|
140
|
+
puts "Erro: #{e.message}"
|
141
|
+
end
|
144
142
|
```
|
data/bs2_api.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ["kimpastro@gmail.com"]
|
10
10
|
|
11
11
|
spec.summary = "Integração com a API do BS2"
|
12
|
-
spec.description = "
|
12
|
+
spec.description = "Fazer transferências via PIX"
|
13
13
|
spec.homepage = "https://github.com/kimpastro/bs2_api"
|
14
14
|
spec.required_ruby_version = ">= 2.7.2"
|
15
15
|
|
@@ -26,5 +26,16 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
|
29
|
-
spec.add_dependency
|
30
|
-
|
29
|
+
spec.add_dependency("builder")
|
30
|
+
spec.add_dependency("bundler")
|
31
|
+
spec.add_dependency("rake")
|
32
|
+
spec.add_dependency("activesupport")
|
33
|
+
spec.add_dependency("httparty", "~> 0.18.1")
|
34
|
+
|
35
|
+
spec.add_development_dependency("pry-byebug", "~> 3.9")
|
36
|
+
spec.add_development_dependency("uuid", "~> 2.3", ">= 2.3.9")
|
37
|
+
spec.add_development_dependency("rspec", "~> 3.10")
|
38
|
+
spec.add_development_dependency("webmock", "~> 3.13")
|
39
|
+
spec.add_development_dependency("vcr", "~> 6.0")
|
40
|
+
spec.add_development_dependency("dotenv", "~> 2.7", ">= 2.7.6")
|
41
|
+
end
|
data/lib/bs2_api.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require
|
2
|
+
require "httparty"
|
3
3
|
require "active_support/core_ext/hash/indifferent_access"
|
4
|
+
require "active_support/core_ext/hash/except"
|
4
5
|
|
5
6
|
require 'bs2_api/version'
|
6
7
|
require 'bs2_api/configuration'
|
@@ -10,10 +11,14 @@ require 'bs2_api/initializers/hash'
|
|
10
11
|
|
11
12
|
require 'bs2_api/errors/base'
|
12
13
|
require 'bs2_api/errors/invalid_pix_key'
|
14
|
+
require 'bs2_api/errors/invalid_bank'
|
15
|
+
require 'bs2_api/errors/invalid_customer'
|
13
16
|
require 'bs2_api/errors/missing_configuration'
|
14
17
|
require 'bs2_api/errors/unauthorized'
|
15
18
|
require 'bs2_api/errors/bad_request'
|
16
19
|
require 'bs2_api/errors/server_error'
|
20
|
+
require 'bs2_api/errors/confirmation_error'
|
21
|
+
require 'bs2_api/errors/missing_bank'
|
17
22
|
|
18
23
|
require 'bs2_api/entities/account'
|
19
24
|
require 'bs2_api/entities/bank'
|
@@ -24,6 +29,7 @@ require 'bs2_api/entities/pix_key'
|
|
24
29
|
require 'bs2_api/payment/base'
|
25
30
|
require 'bs2_api/payment/key'
|
26
31
|
require 'bs2_api/payment/manual'
|
32
|
+
require 'bs2_api/payment/confirmation'
|
27
33
|
|
28
34
|
require 'bs2_api/request/auth'
|
29
35
|
|
@@ -13,17 +13,17 @@ module Bs2Api
|
|
13
13
|
|
14
14
|
def initialize(args = {})
|
15
15
|
@bank_code = args.fetch(:bank_code, nil)
|
16
|
-
@bank_name = args.fetch(:bank_name, nil)
|
17
16
|
@agency = args.fetch(:agency, nil)
|
18
17
|
@number = args.fetch(:number, nil)
|
19
18
|
@type = args.fetch(:type, nil)
|
19
|
+
@bank_name = get_bank_name
|
20
20
|
end
|
21
21
|
|
22
22
|
def to_hash
|
23
23
|
ActiveSupport::HashWithIndifferentAccess.new(
|
24
24
|
{
|
25
25
|
"banco": @bank_code,
|
26
|
-
"bancoNome":
|
26
|
+
"bancoNome": get_bank_name,
|
27
27
|
"agencia": @agency,
|
28
28
|
"numero": @number,
|
29
29
|
"tipo": @type
|
@@ -54,6 +54,11 @@ module Bs2Api
|
|
54
54
|
def saving?
|
55
55
|
@type == TYPES[:saving]
|
56
56
|
end
|
57
|
+
|
58
|
+
private
|
59
|
+
def get_bank_name
|
60
|
+
Bs2Api::Util::BankService.find_by_code(@bank_code)["name"]
|
61
|
+
end
|
57
62
|
end
|
58
63
|
end
|
59
64
|
end
|
data/lib/bs2_api/payment/base.rb
CHANGED
@@ -1,11 +1,18 @@
|
|
1
1
|
module Bs2Api
|
2
2
|
module Payment
|
3
3
|
class Base
|
4
|
+
attr_reader :payment
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
raise NoMethodError, "Missing #{__method__} to #{self.class}"
|
8
|
+
end
|
9
|
+
|
4
10
|
def call
|
5
11
|
response = post_request
|
6
|
-
|
7
|
-
|
8
|
-
Bs2Api::Entities::Payment.from_response(response)
|
12
|
+
raise Bs2Api::Errors::BadRequest, parse_error(response) unless response.created?
|
13
|
+
|
14
|
+
@payment = Bs2Api::Entities::Payment.from_response(response)
|
15
|
+
self
|
9
16
|
end
|
10
17
|
|
11
18
|
private
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Bs2Api
|
2
|
+
module Payment
|
3
|
+
class Confirmation < Base
|
4
|
+
attr_reader :success
|
5
|
+
|
6
|
+
def initialize payment, value: nil
|
7
|
+
raise Bs2Api::Errors::ConfirmationError, 'invalid payment' unless payment.present? && payment.is_a?(Bs2Api::Entities::Payment)
|
8
|
+
raise Bs2Api::Errors::ConfirmationError, 'invalid value' unless value.to_f.positive?
|
9
|
+
@payment = payment
|
10
|
+
|
11
|
+
@value = value.to_f
|
12
|
+
end
|
13
|
+
|
14
|
+
def call
|
15
|
+
response = post_request
|
16
|
+
raise Bs2Api::Errors::ConfirmationError, parse_error(response) unless response.accepted?
|
17
|
+
|
18
|
+
@success = true
|
19
|
+
self
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
def payload
|
24
|
+
@payment.to_hash
|
25
|
+
.except!("pagamentoId", "endToEndId")
|
26
|
+
.merge("valor": @value)
|
27
|
+
end
|
28
|
+
|
29
|
+
def url
|
30
|
+
"#{Bs2Api.endpoint}/pix/direto/forintegration/v1/pagamentos/#{@payment.id}/confirmacao"
|
31
|
+
end
|
32
|
+
|
33
|
+
def success?
|
34
|
+
!!@success
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -7,7 +7,9 @@ module Bs2Api
|
|
7
7
|
class BankService
|
8
8
|
class << self
|
9
9
|
def find_by_code code
|
10
|
-
bank_list.find {|b| b["code"] == code }
|
10
|
+
bank = bank_list.find {|b| b["code"] == code }
|
11
|
+
raise Bs2Api::Errors::MissingBank, 'Bank not registered into util/banks.yml file' if bank.blank?
|
12
|
+
bank
|
11
13
|
end
|
12
14
|
|
13
15
|
private
|
data/lib/bs2_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bs2_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kim Pastro
|
@@ -10,27 +10,173 @@ bindir: exe
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2021-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: builder
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
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: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
13
55
|
- !ruby/object:Gem::Dependency
|
14
56
|
name: activesupport
|
15
57
|
requirement: !ruby/object:Gem::Requirement
|
16
58
|
requirements:
|
17
|
-
- - "
|
59
|
+
- - ">="
|
18
60
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
20
66
|
- - ">="
|
21
67
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: httparty
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.18.1
|
23
76
|
type: :runtime
|
24
77
|
prerelease: false
|
25
78
|
version_requirements: !ruby/object:Gem::Requirement
|
26
79
|
requirements:
|
27
80
|
- - "~>"
|
28
81
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
82
|
+
version: 0.18.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry-byebug
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.9'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.9'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: uuid
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.3'
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 2.3.9
|
107
|
+
type: :development
|
108
|
+
prerelease: false
|
109
|
+
version_requirements: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - "~>"
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '2.3'
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 2.3.9
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: rspec
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '3.10'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '3.10'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: webmock
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '3.13'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '3.13'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: vcr
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '6.0'
|
152
|
+
type: :development
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "~>"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '6.0'
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: dotenv
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - "~>"
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '2.7'
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: 2.7.6
|
169
|
+
type: :development
|
170
|
+
prerelease: false
|
171
|
+
version_requirements: !ruby/object:Gem::Requirement
|
172
|
+
requirements:
|
173
|
+
- - "~>"
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '2.7'
|
30
176
|
- - ">="
|
31
177
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
33
|
-
description:
|
178
|
+
version: 2.7.6
|
179
|
+
description: Fazer transferências via PIX
|
34
180
|
email:
|
35
181
|
- kimpastro@gmail.com
|
36
182
|
executables: []
|
@@ -60,14 +206,18 @@ files:
|
|
60
206
|
- lib/bs2_api/entities/pix_key.rb
|
61
207
|
- lib/bs2_api/errors/bad_request.rb
|
62
208
|
- lib/bs2_api/errors/base.rb
|
209
|
+
- lib/bs2_api/errors/confirmation_error.rb
|
210
|
+
- lib/bs2_api/errors/invalid_bank.rb
|
63
211
|
- lib/bs2_api/errors/invalid_customer.rb
|
64
212
|
- lib/bs2_api/errors/invalid_pix_key.rb
|
213
|
+
- lib/bs2_api/errors/missing_bank.rb
|
65
214
|
- lib/bs2_api/errors/missing_configuration.rb
|
66
215
|
- lib/bs2_api/errors/server_error.rb
|
67
216
|
- lib/bs2_api/errors/unauthorized.rb
|
68
217
|
- lib/bs2_api/initializers/hash.rb
|
69
218
|
- lib/bs2_api/initializers/object.rb
|
70
219
|
- lib/bs2_api/payment/base.rb
|
220
|
+
- lib/bs2_api/payment/confirmation.rb
|
71
221
|
- lib/bs2_api/payment/key.rb
|
72
222
|
- lib/bs2_api/payment/manual.rb
|
73
223
|
- lib/bs2_api/request/auth.rb
|