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 +4 -4
- data/lib/boleto/boleto.rb +10 -3
- data/lib/utils/request.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 210f7bc9491667343dff3f32f2fef3b3b869ee6bf7c6ba901ed020546490636f
|
4
|
+
data.tar.gz: d71f5d62281fa05ccb36487c8232c78a1407c66c10d7d0e2122dff07eb713b1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
46
|
-
|
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.
|
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
|
|