credigy 0.1.0 → 0.1.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +29 -3
- data/lib/credigy.rb +2 -0
- data/lib/credigy/boleto.rb +23 -0
- data/lib/credigy/boleto_response.rb +9 -0
- data/lib/credigy/campaign_negotiation.rb +24 -0
- data/lib/credigy/campaign_negotiation_response.rb +9 -0
- data/lib/credigy/login_response.rb +3 -1
- data/lib/credigy/promise.rb +1 -1
- data/lib/credigy/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ba7f66fbfadca72a2d40367d7cdbe100f37b762
|
4
|
+
data.tar.gz: 3643efc803a52c6691d45ee50e879dc9992d01f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b196f7d956022a8b0546f56ba5e5169a6c7ccb8eb002033494f5f41630edd3d4f04289f50364bab0f4f4a8542f2689b093c20ad039f514a7d6ab18ca48ced58
|
7
|
+
data.tar.gz: c238cb68004c1c4f298cbd8167afe1a7005962d1681de6672653c3752684ce19ab17c9da6b1608d86a8f4031ad446b6952c29439c3e6260c0157a7802a6a7a51
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
### 0.1.1 (17/10/2018)
|
2
|
+
|
3
|
+
* Levanta exception se o token gerado não estiver preenchido em `Login`
|
4
|
+
* Adiciona separador `;` nos parametros do tipo array em `GeneratePromise` e `GetCampaignNegotiation`
|
5
|
+
* Implementa `GetBoleto`
|
6
|
+
* Implementa `GetCampaignNegotiation`
|
7
|
+
|
1
8
|
### 0.1.0 (09/10/2018)
|
2
9
|
|
3
10
|
* Cria a gem
|
data/README.md
CHANGED
@@ -30,6 +30,8 @@ Ou instale você mesmo:
|
|
30
30
|
- [AcceptLegalTerms](#acceptlegalterms)
|
31
31
|
- [GeneratePromise](#generatepromise)
|
32
32
|
- [GetAccounts](#getaccounts)
|
33
|
+
- [GetBoleto](#getboleto)
|
34
|
+
- [GetCampaignNegotiation](#getcampaignnegotiation)
|
33
35
|
- [GetEmails](#getemails)
|
34
36
|
- [GetProviders](#getproviders)
|
35
37
|
- [SaveEmail](#saveemail)
|
@@ -63,6 +65,20 @@ response = Credigy::Account.new(authorization_token).call
|
|
63
65
|
response.all # array de contas
|
64
66
|
```
|
65
67
|
|
68
|
+
### GetBoleto
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
response = Credigy::Boleto.new(authorization_token, debtor_agreement_id: '123', installment_number: '2').call
|
72
|
+
response.pdf # pdf stream
|
73
|
+
```
|
74
|
+
|
75
|
+
### GetCampaignNegotiation
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
response = Credigy::CampaignNegotiation.new(authorization_token, owner_id: 'z', accounts: ['y'], provider_ids: ['x']).call
|
79
|
+
response.all # array de negociações possíveis
|
80
|
+
```
|
81
|
+
|
66
82
|
### GetEmails
|
67
83
|
|
68
84
|
```ruby
|
@@ -97,11 +113,21 @@ end
|
|
97
113
|
|
98
114
|
Se estiver no Rails, esse arquivo pode ser colocado em `config/initializers/credigy.rb`.
|
99
115
|
|
100
|
-
##
|
116
|
+
## Desenvolvimento
|
117
|
+
|
118
|
+
### Testes
|
119
|
+
|
120
|
+
`rake spec`
|
121
|
+
|
122
|
+
### Console
|
123
|
+
|
124
|
+
`bundle console`
|
125
|
+
|
126
|
+
### Release
|
101
127
|
|
102
|
-
|
128
|
+
Atualize o número da versão em `version.rb` e rode:
|
103
129
|
|
104
|
-
|
130
|
+
`bundle exec rake release`
|
105
131
|
|
106
132
|
## License
|
107
133
|
|
data/lib/credigy.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require_relative './authorized'
|
2
|
+
require_relative './boleto_response'
|
3
|
+
|
4
|
+
module Credigy
|
5
|
+
class Boleto < Authorized
|
6
|
+
attr_reader :params
|
7
|
+
|
8
|
+
def initialize(authorization_token, **params)
|
9
|
+
@params = params
|
10
|
+
end
|
11
|
+
|
12
|
+
def operation
|
13
|
+
:get_boleto
|
14
|
+
end
|
15
|
+
|
16
|
+
def message
|
17
|
+
{
|
18
|
+
'cred:debtorAgreementID' => params[:debtor_agreement_id],
|
19
|
+
'cred:installmentNumber' => params[:installment_number]
|
20
|
+
}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative './authorized'
|
2
|
+
require_relative './campaign_negotiation_response'
|
3
|
+
|
4
|
+
module Credigy
|
5
|
+
class CampaignNegotiation < Authorized
|
6
|
+
attr_reader :params
|
7
|
+
|
8
|
+
def initialize(authorization_token, **params)
|
9
|
+
@authorization_token, @params = authorization_token, params
|
10
|
+
end
|
11
|
+
|
12
|
+
def operation
|
13
|
+
:get_campaign_negotiation
|
14
|
+
end
|
15
|
+
|
16
|
+
def message
|
17
|
+
{
|
18
|
+
'cred:Ownerid' => params[:owner_id],
|
19
|
+
'cred:Accounts' => Array(params[:accounts]).join(';'),
|
20
|
+
'cred:Providers' => Array(params[:provider_ids]).join(';')
|
21
|
+
}
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/credigy/promise.rb
CHANGED
@@ -23,7 +23,7 @@ module Credigy
|
|
23
23
|
|
24
24
|
def message
|
25
25
|
{
|
26
|
-
'cred:Accounts' => params[:accounts],
|
26
|
+
'cred:Accounts' => Array(params[:accounts]).join(';'),
|
27
27
|
'cred:TotalInstallments' => params[:installments],
|
28
28
|
'cred:FirstInstallmentDate' => params[:first_installment_date],
|
29
29
|
'cred:TotalAgreementAmount' => params[:agreement_value]
|
data/lib/credigy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: credigy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Glauco Custódio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -103,6 +103,10 @@ files:
|
|
103
103
|
- lib/credigy/account.rb
|
104
104
|
- lib/credigy/account_response.rb
|
105
105
|
- lib/credigy/authorized.rb
|
106
|
+
- lib/credigy/boleto.rb
|
107
|
+
- lib/credigy/boleto_response.rb
|
108
|
+
- lib/credigy/campaign_negotiation.rb
|
109
|
+
- lib/credigy/campaign_negotiation_response.rb
|
106
110
|
- lib/credigy/config.rb
|
107
111
|
- lib/credigy/email.rb
|
108
112
|
- lib/credigy/email_creation.rb
|