starkbank 0.2.0 → 0.2.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/lib/balance/balance.rb +2 -2
- data/lib/boleto/boleto.rb +13 -13
- data/lib/boleto/log.rb +4 -4
- data/lib/boleto_payment/boleto_payment.rb +11 -11
- data/lib/boleto_payment/log.rb +4 -4
- data/lib/event/event.rb +6 -6
- data/lib/transaction/transaction.rb +2 -2
- data/lib/transfer/log.rb +4 -4
- data/lib/transfer/transfer.rb +6 -6
- data/lib/utility_payment/log.rb +5 -5
- data/lib/utility_payment/utility_payment.rb +9 -9
- data/lib/utils/request.rb +1 -1
- data/lib/webhook/webhook.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: 9faf8d2408757d1281ac59d59cba4303a3db835b21382a7a89d02110c5c2ae07
|
4
|
+
data.tar.gz: d615e724e7e2a51a5ced3b852bc84895b512fdc5b0a1c3fb456455619f1d1744
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acbc1fd9c1c9636dff4d50209bc833618fce68e7d32da3b004e965ff4bd6138aa27a464e6e14a6766fe700bca41f4736ddfda58ae7a3d3d49f8e84d0004a2888
|
7
|
+
data.tar.gz: 8728b2cfb5c1afa974c90f54eb0439d43f21f9e72ab968a715a6dddb8a0262f72d9d0ffeeaf462c837602d4cb6b7c70413770c27624dadb6cdb87fa51def730c
|
data/lib/balance/balance.rb
CHANGED
@@ -13,9 +13,9 @@ module StarkBank
|
|
13
13
|
# can be retrieved to see the available information.
|
14
14
|
#
|
15
15
|
# ## Attributes (return-only):
|
16
|
-
# - id [string, default nil]: unique id returned when
|
16
|
+
# - id [string, default nil]: unique id returned when Balance is created. ex: '5656565656565656'
|
17
17
|
# - amount [integer, default nil]: current balance amount of the workspace in cents. ex: 200 (= R$ 2.00)
|
18
|
-
# - currency [string, default nil]: currency of the current workspace. Expect others to be added eventually. ex:
|
18
|
+
# - currency [string, default nil]: currency of the current workspace. Expect others to be added eventually. ex:'BRL'
|
19
19
|
# - updated [DateTime, default nil]: update datetime for the balance. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
20
20
|
class Balance < StarkBank::Utils::Resource
|
21
21
|
attr_reader :amount, :currency, :updated
|
data/lib/boleto/boleto.rb
CHANGED
@@ -13,8 +13,8 @@ module StarkBank
|
|
13
13
|
#
|
14
14
|
# ## Parameters (required):
|
15
15
|
# - amount [integer]: Boleto value in cents. Minimum = 200 (R$2,00). ex: 1234 (= R$ 12.34)
|
16
|
-
# - name [string]: payer full name. ex:
|
17
|
-
# - tax_id [string]: payer tax ID (CPF or CNPJ) with or without formatting. ex:
|
16
|
+
# - name [string]: payer full name. ex: 'Anthony Edward Stark'
|
17
|
+
# - tax_id [string]: payer tax ID (CPF or CNPJ) with or without formatting. ex: '01234567890' or '20.018.183/0001-80'
|
18
18
|
# - street_line_1 [string]: payer main address. ex: Av. Paulista, 200
|
19
19
|
# - street_line_2 [string]: payer address complement. ex: Apto. 123
|
20
20
|
# - district [string]: payer address district / neighbourhood. ex: Bela Vista
|
@@ -23,20 +23,20 @@ module StarkBank
|
|
23
23
|
# - zip_code [string]: payer address zip code. ex: 01311-200
|
24
24
|
#
|
25
25
|
# ## Parameters (optional):
|
26
|
-
# - due [Date, DateTime, Time or string, default today + 2 days]: Boleto due date in ISO format. ex: 2020-04-30
|
26
|
+
# - due [Date, DateTime, Time or string, default today + 2 days]: Boleto due date in ISO format. ex: '2020-04-30'
|
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
|
-
# - overdue_limit [integer, default 59]: limit in days for
|
30
|
-
# - descriptions [list of dictionaries, default nil]: list of dictionaries with
|
31
|
-
# - discounts [list of dictionaries, default nil]: list of dictionaries with
|
29
|
+
# - overdue_limit [integer, default 59]: limit in days for payment after due date. ex: 7 (max: 59)
|
30
|
+
# - descriptions [list of dictionaries, default nil]: list of dictionaries with 'text':string and (optional) 'amount':int pairs
|
31
|
+
# - discounts [list of dictionaries, default nil]: list of dictionaries with 'percentage':float and 'date':Date or string pairs
|
32
32
|
# - tags [list of strings]: list of strings for tagging
|
33
33
|
#
|
34
34
|
# ## Attributes (return-only):
|
35
|
-
# - id [string, default nil]: unique id returned when Boleto is created. ex:
|
35
|
+
# - id [string, default nil]: unique id returned when Boleto is created. ex: '5656565656565656'
|
36
36
|
# - fee [integer, default nil]: fee charged when Boleto is paid. ex: 200 (= R$ 2.00)
|
37
|
-
# - line [string, default nil]: generated Boleto line for payment. ex:
|
38
|
-
# - bar_code [string, default nil]: generated Boleto bar-code for payment. ex:
|
39
|
-
# - status [string, default nil]: current Boleto status. ex:
|
37
|
+
# - line [string, default nil]: generated Boleto line for payment. ex: '34191.09008 63571.277308 71444.640008 5 81960000000062'
|
38
|
+
# - bar_code [string, default nil]: generated Boleto bar-code for payment. ex: '34195819600000000621090063571277307144464000'
|
39
|
+
# - status [string, default nil]: current Boleto status. ex: 'registered' or 'paid'
|
40
40
|
# - created [DateTime, default nil]: creation datetime for the Boleto. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
41
41
|
class Boleto < StarkBank::Utils::Resource
|
42
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
|
@@ -90,7 +90,7 @@ module StarkBank
|
|
90
90
|
# Receive a single Boleto object previously created in the Stark Bank API by passing its id
|
91
91
|
#
|
92
92
|
# ## Parameters (required):
|
93
|
-
# - id [string]: object unique id. ex:
|
93
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
94
94
|
#
|
95
95
|
# ## Parameters (optional):
|
96
96
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -106,7 +106,7 @@ module StarkBank
|
|
106
106
|
# Receive a single Boleto pdf file generated in the Stark Bank API by passing its id.
|
107
107
|
#
|
108
108
|
# ## Parameters (required):
|
109
|
-
# - id [string]: object unique id. ex:
|
109
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
110
110
|
#
|
111
111
|
# ## Parameters (optional):
|
112
112
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -152,7 +152,7 @@ module StarkBank
|
|
152
152
|
# Delete a Boleto entity previously created in the Stark Bank API
|
153
153
|
#
|
154
154
|
# ## Parameters (required):
|
155
|
-
# - id [string]: Boleto unique id. ex:
|
155
|
+
# - id [string]: Boleto unique id. ex: '5656565656565656'
|
156
156
|
#
|
157
157
|
# ## Parameters (optional):
|
158
158
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
data/lib/boleto/log.rb
CHANGED
@@ -15,11 +15,11 @@ module StarkBank
|
|
15
15
|
# on the Boleto.
|
16
16
|
#
|
17
17
|
# ## Attributes:
|
18
|
-
# - id [string]: unique id returned when the log is created. ex:
|
18
|
+
# - id [string]: unique id returned when the log is created. ex: '5656565656565656'
|
19
19
|
# - boleto [Boleto]: Boleto entity to which the log refers to.
|
20
20
|
# - errors [list of strings]: list of errors linked to this Boleto event
|
21
|
-
# - type [string]: type of the Boleto event which triggered the log creation. ex:
|
22
|
-
# - created [DateTime]: creation datetime for the
|
21
|
+
# - type [string]: type of the Boleto event which triggered the log creation. ex: 'registered' or 'paid'
|
22
|
+
# - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
23
23
|
class Log < StarkBank::Utils::Resource
|
24
24
|
attr_reader :id, :created, :type, :errors, :boleto
|
25
25
|
def initialize(id:, created:, type:, errors:, boleto:)
|
@@ -35,7 +35,7 @@ module StarkBank
|
|
35
35
|
# Receive a single Log object previously created by the Stark Bank API by passing its id
|
36
36
|
#
|
37
37
|
# ## Parameters (required):
|
38
|
-
# - id [string]: object unique id. ex:
|
38
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
39
39
|
#
|
40
40
|
# ## Parameters (optional):
|
41
41
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -12,22 +12,22 @@ module StarkBank
|
|
12
12
|
# to the Stark Bank API and returns the list of created objects.
|
13
13
|
#
|
14
14
|
# ## Parameters (conditionally required):
|
15
|
-
# - line [string, default nil]: Number sequence that describes the payment. Either 'line' or 'bar_code' parameters are required. If both are sent, they must match. ex:
|
16
|
-
# - bar_code [string, default nil]: Bar code number that describes the payment. Either 'line' or 'barCode' parameters are required. If both are sent, they must match. ex:
|
15
|
+
# - line [string, default nil]: Number sequence that describes the payment. Either 'line' or 'bar_code' parameters are required. If both are sent, they must match. ex: '34191.09008 63571.277308 71444.640008 5 81960000000062'
|
16
|
+
# - bar_code [string, default nil]: Bar code number that describes the payment. Either 'line' or 'barCode' parameters are required. If both are sent, they must match. ex: '34195819600000000621090063571277307144464000'
|
17
17
|
#
|
18
18
|
# ## Parameters (required):
|
19
|
-
# - tax_id [string]: receiver tax ID (CPF or CNPJ) with or without formatting. ex:
|
20
|
-
# - description [string]: Text to be displayed in your statement (min. 10 characters). ex:
|
19
|
+
# - tax_id [string]: receiver tax ID (CPF or CNPJ) with or without formatting. ex: '01234567890' or '20.018.183/0001-80'
|
20
|
+
# - description [string]: Text to be displayed in your statement (min. 10 characters). ex: 'payment ABC'
|
21
21
|
#
|
22
22
|
# ## Parameters (optional):
|
23
23
|
# - scheduled [Date, DateTime, Time or string, default today]: payment scheduled date. ex: Date.new(2020, 3, 10)
|
24
24
|
# - tags [list of strings]: list of strings for tagging
|
25
25
|
#
|
26
26
|
# ## Attributes (return-only):
|
27
|
-
# - id [string, default nil]: unique id returned when payment is created. ex:
|
28
|
-
# - status [string, default nil]: current payment status. ex:
|
27
|
+
# - id [string, default nil]: unique id returned when payment is created. ex: '5656565656565656'
|
28
|
+
# - status [string, default nil]: current payment status. ex: 'success' or 'failed'
|
29
29
|
# - amount [int, default nil]: amount automatically calculated from line or bar_code. ex: 23456 (= R$ 234.56)
|
30
|
-
# - fee [integer, default nil]: fee charged when boleto payment is created. ex: 200 (= R$ 2.00)
|
30
|
+
# - fee [integer, default nil]: fee charged when the boleto payment is created. ex: 200 (= R$ 2.00)
|
31
31
|
# - created [DateTime, default nil]: creation datetime for the payment. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
32
32
|
class BoletoPayment < StarkBank::Utils::Resource
|
33
33
|
attr_reader :tax_id, :description, :line, :bar_code, :scheduled, :tags, :id, :status, :amount, :fee, :created
|
@@ -66,7 +66,7 @@ module StarkBank
|
|
66
66
|
# Receive a single BoletoPayment object previously created by the Stark Bank API by passing its id
|
67
67
|
#
|
68
68
|
# ## Parameters (required):
|
69
|
-
# - id [string]: object unique id. ex:
|
69
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
70
70
|
#
|
71
71
|
# ## Parameters (optional):
|
72
72
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -80,10 +80,10 @@ module StarkBank
|
|
80
80
|
# # Retrieve a specific BoletoPayment pdf file
|
81
81
|
#
|
82
82
|
# Receive a single BoletoPayment pdf file generated in the Stark Bank API by passing its id.
|
83
|
-
# Only valid for boleto payments with
|
83
|
+
# Only valid for boleto payments with 'success' status.
|
84
84
|
#
|
85
85
|
# ## Parameters (required):
|
86
|
-
# - id [string]: object unique id. ex:
|
86
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
87
87
|
#
|
88
88
|
# ## Parameters (optional):
|
89
89
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -129,7 +129,7 @@ module StarkBank
|
|
129
129
|
# Delete a BoletoPayment entity previously created in the Stark Bank API
|
130
130
|
#
|
131
131
|
# Parameters (required):
|
132
|
-
# - id [string]: BoletoPayment unique id. ex:
|
132
|
+
# - id [string]: BoletoPayment unique id. ex: '5656565656565656'
|
133
133
|
# Parameters (optional):
|
134
134
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
135
135
|
# Return:
|
data/lib/boleto_payment/log.rb
CHANGED
@@ -15,11 +15,11 @@ module StarkBank
|
|
15
15
|
# on the BoletoPayment.
|
16
16
|
#
|
17
17
|
# ## Attributes:
|
18
|
-
# - id [string]: unique id returned when the log is created. ex:
|
18
|
+
# - id [string]: unique id returned when the log is created. ex: '5656565656565656'
|
19
19
|
# - payment [BoletoPayment]: BoletoPayment entity to which the log refers to.
|
20
20
|
# - errors [list of strings]: list of errors linked to this BoletoPayment event.
|
21
|
-
# - type [string]: type of the BoletoPayment event which triggered the log creation. ex:
|
22
|
-
# - created [DateTime]: creation datetime for the
|
21
|
+
# - type [string]: type of the BoletoPayment event which triggered the log creation. ex: 'processing' or 'success'
|
22
|
+
# - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
23
23
|
class Log < StarkBank::Utils::Resource
|
24
24
|
attr_reader :id, :created, :type, :errors, :payment
|
25
25
|
def initialize(id:, created:, type:, errors:, payment:)
|
@@ -35,7 +35,7 @@ module StarkBank
|
|
35
35
|
# Receive a single Log object previously created by the Stark Bank API by passing its id
|
36
36
|
#
|
37
37
|
# ## Parameters (required):
|
38
|
-
# - id [string]: object unique id. ex:
|
38
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
39
39
|
#
|
40
40
|
# ## Parameters (optional):
|
41
41
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
data/lib/event/event.rb
CHANGED
@@ -20,11 +20,11 @@ module StarkBank
|
|
20
20
|
# list all generated updates on entities.
|
21
21
|
#
|
22
22
|
# ## Attributes:
|
23
|
-
# - id [string]: unique id returned when the
|
23
|
+
# - id [string]: unique id returned when the event is created. ex: '5656565656565656'
|
24
24
|
# - log [Log]: a Log object from one the subscription services (TransferLog, BoletoLog, BoletoPaymentlog or UtilityPaymentLog)
|
25
25
|
# - created [DateTime]: creation datetime for the notification event. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
26
26
|
# - is_delivered [bool]: true if the event has been successfully delivered to the user url. ex: False
|
27
|
-
# - subscription [string]: service that triggered this event. ex:
|
27
|
+
# - subscription [string]: service that triggered this event. ex: 'transfer', 'utility-payment'
|
28
28
|
class Event < StarkBank::Utils::Resource
|
29
29
|
attr_reader :id, :log, :created, :is_delivered, :subscription
|
30
30
|
def initialize(id:, log:, created:, is_delivered:, subscription:)
|
@@ -48,7 +48,7 @@ module StarkBank
|
|
48
48
|
# Receive a single notification Event object previously created in the Stark Bank API by passing its id
|
49
49
|
#
|
50
50
|
# ## Parameters (required):
|
51
|
-
# - id [string]: object unique id. ex:
|
51
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
52
52
|
#
|
53
53
|
# ## Parameters (optional):
|
54
54
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -90,7 +90,7 @@ module StarkBank
|
|
90
90
|
# Delete a of notification Event entity previously created in the Stark Bank API by its ID
|
91
91
|
#
|
92
92
|
# ## Parameters (required):
|
93
|
-
# - id [string]: Event unique id. ex:
|
93
|
+
# - id [string]: Event unique id. ex: '5656565656565656'
|
94
94
|
#
|
95
95
|
# ## Parameters (optional):
|
96
96
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -107,7 +107,7 @@ module StarkBank
|
|
107
107
|
# If is_delivered is True, the event will no longer be returned on queries with is_delivered=False.
|
108
108
|
#
|
109
109
|
# ## Parameters (required):
|
110
|
-
# - id [list of strings]: Event unique ids. ex:
|
110
|
+
# - id [list of strings]: Event unique ids. ex: '5656565656565656'
|
111
111
|
# - is_delivered [bool]: If True and event hasn't been delivered already, event will be set as delivered. ex: True
|
112
112
|
#
|
113
113
|
# ## Parameters (optional):
|
@@ -127,7 +127,7 @@ module StarkBank
|
|
127
127
|
#
|
128
128
|
# ## Parameters (required):
|
129
129
|
# - content [string]: response content from request received at user endpoint (not parsed)
|
130
|
-
# - signature [string]: base-64 digital signature received at response header
|
130
|
+
# - signature [string]: base-64 digital signature received at response header 'Digital-Signature'
|
131
131
|
#
|
132
132
|
# ## Parameters (optional):
|
133
133
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -28,7 +28,7 @@ module StarkBank
|
|
28
28
|
# - sender_id [string]: unique id of the sending workspace. ex: '5656565656565656'
|
29
29
|
# - source [string, default nil]: locator of the entity that generated the transaction. ex: 'charge/1827351876292', 'transfer/92873912873/chargeback'
|
30
30
|
# - id [string, default nil]: unique id returned when Transaction is created. ex: '7656565656565656'
|
31
|
-
# - fee [integer, default nil]: fee charged when
|
31
|
+
# - fee [integer, default nil]: fee charged when transaction is created. ex: 200 (= R$ 2.00)
|
32
32
|
# - balance [integer, default nil]: account balance after transaction was processed. ex: 100000000 (= R$ 1,000,000.00)
|
33
33
|
# - created [DateTime, default nil]: creation datetime for the boleto. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
34
34
|
class Transaction < StarkBank::Utils::Resource
|
@@ -68,7 +68,7 @@ module StarkBank
|
|
68
68
|
# Receive a single Transaction object previously created in the Stark Bank API by passing its id
|
69
69
|
#
|
70
70
|
# ## Parameters (required):
|
71
|
-
# - id [string]: object unique id. ex:
|
71
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
72
72
|
#
|
73
73
|
# ## Parameters (optional):
|
74
74
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
data/lib/transfer/log.rb
CHANGED
@@ -14,11 +14,11 @@ module StarkBank
|
|
14
14
|
# user.
|
15
15
|
#
|
16
16
|
# ## Attributes:
|
17
|
-
# - id [string]: unique id returned when the log is created. ex:
|
17
|
+
# - id [string]: unique id returned when the log is created. ex: '5656565656565656'
|
18
18
|
# - transfer [Transfer]: Transfer entity to which the log refers to.
|
19
19
|
# - errors [list of strings]: list of errors linked to this BoletoPayment event.
|
20
|
-
# - type [string]: type of the Transfer event which triggered the log creation. ex:
|
21
|
-
# - created [DateTime]: creation datetime for the
|
20
|
+
# - type [string]: type of the Transfer event which triggered the log creation. ex: 'processing' or 'success'
|
21
|
+
# - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
22
22
|
class Log < StarkBank::Utils::Resource
|
23
23
|
attr_reader :id, :created, :type, :errors, :transfer
|
24
24
|
def initialize(id:, created:, type:, errors:, transfer:)
|
@@ -34,7 +34,7 @@ module StarkBank
|
|
34
34
|
# Receive a single Log object previously created by the Stark Bank API by passing its id
|
35
35
|
#
|
36
36
|
# ## Parameters (required):
|
37
|
-
# - id [string]: object unique id. ex:
|
37
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
38
38
|
#
|
39
39
|
# ## Parameters (optional):
|
40
40
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
data/lib/transfer/transfer.rb
CHANGED
@@ -15,7 +15,7 @@ module StarkBank
|
|
15
15
|
# - amount [integer]: amount in cents to be transferred. ex: 1234 (= R$ 12.34)
|
16
16
|
# - name [string]: receiver full name. ex: 'Anthony Edward Stark'
|
17
17
|
# - tax_id [string]: receiver tax ID (CPF or CNPJ) with or without formatting. ex: '01234567890' or '20.018.183/0001-80'
|
18
|
-
# - bank_code [string]:
|
18
|
+
# - bank_code [string]: 1 to 3 digits of the receiver bank institution in Brazil. ex: '200' or '341'
|
19
19
|
# - branch_code [string]: receiver bank account branch. Use '-' in case there is a verifier digit. ex: '1357-9'
|
20
20
|
# - account_number [string]: Receiver Bank Account number. Use '-' before the verifier digit. ex: '876543-2'
|
21
21
|
#
|
@@ -25,7 +25,7 @@ module StarkBank
|
|
25
25
|
# ## Attributes (return-only):
|
26
26
|
# - id [string, default nil]: unique id returned when Transfer is created. ex: '5656565656565656'
|
27
27
|
# - fee [integer, default nil]: fee charged when transfer is created. ex: 200 (= R$ 2.00)
|
28
|
-
# - status [string, default nil]: current
|
28
|
+
# - status [string, default nil]: current transfer status. ex: 'success' or 'failed'
|
29
29
|
# - transaction_ids [list of strings, default nil]: ledger transaction ids linked to this transfer (if there are two, second is the chargeback). ex: ['19827356981273']
|
30
30
|
# - created [DateTime, default nil]: creation datetime for the transfer. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
31
31
|
# - updated [DateTime, default nil]: latest update datetime for the transfer. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
@@ -68,7 +68,7 @@ module StarkBank
|
|
68
68
|
# Receive a single Transfer object previously created in the Stark Bank API by passing its id
|
69
69
|
#
|
70
70
|
# ## Parameters (required):
|
71
|
-
# - id [string]: object unique id. ex:
|
71
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
72
72
|
#
|
73
73
|
# ## Parameters (optional):
|
74
74
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -82,10 +82,10 @@ module StarkBank
|
|
82
82
|
# # Retrieve a specific Transfer pdf file
|
83
83
|
#
|
84
84
|
# Receive a single Transfer pdf receipt file generated in the Stark Bank API by passing its id.
|
85
|
-
# Only valid for transfers with
|
85
|
+
# Only valid for transfers with 'processing' and 'success' status.
|
86
86
|
#
|
87
87
|
# ## Parameters (required):
|
88
|
-
# - id [string]: object unique id. ex:
|
88
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
89
89
|
#
|
90
90
|
# ## Parameters (optional):
|
91
91
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -105,7 +105,7 @@ module StarkBank
|
|
105
105
|
# - after [Date, DateTime, Time or string, default nil] date filter for objects created or updated only after specified date. ex: Date.new(2020, 3, 10)
|
106
106
|
# - before [Date, DateTime, Time or string, default nil] date filter for objects created or updated only before specified date. ex: Date.new(2020, 3, 10)
|
107
107
|
# - transactionIds [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
|
108
|
-
# - status [string, default nil]: filter for status of retrieved objects. ex: '
|
108
|
+
# - status [string, default nil]: filter for status of retrieved objects. ex: 'success' or 'failed'
|
109
109
|
# - tags [list of strings, default nil]: tags to filter retrieved objects. ex: ['tony', 'stark']
|
110
110
|
# - user [Project object, default nil]: Project object. Not necessary if StarkBank.user was set before function call
|
111
111
|
#
|
data/lib/utility_payment/log.rb
CHANGED
@@ -14,11 +14,11 @@ module StarkBank
|
|
14
14
|
# be retrieved to check additional information on the UtilityPayment.
|
15
15
|
#
|
16
16
|
# ## Attributes:
|
17
|
-
# - id [string]: unique id returned when the log is created. ex:
|
17
|
+
# - id [string]: unique id returned when the log is created. ex: '5656565656565656'
|
18
18
|
# - payment [UtilityPayment]: UtilityPayment entity to which the log refers to.
|
19
|
-
# - errors [list of strings]: list of errors linked to this
|
20
|
-
# - type [string]: type of the UtilityPayment event which triggered the log creation. ex:
|
21
|
-
# - created [DateTime]: creation datetime for the
|
19
|
+
# - errors [list of strings]: list of errors linked to this UtilityPayment event.
|
20
|
+
# - type [string]: type of the UtilityPayment event which triggered the log creation. ex: 'processing' or 'success'
|
21
|
+
# - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
22
22
|
class Log < StarkBank::Utils::Resource
|
23
23
|
attr_reader :id, :created, :type, :errors, :payment
|
24
24
|
def initialize(id:, created:, type:, errors:, payment:)
|
@@ -34,7 +34,7 @@ module StarkBank
|
|
34
34
|
# Receive a single Log object previously created by the Stark Bank API by passing its id
|
35
35
|
#
|
36
36
|
# ## Parameters (required):
|
37
|
-
# - id [string]: object unique id. ex:
|
37
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
38
38
|
#
|
39
39
|
# ## Parameters (optional):
|
40
40
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -12,19 +12,19 @@ module StarkBank
|
|
12
12
|
# to the Stark Bank API and returns the list of created objects.
|
13
13
|
#
|
14
14
|
# ## Parameters (conditionally required):
|
15
|
-
# - line [string, default nil]: Number sequence that describes the payment. Either 'line' or 'bar_code' parameters are required. If both are sent, they must match. ex:
|
16
|
-
# - bar_code [string, default nil]: Bar code number that describes the payment. Either 'line' or 'barCode' parameters are required. If both are sent, they must match. ex:
|
15
|
+
# - line [string, default nil]: Number sequence that describes the payment. Either 'line' or 'bar_code' parameters are required. If both are sent, they must match. ex: '34191.09008 63571.277308 71444.640008 5 81960000000062'
|
16
|
+
# - bar_code [string, default nil]: Bar code number that describes the payment. Either 'line' or 'barCode' parameters are required. If both are sent, they must match. ex: '34195819600000000621090063571277307144464000'
|
17
17
|
#
|
18
18
|
# ## Parameters (required):
|
19
|
-
# - description [string]: Text to be displayed in your statement (min. 10 characters). ex:
|
19
|
+
# - description [string]: Text to be displayed in your statement (min. 10 characters). ex: 'payment ABC'
|
20
20
|
#
|
21
21
|
# ## Parameters (optional):
|
22
22
|
# - scheduled [Date, DateTime, Time or string, default today]: payment scheduled date. ex: Date.new(2020, 3, 10)
|
23
23
|
# - tags [list of strings]: list of strings for tagging
|
24
24
|
#
|
25
25
|
# ## Attributes (return-only):
|
26
|
-
# - id [string, default nil]: unique id returned when payment is created. ex:
|
27
|
-
# - status [string, default nil]: current payment status. ex:
|
26
|
+
# - id [string, default nil]: unique id returned when payment is created. ex: '5656565656565656'
|
27
|
+
# - status [string, default nil]: current payment status. ex: 'success' or 'failed'
|
28
28
|
# - amount [int, default nil]: amount automatically calculated from line or bar_code. ex: 23456 (= R$ 234.56)
|
29
29
|
# - fee [integer, default nil]: fee charged when utility payment is created. ex: 200 (= R$ 2.00)
|
30
30
|
# - created [DateTime, default nil]: creation datetime for the payment. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
@@ -64,7 +64,7 @@ module StarkBank
|
|
64
64
|
# Receive a single UtilityPayment object previously created by the Stark Bank API by passing its id
|
65
65
|
#
|
66
66
|
# ## Parameters (required):
|
67
|
-
# - id [string]: object unique id. ex:
|
67
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
68
68
|
#
|
69
69
|
# ## Parameters (optional):
|
70
70
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -78,10 +78,10 @@ module StarkBank
|
|
78
78
|
# # Retrieve a specific UtilityPayment pdf file
|
79
79
|
#
|
80
80
|
# Receive a single UtilityPayment pdf file generated in the Stark Bank API by passing its id.
|
81
|
-
# Only valid for utility payments with
|
81
|
+
# Only valid for utility payments with 'success' status.
|
82
82
|
#
|
83
83
|
# ## Parameters (required):
|
84
|
-
# - id [string]: object unique id. ex:
|
84
|
+
# - id [string]: object unique id. ex: '5656565656565656'
|
85
85
|
#
|
86
86
|
# ## Parameters (optional):
|
87
87
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
@@ -127,7 +127,7 @@ module StarkBank
|
|
127
127
|
# Delete a UtilityPayment entity previously created in the Stark Bank API
|
128
128
|
#
|
129
129
|
# ## Parameters (required):
|
130
|
-
# - id [string]: UtilityPayment unique id. ex:
|
130
|
+
# - id [string]: UtilityPayment unique id. ex:'5656565656565656'
|
131
131
|
#
|
132
132
|
# ## Parameters (optional):
|
133
133
|
# - user [Project object]: Project object. Not necessary if StarkBank.user was set before function call
|
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.
|
63
|
+
req['User-Agent'] = "Ruby-#{RUBY_VERSION}-SDK-0.2.1"
|
64
64
|
|
65
65
|
request = Net::HTTP.start(uri.hostname, use_ssl: true) { |http| http.request(req) }
|
66
66
|
|
data/lib/webhook/webhook.rb
CHANGED
@@ -16,7 +16,7 @@ module StarkBank
|
|
16
16
|
# - subscriptions [list of strings]: list of any non-empty combination of the available services. ex: ['transfer', 'boleto-payment']
|
17
17
|
#
|
18
18
|
# ## Attributes:
|
19
|
-
# - id [string, default nil]: unique id returned when the
|
19
|
+
# - id [string, default nil]: unique id returned when the webhook is created. ex: '5656565656565656'
|
20
20
|
class Webhook < StarkBank::Utils::Resource
|
21
21
|
attr_reader :url, :subscriptions, :id
|
22
22
|
def initialize(url:, subscriptions:, id: nil)
|