cobrato-client 0.3.0 → 0.4.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea2bff49ea289f8b3ad1a5a2be61be76239d2df3
4
- data.tar.gz: d6796180af1524f229cdc6c342f9a3a95ba3db6d
3
+ metadata.gz: 37cc839dc49f090341f3e1a352d1e4db8bdc2ae0
4
+ data.tar.gz: 2c8936cd451d11ded007262cc4756a9297684875
5
5
  SHA512:
6
- metadata.gz: 2a79565ba56a8c71d72b2ac9e86532c15a632ed37d14090872d7874719fc30f59c855a5cf704e76f3ccd7cf2cec17c141ce9a9bb4b3025df834464187f4bbad7
7
- data.tar.gz: 98cd323efbeef2fd41e72135986a0d5a0a9af5fc88edde46358888e8487bae89e358a456ad9fab6af41c154a637376f8f785939f5e1f062fb084fbdcac26aad7
6
+ metadata.gz: 6f795889d39cc68c52af1d6623de7f7e7645385321403b48a407654e8ce0528d816e1229306fa17b5e16bdc182089443c798f2046210096bc3794f340d21efb9
7
+ data.tar.gz: f05d1ec5c6844ef06621c28321d354050a81f93b6c6af36cca2c517ba3d295d3c8adff2600bef98043281f8ad0a84edf9019ad33c987fea747f048b30aa7d2a2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cobrato-client (0.3.0)
4
+ cobrato-client (0.4.0.rc1)
5
5
  multi_json (~> 1.11.1)
6
6
  typhoeus (~> 0.7.2)
7
7
  virtus (~> 1.0.5)
data/README.md CHANGED
@@ -101,6 +101,7 @@ end
101
101
  | POST | [api/v1/charges/:id/undo_receive](http://docs.cobrato.com/#desfazer-recebimento-de-cobrança) | client.charges.undo_receive |
102
102
  | POST | [api/v1/charges/:id/deliver_billet](http://docs.cobrato.com/#envio-de-boleto-da-cobrança) | client.charges.deliver_billet |
103
103
  | GET | [api/v1/charges/:id/billet](http://docs.cobrato.com/#boleto-da-cobrança) | client.charges.billet |
104
+ | POST | [api/v1/charges/:id/cancel](http://docs.cobrato.com/#cancelar-cobrança) | client.charges.cancel |
104
105
 
105
106
  #### [Regress Cnab](http://docs.cobrato.com/#cnab-de-retorno)
106
107
 
@@ -123,6 +124,13 @@ end
123
124
  | GET | [api/v1/remittance_cnabs/:id/file](http://docs.cobrato.com/#arquivo-do-cnab-de-remessa) | client.remittance_cnabs.file |
124
125
  | GET | [api/v1/remittance_cnabs/:id/charges](http://docs.cobrato.com/#lista-de-todas-as-cobrança-do-arquivo-de-remessa) | client.remittance_cnabs.charges |
125
126
 
127
+
128
+ #### [Credit Card](http://docs.cobrato.com/#cartao-de-credito)
129
+
130
+ | HTTP method | Endpoint | Client method |
131
+ | ----------- | ----------------------------------------------------------------------------------- | ------------------------ |
132
+ | GET | [api/v1/credit_cards/:id](http://docs.cobrato.com/#informações-do-cartao-de-credit) | client.credit_cards.show |
133
+
126
134
  #### [Webhooks](http://docs.cobrato.com/#webhook)
127
135
 
128
136
  | HTTP method | Endpoint | Client method |
@@ -17,6 +17,7 @@ require "cobrato/entities/webhook"
17
17
  require "cobrato/entities/bank_billet"
18
18
  require "cobrato/entities/regress_cnab"
19
19
  require "cobrato/entities/remittance_cnab"
20
+ require "cobrato/entities/credit_card"
20
21
 
21
22
  require "cobrato/resources/base"
22
23
  require "cobrato/resources/payee"
@@ -27,6 +28,7 @@ require "cobrato/resources/webhook"
27
28
  require "cobrato/resources/charging_type"
28
29
  require "cobrato/resources/regress_cnab"
29
30
  require "cobrato/resources/remittance_cnab"
31
+ require "cobrato/resources/credit_card"
30
32
 
31
33
  module Cobrato
32
34
  def self.configuration
@@ -46,5 +46,9 @@ module Cobrato
46
46
  def remittance_cnabs
47
47
  Resources::RemittanceCnab.new(http)
48
48
  end
49
+
50
+ def credit_cards
51
+ Resources::CreditCard.new(http)
52
+ end
49
53
  end
50
54
  end
@@ -4,6 +4,21 @@ module Cobrato
4
4
  attribute :id, Integer
5
5
  attribute :type, String
6
6
  attribute :charge_config_id, Integer
7
+ attribute :total_amount, Decimal
8
+ attribute :payer_emails, String
9
+ attribute :payer_id, Integer
10
+ attribute :payer_national_identifier_type, String
11
+ attribute :payer_national_identifier, String
12
+ attribute :payer_name, String
13
+ attribute :payer_number, String
14
+ attribute :payer_complement, String
15
+ attribute :payer_street, String
16
+ attribute :payer_neighbourhood, String
17
+ attribute :payer_zipcode, String
18
+ attribute :payer_city, String
19
+ attribute :payer_state, String
20
+
21
+ # billet specifics
7
22
  attribute :due_date, Date
8
23
  attribute :processing_date, Date
9
24
  attribute :document_kind, String
@@ -12,28 +27,24 @@ module Cobrato
12
27
  attribute :custom_our_number, Boolean
13
28
  attribute :our_number, String
14
29
  attribute :our_number_digit, String
15
- attribute :total_amount, Decimal
16
30
  attribute :instructions, String
17
31
  attribute :demonstrative, String
18
- attribute :payer_emails, String
19
- attribute :payer_info, String
20
32
  attribute :received, Boolean
21
33
  attribute :received_amount, Decimal
22
34
  attribute :received_at, Date
23
- attribute :processing_date, Date
24
35
  attribute :for_homologation, Boolean
25
36
  attribute :registrable, Boolean
26
37
  attribute :registration_status, String
27
- attribute :payer_national_identifier_type, String
28
- attribute :payer_national_identifier, String
29
- attribute :payer_name, String
30
- attribute :payer_number, String
31
- attribute :payer_complement, String
32
- attribute :payer_street, String
33
- attribute :payer_neighbourhood, String
34
- attribute :payer_zipcode, String
35
- attribute :payer_city, String
36
- attribute :payer_state, String
38
+
39
+ # payment gateway specifics
40
+ attribute :credit_card_id, Integer
41
+ attribute :description, String
42
+ attribute :soft_descriptor, String
43
+ attribute :payment_method, String
44
+ attribute :installments, Integer
45
+ attribute :generate_token, Boolean
46
+ attribute :payment_gateway_status, String
47
+ attribute :payment_gateway_message, String
37
48
  end
38
49
  end
39
50
  end
@@ -2,16 +2,18 @@ module Cobrato
2
2
  module Entities
3
3
  class ChargeConfig < Base
4
4
  attribute :id, Integer
5
+ attribute :name, String
5
6
  attribute :type, String
7
+ attribute :status, String
8
+
9
+ # billet specifics
6
10
  attribute :bank_account_id, Integer
7
11
  attribute :portfolio_code, String
8
12
  attribute :agreement_code, String
9
13
  attribute :agreement_code_digit, String
10
- attribute :name, String
11
14
  attribute :initial_number, Integer
12
15
  attribute :current_number, Integer
13
16
  attribute :end_number, Integer
14
- attribute :status, String
15
17
  attribute :registered_charges, Boolean
16
18
  attribute :agreement_number, Integer
17
19
  attribute :initial_remittance_number, Integer
@@ -21,6 +23,12 @@ module Cobrato
21
23
  attribute :mulct_type, String
22
24
  attribute :mulct_value, Decimal
23
25
  attribute :transmission_code, String
26
+
27
+ # payment gateway specifics
28
+ attribute :gateway_name, String
29
+ attribute :gateway_id, String
30
+ attribute :gateway_key, String
31
+ attribute :use_avs, Boolean
24
32
  end
25
33
  end
26
34
  end
@@ -0,0 +1,18 @@
1
+ module Cobrato
2
+ module Entities
3
+ class CreditCard < Base
4
+ attribute :id, Integer
5
+ attribute :final_numbers, String
6
+ attribute :holder_name, String
7
+ attribute :unusable, Boolean
8
+ attribute :brand, String
9
+ attribute :expiration, String
10
+ attribute :avs_address, String
11
+ attribute :avs_number, String
12
+ attribute :avs_complement, String
13
+ attribute :avs_district, String
14
+ attribute :avs_zipcode, String
15
+ attribute :payer_id, Integer
16
+ end
17
+ end
18
+ end
@@ -28,6 +28,12 @@ module Cobrato
28
28
  end
29
29
  end
30
30
 
31
+ def cancel(id)
32
+ http.post("#{resource_base_path}/#{id}/cancel") do |response|
33
+ response.code == 204
34
+ end
35
+ end
36
+
31
37
  notify :receive, :undo_receive
32
38
  end
33
39
  end
@@ -0,0 +1,7 @@
1
+ module Cobrato
2
+ module Resources
3
+ class CreditCard < Base
4
+ crud :show
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Cobrato
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0.rc1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cobrato-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcio Ricardo Santos
@@ -10,160 +10,160 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2016-04-07 00:00:00.000000000 Z
13
+ date: 2016-05-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: typhoeus
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ~>
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
21
  version: 0.7.2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ~>
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
28
  version: 0.7.2
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: multi_json
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ~>
33
+ - - "~>"
34
34
  - !ruby/object:Gem::Version
35
35
  version: 1.11.1
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ~>
40
+ - - "~>"
41
41
  - !ruby/object:Gem::Version
42
42
  version: 1.11.1
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: virtus
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ~>
47
+ - - "~>"
48
48
  - !ruby/object:Gem::Version
49
49
  version: 1.0.5
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ~>
54
+ - - "~>"
55
55
  - !ruby/object:Gem::Version
56
56
  version: 1.0.5
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: wisper
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ~>
61
+ - - "~>"
62
62
  - !ruby/object:Gem::Version
63
63
  version: '1.6'
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - ~>
68
+ - - "~>"
69
69
  - !ruby/object:Gem::Version
70
70
  version: '1.6'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: bundler
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - ~>
75
+ - - "~>"
76
76
  - !ruby/object:Gem::Version
77
77
  version: '1.9'
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ~>
82
+ - - "~>"
83
83
  - !ruby/object:Gem::Version
84
84
  version: '1.9'
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: rake
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ~>
89
+ - - "~>"
90
90
  - !ruby/object:Gem::Version
91
91
  version: '10.4'
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - ~>
96
+ - - "~>"
97
97
  - !ruby/object:Gem::Version
98
98
  version: '10.4'
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: vcr
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ~>
103
+ - - "~>"
104
104
  - !ruby/object:Gem::Version
105
105
  version: '2.9'
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - ~>
110
+ - - "~>"
111
111
  - !ruby/object:Gem::Version
112
112
  version: '2.9'
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: pry-byebug
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - ~>
117
+ - - "~>"
118
118
  - !ruby/object:Gem::Version
119
119
  version: '3.1'
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - ~>
124
+ - - "~>"
125
125
  - !ruby/object:Gem::Version
126
126
  version: '3.1'
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: rspec
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - ~>
131
+ - - "~>"
132
132
  - !ruby/object:Gem::Version
133
133
  version: '3.4'
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - ~>
138
+ - - "~>"
139
139
  - !ruby/object:Gem::Version
140
140
  version: '3.4'
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: codeclimate-test-reporter
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ~>
145
+ - - "~>"
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0.4'
148
148
  type: :development
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
- - - ~>
152
+ - - "~>"
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0.4'
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: simplecov
157
157
  requirement: !ruby/object:Gem::Requirement
158
158
  requirements:
159
- - - ~>
159
+ - - "~>"
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0.10'
162
162
  type: :development
163
163
  prerelease: false
164
164
  version_requirements: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - ~>
166
+ - - "~>"
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0.10'
169
169
  description: This is the official Ruby client for the Cobrato API. See https://app.cobrato.com
@@ -176,10 +176,10 @@ executables: []
176
176
  extensions: []
177
177
  extra_rdoc_files: []
178
178
  files:
179
- - .gitignore
180
- - .hound.yml
181
- - .rspec
182
- - .travis.yml
179
+ - ".gitignore"
180
+ - ".hound.yml"
181
+ - ".rspec"
182
+ - ".travis.yml"
183
183
  - CHANGELOG.md
184
184
  - Gemfile
185
185
  - Gemfile.lock
@@ -197,6 +197,7 @@ files:
197
197
  - lib/cobrato/entities/base.rb
198
198
  - lib/cobrato/entities/charge.rb
199
199
  - lib/cobrato/entities/charge_config.rb
200
+ - lib/cobrato/entities/credit_card.rb
200
201
  - lib/cobrato/entities/payee.rb
201
202
  - lib/cobrato/entities/regress_cnab.rb
202
203
  - lib/cobrato/entities/remittance_cnab.rb
@@ -209,6 +210,7 @@ files:
209
210
  - lib/cobrato/resources/charge.rb
210
211
  - lib/cobrato/resources/charge_config.rb
211
212
  - lib/cobrato/resources/charging_type.rb
213
+ - lib/cobrato/resources/credit_card.rb
212
214
  - lib/cobrato/resources/hooks.rb
213
215
  - lib/cobrato/resources/payee.rb
214
216
  - lib/cobrato/resources/regress_cnab.rb
@@ -227,17 +229,17 @@ require_paths:
227
229
  - lib
228
230
  required_ruby_version: !ruby/object:Gem::Requirement
229
231
  requirements:
230
- - - '>='
232
+ - - ">="
231
233
  - !ruby/object:Gem::Version
232
234
  version: '0'
233
235
  required_rubygems_version: !ruby/object:Gem::Requirement
234
236
  requirements:
235
- - - '>='
237
+ - - ">"
236
238
  - !ruby/object:Gem::Version
237
- version: '0'
239
+ version: 1.3.1
238
240
  requirements: []
239
241
  rubyforge_project:
240
- rubygems_version: 2.0.14.1
242
+ rubygems_version: 2.4.5.1
241
243
  signing_key:
242
244
  specification_version: 4
243
245
  summary: This is the official Ruby client for the Cobrato API.