starkbank 0.2.1 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9faf8d2408757d1281ac59d59cba4303a3db835b21382a7a89d02110c5c2ae07
4
- data.tar.gz: d615e724e7e2a51a5ced3b852bc84895b512fdc5b0a1c3fb456455619f1d1744
3
+ metadata.gz: 210f7bc9491667343dff3f32f2fef3b3b869ee6bf7c6ba901ed020546490636f
4
+ data.tar.gz: d71f5d62281fa05ccb36487c8232c78a1407c66c10d7d0e2122dff07eb713b1b
5
5
  SHA512:
6
- metadata.gz: acbc1fd9c1c9636dff4d50209bc833618fce68e7d32da3b004e965ff4bd6138aa27a464e6e14a6766fe700bca41f4736ddfda58ae7a3d3d49f8e84d0004a2888
7
- data.tar.gz: 8728b2cfb5c1afa974c90f54eb0439d43f21f9e72ab968a715a6dddb8a0262f72d9d0ffeeaf462c837602d4cb6b7c70413770c27624dadb6cdb87fa51def730c
6
+ metadata.gz: bb6d31e105832bd852f06b9d8c5dc1deb492403df67537f38a41f3a298f81102a233fc32a5dbe06fc1cd6eb5eca0e930599ae7a97162c18e74a56e53ef384813
7
+ data.tar.gz: 172d18b8cbb36c3213808a450b796a0d3620b0d718d8c6d8a0143fbc0b16b2bb8d531f74212c7208bf481b8c270a920e8910fe4168b262a8880862eca31e0ce6
data/lib/boleto/boleto.rb CHANGED
@@ -27,6 +27,8 @@ module StarkBank
27
27
  # - fine [float, default 0.0]: Boleto fine for overdue payment in %. ex: 2.5
28
28
  # - interest [float, default 0.0]: Boleto monthly interest for overdue payment in %. ex: 5.2
29
29
  # - overdue_limit [integer, default 59]: limit in days for payment after due date. ex: 7 (max: 59)
30
+ # - receiver_name [string]: receiver (Sacador Avalista) full name. ex: 'Anthony Edward Stark'
31
+ # - receiver_tax_id [string]: receiver (Sacador Avalista) tax ID (CPF or CNPJ) with or without formatting. ex: '01234567890' or '20.018.183/0001-80'
30
32
  # - descriptions [list of dictionaries, default nil]: list of dictionaries with 'text':string and (optional) 'amount':int pairs
31
33
  # - discounts [list of dictionaries, default nil]: list of dictionaries with 'percentage':float and 'date':Date or string pairs
32
34
  # - tags [list of strings]: list of strings for tagging
@@ -39,11 +41,12 @@ module StarkBank
39
41
  # - status [string, default nil]: current Boleto status. ex: 'registered' or 'paid'
40
42
  # - created [DateTime, default nil]: creation datetime for the Boleto. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
41
43
  class Boleto < StarkBank::Utils::Resource
42
- attr_reader :amount, :name, :tax_id, :street_line_1, :street_line_2, :district, :city, :state_code, :zip_code, :due, :fine, :interest, :overdue_limit, :tags, :descriptions, :discounts, :id, :fee, :line, :bar_code, :status, :created
44
+ attr_reader :amount, :name, :tax_id, :street_line_1, :street_line_2, :district, :city, :state_code, :zip_code, :due, :fine, :interest, :overdue_limit, :receiver_name, :receiver_tax_id, :tags, :descriptions, :discounts, :id, :fee, :line, :bar_code, :status, :created
43
45
  def initialize(
44
46
  amount:, name:, tax_id:, street_line_1:, street_line_2:, district:, city:, state_code:, zip_code:,
45
- due: nil, fine: nil, interest: nil, overdue_limit: nil, tags: nil, descriptions: nil, discounts: nil,
46
- id: nil, fee: nil, line: nil, bar_code: nil, status: nil, created: nil
47
+ due: nil, fine: nil, interest: nil, overdue_limit: nil, receiver_name: nil, receiver_tax_id: nil,
48
+ tags: nil, descriptions: nil, discounts: nil, id: nil, fee: nil, line: nil, bar_code: nil,
49
+ status: nil, created: nil
47
50
  )
48
51
  super(id)
49
52
  @amount = amount
@@ -59,6 +62,8 @@ module StarkBank
59
62
  @fine = fine
60
63
  @interest = interest
61
64
  @overdue_limit = overdue_limit
65
+ @receiver_name = receiver_name
66
+ @receiver_tax_id = receiver_tax_id
62
67
  @tags = tags
63
68
  @descriptions = descriptions
64
69
  @discounts = discounts
@@ -181,6 +186,8 @@ module StarkBank
181
186
  fine: json['fine'],
182
187
  interest: json['interest'],
183
188
  overdue_limit: json['overdue_limit'],
189
+ receiver_name: json['receiver_name'],
190
+ receiver_tax_id: json['receiver_tax_id'],
184
191
  tags: json['tags'],
185
192
  descriptions: json['descriptions'],
186
193
  discounts: json['discounts'],
data/lib/utils/request.rb CHANGED
@@ -60,7 +60,7 @@ module StarkBank
60
60
  req['Access-Time'] = access_time
61
61
  req['Access-Signature'] = signature
62
62
  req['Content-Type'] = 'application/json'
63
- req['User-Agent'] = "Ruby-#{RUBY_VERSION}-SDK-0.2.1"
63
+ req['User-Agent'] = "Ruby-#{RUBY_VERSION}-SDK-0.3.0"
64
64
 
65
65
  request = Net::HTTP.start(uri.hostname, use_ssl: true) { |http| http.request(req) }
66
66
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: starkbank
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - starkbank