starkbank 2.3.0 → 2.4.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/transfer/transfer.rb +11 -5
- 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: 865e407d8c6cc8b02de3bbe91e5303ae996234867282f163a14f495fcdb5408c
|
4
|
+
data.tar.gz: 96d199d34eabfd9694a55b1b435d84aa008a71dd697141b106b2373b11625070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db7c4ff0fb3fc908b2d68c16f984b685a9181e0fc7d43bb2ae5e6085c10778ff91e4fee4575b37ca03379ca976a131039d5a4fdb626757f9b53427336740b621
|
7
|
+
data.tar.gz: e3b1397b1b8b494f22469d6c8a3b74cd8165498096958d748bbbfeca4d7511efa6c599854b06a6be6d48af7aac1afb2184924d845894a72a08ed0084b4b8b85f
|
data/lib/transfer/transfer.rb
CHANGED
@@ -17,11 +17,13 @@ module StarkBank
|
|
17
17
|
# - tax_id [string]: receiver tax ID (CPF or CNPJ) with or without formatting. ex: '01234567890' or '20.018.183/0001-80'
|
18
18
|
# - bank_code [string]: code of the receiver bank institution in Brazil. If an ISPB (8 digits) is informed, a PIX transfer will be created, else a TED will be issued. ex: '20018183' or '260'
|
19
19
|
# - branch_code [string]: receiver bank account branch. Use '-' in case there is a verifier digit. ex: '1357-9'
|
20
|
-
# - account_number [string]:
|
20
|
+
# - account_number [string]: receiver bank account number. Use '-' before the verifier digit. ex: '876543-2'
|
21
21
|
#
|
22
22
|
# ## Parameters (optional):
|
23
|
-
# -
|
23
|
+
# - account_type [string, default 'checking']: receiver bank account type. This parameter only has effect on Pix Transfers. ex: 'checking', 'savings' or 'salary'
|
24
|
+
# - external_id [string, default nil]: url safe string that must be unique among all your transfers. Duplicated external_ids will cause failures. By default, this parameter will block any transfer that repeats amount and receiver information on the same date. ex: 'my-internal-id-123456'
|
24
25
|
# - scheduled [string, default now]: datetime when the transfer will be processed. May be pushed to next business day if necessary. ex: DateTime.new(2020, 3, 11, 8, 13, 12, 11)
|
26
|
+
# - tags [list of strings]: list of strings for reference when searching for transfers. ex: ['employees', 'monthly']
|
25
27
|
#
|
26
28
|
# ## Attributes (return-only):
|
27
29
|
# - id [string, default nil]: unique id returned when Transfer is created. ex: '5656565656565656'
|
@@ -31,8 +33,8 @@ module StarkBank
|
|
31
33
|
# - created [DateTime, default nil]: creation datetime for the transfer. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
32
34
|
# - updated [DateTime, default nil]: latest update datetime for the transfer. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
|
33
35
|
class Transfer < StarkBank::Utils::Resource
|
34
|
-
attr_reader :amount, :name, :tax_id, :bank_code, :branch_code, :account_number, :scheduled, :transaction_ids, :fee, :tags, :status, :id, :created, :updated
|
35
|
-
def initialize(amount:, name:, tax_id:, bank_code:, branch_code:, account_number:, scheduled: nil, transaction_ids: nil, fee: nil, tags: nil, status: nil, id: nil, created: nil, updated: nil)
|
36
|
+
attr_reader :amount, :name, :tax_id, :bank_code, :branch_code, :account_number, :account_type, :external_id, :scheduled, :transaction_ids, :fee, :tags, :status, :id, :created, :updated
|
37
|
+
def initialize(amount:, name:, tax_id:, bank_code:, branch_code:, account_number:, account_type: nil, external_id: nil, scheduled: nil, transaction_ids: nil, fee: nil, tags: nil, status: nil, id: nil, created: nil, updated: nil)
|
36
38
|
super(id)
|
37
39
|
@amount = amount
|
38
40
|
@name = name
|
@@ -40,6 +42,8 @@ module StarkBank
|
|
40
42
|
@bank_code = bank_code
|
41
43
|
@branch_code = branch_code
|
42
44
|
@account_number = account_number
|
45
|
+
@account_type = account_type
|
46
|
+
@external_id = external_id
|
43
47
|
@scheduled = StarkBank::Utils::Checks.check_date_or_datetime(scheduled)
|
44
48
|
@transaction_ids = transaction_ids
|
45
49
|
@fee = fee
|
@@ -124,7 +128,7 @@ module StarkBank
|
|
124
128
|
# - 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)
|
125
129
|
# - transactionIds [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
|
126
130
|
# - status [string, default nil]: filter for status of retrieved objects. ex: 'success' or 'failed'
|
127
|
-
# - tax_id [string, default nil]: filter for transfers sent to the specified tax ID. ex:
|
131
|
+
# - tax_id [string, default nil]: filter for transfers sent to the specified tax ID. ex: '012.345.678-90'
|
128
132
|
# - tags [list of strings, default nil]: tags to filter retrieved objects. ex: ['tony', 'stark']
|
129
133
|
# - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
|
130
134
|
# - user [Organization/Project object]: Organization or Project object. Not necessary if Starkbank.user was set before function call
|
@@ -161,6 +165,8 @@ module StarkBank
|
|
161
165
|
bank_code: json['bank_code'],
|
162
166
|
branch_code: json['branch_code'],
|
163
167
|
account_number: json['account_number'],
|
168
|
+
account_type: json['account_type'],
|
169
|
+
external_id: json['external_id'],
|
164
170
|
scheduled: json['scheduled'],
|
165
171
|
transaction_ids: json['transaction_ids'],
|
166
172
|
fee: json['fee'],
|
data/lib/utils/request.rb
CHANGED
@@ -61,7 +61,7 @@ module StarkBank
|
|
61
61
|
req['Access-Time'] = access_time
|
62
62
|
req['Access-Signature'] = signature
|
63
63
|
req['Content-Type'] = 'application/json'
|
64
|
-
req['User-Agent'] = "Ruby-#{RUBY_VERSION}-SDK-2.
|
64
|
+
req['User-Agent'] = "Ruby-#{RUBY_VERSION}-SDK-2.4.0"
|
65
65
|
req['Accept-Language'] = language
|
66
66
|
|
67
67
|
request = Net::HTTP.start(uri.hostname, use_ssl: true) { |http| http.request(req) }
|