starkinfra 0.0.3 → 0.1.0

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
  SHA256:
3
- metadata.gz: 0d456d927d988604b83c18adacb7d92fe77f299ba95e89c15ed5ae0e7a5cc4fc
4
- data.tar.gz: 8ec44ecac1652b99596506d7a6234dde1ebfe94eb1299b70e27ae39809dde463
3
+ metadata.gz: d851779a2ac175de1c7c25ec156ff8c9c011bd438dc863e5e99dc031be4540c3
4
+ data.tar.gz: 6b0bce15d67fe07e569facaa3023152d865a0886cae0de131bf45ac0bd42916f
5
5
  SHA512:
6
- metadata.gz: 79ac2d80db5a48923b6d0c34fbecd148a9b1e9ea82f5d4d6dc46bec8011dc8959fcdffbb3a40d4661a64a6d0516a24a13b2cfa94e5d70bbe7aec38c8511f1024
7
- data.tar.gz: '03180e37ba1c743016d8356a6851f7659e994b302ba55144747d9d9be216eaefad569779128f6f90f8a6ed7c5aece229d353e7ccfa683faa9c3aad8e8dd7d82c'
6
+ metadata.gz: e667c072faca5588ce99f991bd7f983849667281b0e11314444ed607b66cca7fd372c3a0a90ef33e2d0dbc8321e2ddc22941c6180710691472bc8eaa54cf33fe
7
+ data.tar.gz: 7060cff52d7a3634b96e515b18988227b8f1b88696fdccccca1263c48a09a8f73812956c1eecd0e2b1c423d13df9f1135e4f6577f04c189c62620ed3efc29057
@@ -23,6 +23,12 @@ module StarkInfra
23
23
  # - payment [CreditNote::Transfer object]: payment entity to be created and sent to the credit receiver. ex: payment=CreditNote::Transfer.new()
24
24
  # - signers [list of CreditNote::Signer objects]: signer's name, contact and delivery method for the signature request. ex: signers=[CreditNote::Signer.new(), CreditNote::Signer.new()]
25
25
  # - external_id [string]: a string that must be unique among all your CreditNotes, used to avoid resource duplication. ex: 'my-internal-id-123456'
26
+ # - street_line_1 [string]: credit receiver main address. ex: 'Av. Paulista, 200'
27
+ # - street_line_2 [string]: credit receiver address complement. ex: 'Apto. 123'
28
+ # - district [string]: credit receiver address district / neighbourhood. ex: 'Bela Vista'
29
+ # - city [string]: credit receiver address city. ex: 'Rio de Janeiro'
30
+ # - state_code [string]: credit receiver address state. ex: 'GO'
31
+ # - zip_code [string]: credit receiver address zip code. ex: '01311-200'
26
32
  #
27
33
  # ## Parameters (conditionally required):
28
34
  # - payment_type [string]: payment type, inferred from the payment parameter if it is not a hash. ex: 'transfer'
@@ -44,12 +50,16 @@ module StarkInfra
44
50
  # - created [DateTime]: creation datetime for the CreditNote. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
45
51
  # - updated [DateTime]: latest update datetime for the CreditNote. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
46
52
  class CreditNote < StarkInfra::Utils::Resource
47
- attr_reader :template_id, :name, :tax_id, :nominal_amount, :scheduled, :invoices, :payment, :signers, :external_id, :payment_type, :rebate_amount, :tags, :id, :amount, :expiration, :document_id, :status, :transaction_ids, :workspace_id, :tax_amount, :interest, :created, :updated
53
+ attr_reader :template_id, :name, :tax_id, :nominal_amount, :scheduled, :invoices, :payment, :signers, :external_id,
54
+ :street_line_1, :street_line_2, :district, :city, :state_code, :zip_code, :payment_type, :rebate_amount,
55
+ :tags, :id, :amount, :expiration, :document_id, :status, :transaction_ids, :workspace_id, :tax_amount,
56
+ :interest, :created, :updated
48
57
  def initialize(
49
58
  template_id:, name:, tax_id:, nominal_amount:, scheduled:, invoices:, payment:,
50
- signers:, external_id:, payment_type: nil, rebate_amount: nil, tags: nil, id: nil, amount: nil,
51
- expiration: nil, document_id: nil, status: nil, transaction_ids: nil, workspace_id: nil,
52
- tax_amount: nil, interest: nil, created: nil, updated: nil
59
+ signers:, external_id:, street_line_1:, street_line_2:, district:, city:, state_code:, zip_code:,
60
+ payment_type: nil, rebate_amount: nil, tags: nil, id: nil, amount: nil, expiration: nil,
61
+ document_id: nil, status: nil, transaction_ids: nil, workspace_id: nil, tax_amount: nil, interest: nil,
62
+ created: nil, updated: nil
53
63
  )
54
64
  super(id)
55
65
  @template_id = template_id
@@ -60,6 +70,12 @@ module StarkInfra
60
70
  @invoices = CreditNote::Invoice.parse_invoices(invoices)
61
71
  @signers = CreditNote::Signer.parse_signers(signers)
62
72
  @external_id = external_id
73
+ @street_line_1 = street_line_1
74
+ @street_line_2 = street_line_2
75
+ @district = district
76
+ @city = city
77
+ @state_code = state_code
78
+ @zip_code = zip_code
63
79
  @rebate_amount = rebate_amount
64
80
  @tags = tags
65
81
  @amount = amount
@@ -224,6 +240,12 @@ module StarkInfra
224
240
  payment: json['payment'],
225
241
  signers: json['signers'],
226
242
  external_id: json['external_id'],
243
+ street_line_1: json['street_line_1'],
244
+ street_line_2: json['street_line_2'],
245
+ district: json['district'],
246
+ city: json['city'],
247
+ state_code: json['state_code'],
248
+ zip_code: json['zip_code'],
227
249
  payment_type: json['payment_type'],
228
250
  rebate_amount: json['rebate_amount'],
229
251
  tags: json['tags'],
@@ -7,7 +7,7 @@ require_relative('../utils/checks')
7
7
  module StarkInfra
8
8
  # # IssuingBin object
9
9
  #
10
- # The IssuingBin object displays information of registered BINs to your Workspace.
10
+ # The IssuingBin object displays information of BINs registered to your Workspace.
11
11
  # They represent a group of cards that begin with the same numbers (BIN) and offer the same product to end customers.
12
12
  #
13
13
  # ## Attributes (return-only):
@@ -54,7 +54,7 @@ module StarkInfra
54
54
  #
55
55
  # ## Parameters (optional):
56
56
  # - cursor [string, default nil]: cursor returned on the previous page function call.
57
- # - limit [integer, default nil]: maximum number of objects to be retrieved. Max = 100. ex: 35
57
+ # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
58
58
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
59
59
  #
60
60
  # ## Return:
@@ -17,15 +17,15 @@ module StarkInfra
17
17
  #
18
18
  # ## Parameters (optional):
19
19
  # - display_name [string, default nil]: card displayed name. ex: 'ANTHONY STARK'
20
- # - rules [list of IssuingRule objects, default nil]: [EXPANDABLE] list of card spending rules.
20
+ # - rules [list of IssuingRule objects, default []]: [EXPANDABLE] list of card spending rules.
21
21
  # - bin_id [string, default nil]: BIN ID to which the card is bound. ex: '53810200'
22
- # - tags [list of strings, default nil]: list of strings for tagging. ex: ['travel', 'food']
23
- # - street_line_1 [string, default nil]: card holder main address. ex: 'Av. Paulista, 200'
24
- # - street_line_2 [string, default nil]: card holder address complement. ex: 'Apto. 123'
25
- # - district [string, default nil]: card holder address district / neighbourhood. ex: 'Bela Vista'
26
- # - city [string, default nil]: card holder address city. ex: 'Rio de Janeiro'
27
- # - state_code [string, default nil]: card holder address state. ex: 'GO'
28
- # - zip_code [string, default nil]: card holder address zip code. ex: '01311-200'
22
+ # - tags [list of strings, default []]: list of strings for tagging. ex: ['travel', 'food']
23
+ # - street_line_1 [string, default sub-issuer street line 1]: card holder main address. ex: 'Av. Paulista, 200'
24
+ # - street_line_2 [string, default sub-issuer street line 2]: card holder address complement. ex: 'Apto. 123'
25
+ # - district [string, default sub-issuer district]: card holder address district / neighbourhood. ex: 'Bela Vista'
26
+ # - city [string, default sub-issuer city]: card holder address city. ex: 'Rio de Janeiro'
27
+ # - state_code [string, default sub-issuer state code]: card holder address state. ex: 'GO'
28
+ # - zip_code [string, default sub-issuer zip code]: card holder address zip code. ex: '01311-200'
29
29
  #
30
30
  # ## Attributes (return-only):
31
31
  # - id [string]: unique id returned when IssuingCard is created. ex: '5656565656565656'
@@ -34,7 +34,7 @@ module StarkInfra
34
34
  # - status [string]: current IssuingCard status. ex: 'active', 'blocked', 'canceled', 'expired'.
35
35
  # - number [string]: [EXPANDABLE] masked card number. Expand to unmask the value. ex: '123'.
36
36
  # - security_code [string]: [EXPANDABLE] masked card verification value (cvv). Expand to unmask the value. ex: '123'.
37
- # - expiration [string]: [EXPANDABLE] masked card expiration datetime. Expand to unmask the value. ex: '2032-02-29T23:59:59.999999+00:00'.
37
+ # - expiration [DateTime]: [EXPANDABLE] masked card expiration datetime. Expand to unmask the value. ex: DateTime.new(2032, 3, 10, 10, 30, 0, 0)
38
38
  # - created [DateTime]: creation datetime for the IssuingCard. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
39
39
  # - updated [DateTime]: latest update datetime for the IssuingCard. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
40
40
  class IssuingCard < StarkInfra::Utils::Resource
@@ -66,7 +66,8 @@ module StarkInfra
66
66
  @tags = tags
67
67
  @number = number
68
68
  @security_code = security_code
69
- @expiration = expiration
69
+ expiration = nil if !expiration.nil? && expiration.include?('*')
70
+ @expiration = StarkInfra::Utils::Checks.check_datetime(expiration)
70
71
  @created = StarkInfra::Utils::Checks.check_datetime(created)
71
72
  @updated = StarkInfra::Utils::Checks.check_datetime(updated)
72
73
  end
@@ -147,7 +148,7 @@ module StarkInfra
147
148
  #
148
149
  # ## Parameters (optional):
149
150
  # - cursor [string, default nil]: cursor returned on the previous page function call.
150
- # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
151
+ # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
151
152
  # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
152
153
  # - after [DateTime or string, default nil] date filter for objects created only after specified date. ex: DateTime.new(2020, 3, 10)
153
154
  # - before [DateTime or string, default nil] date filter for objects created only before specified date. ex: DateTime.new(2020, 3, 10)
@@ -79,7 +79,7 @@ module StarkInfra
79
79
  # ## Parameters (optional):
80
80
  # - cursor [string, default nil]: cursor returned on the previous page function call
81
81
  # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
82
- # - limit [integer, default nil]: maximum number of objects to be retrieved. Max = 100. ex: 35
82
+ # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
83
83
  # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
84
84
  # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
85
85
  # - types [list of strings, default nil]: filter for log event types. ex: ['blocked', 'canceled', 'created', 'expired', 'unblocked', 'updated']
@@ -110,7 +110,7 @@ module StarkInfra
110
110
  #
111
111
  # ## Parameters (optional):
112
112
  # - cursor [string, default nil]: cursor returned on the previous page function call.
113
- # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
113
+ # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
114
114
  # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
115
115
  # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
116
116
  # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
@@ -78,7 +78,7 @@ module StarkInfra
78
78
  #
79
79
  # ## Parameters (optional):
80
80
  # - cursor [string, default nil]: cursor returned on the previous page function call
81
- # - limit [integer, default nil]: maximum number of objects to be retrieved. Max = 100. ex: 35
81
+ # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
82
82
  # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
83
83
  # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
84
84
  # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
@@ -105,7 +105,7 @@ module StarkInfra
105
105
  #
106
106
  # ## Parameters (optional):
107
107
  # - cursor [string, default nil]: cursor returned on the previous page function call.
108
- # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
108
+ # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
109
109
  # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
110
110
  # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
111
111
  # - status [list of strings, default nil]: filter for status of retrieved objects. ex: ['created', 'expired', 'overdue', 'paid']
@@ -78,7 +78,7 @@ module StarkInfra
78
78
  # ## Parameters (optional):
79
79
  # - cursor [string, default nil]: cursor returned on the previous page function call
80
80
  # - ids [list of strings, default nil]: list of IssuingInvoice ids to filter logs. ex: ['5656565656565656', '4545454545454545']
81
- # - limit [integer, default nil]: maximum number of objects to be retrieved. Max = 100. ex: 35
81
+ # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
82
82
  # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
83
83
  # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
84
84
  # - types [list of strings, default nil]: filter for log event types. ex: ['created', 'credited', 'expired', 'overdue', 'paid']
@@ -138,7 +138,7 @@ module StarkInfra
138
138
  # ## Parameters (optional):
139
139
  # - cursor [string, default nil]: cursor returned on the previous page function call.
140
140
  # - ids [list of strings, default nil]: purchase IDs. ex: ['5656565656565656', '4545454545454545']
141
- # - limit [integer, default nil]: maximum number of objects to be retrieved. Max = 100. ex: 35
141
+ # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
142
142
  # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
143
143
  # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
144
144
  # - end_to_end_ids [list of strings, default []]: central bank's unique transaction ID. ex: 'E79457883202101262140HHX553UPqeq'
@@ -84,7 +84,7 @@ module StarkInfra
84
84
  # ## Parameters (optional):
85
85
  # - cursor [string, default nil]: cursor returned on the previous page function call
86
86
  # - ids [list of strings, default nil]: list of IssuingPurchase ids to filter logs. ex: ['5656565656565656', '4545454545454545']
87
- # - limit [integer, default nil]: maximum number of objects to be retrieved. Max = 100. ex: 35
87
+ # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
88
88
  # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
89
89
  # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
90
90
  # - types [list of strings, default nil]: filter for log event types. ex: ['approved', 'canceled', 'confirmed', 'denied', 'reversed', 'voided']
@@ -12,8 +12,9 @@ module StarkInfra
12
12
  # ## Parameters (required):
13
13
  # - name [string]: rule name. ex: 'Travel' or 'Food'
14
14
  # - amount [integer]: maximum amount that can be spent in the informed interval. ex: 200000 (= R$ 2000.00)
15
- # - interval [string]: interval after which the rule amount counter will be reset to 0. ex: 'instant', 'day', 'week', 'month', 'year' or 'lifetime'
16
15
  # ## Parameters (optional):
16
+ # - id [string, default nil]: unique id returned when Rule is created. ex: '5656565656565656'
17
+ # - interval [string, default 'lifetime']: interval after which the rule amount counter will be reset to 0. ex: 'instant', 'day', 'week', 'month', 'year' or 'lifetime'
17
18
  # - currency_code [string, default 'BRL']: code of the currency that the rule amount refers to. ex: 'BRL' or 'USD'
18
19
  # - categories [list of strings, default []]: merchant categories accepted by the rule. ex: ['eatingPlacesRestaurants', 'travelAgenciesTourOperators']
19
20
  # - countries [list of strings, default []]: countries accepted by the rule. ex: ['BRA', 'USA']
@@ -22,11 +23,9 @@ module StarkInfra
22
23
  # - counter_amount [integer]: current rule spent amount. ex: 1000
23
24
  # - currency_symbol [string]: currency symbol. ex: 'R$'
24
25
  # - currency_name [string]: currency name. ex: 'Brazilian Real'
25
- # ## Attributes (return-only):
26
- # - id [string]: unique id returned when Rule is created. ex: '5656565656565656'
27
26
  class IssuingRule < StarkInfra::Utils::Resource
28
27
  attr_reader :name, :interval, :amount, :currency_code, :counter_amount, :currency_name, :currency_symbol, :categories, :countries, :methods
29
- def initialize(name:, interval:, amount:, currency_code: nil, counter_amount: nil, currency_name: nil,
28
+ def initialize(name:, amount:, id: nil, interval: nil, currency_code: nil, counter_amount: nil, currency_name: nil,
30
29
  currency_symbol: nil, categories: nil, countries: nil, methods: nil
31
30
  )
32
31
  super(id)
@@ -43,16 +42,15 @@ module StarkInfra
43
42
  end
44
43
 
45
44
  def self.parse_rules(rules)
46
- parsed_rules = []
47
45
  rule_maker = StarkInfra::IssuingRule.resource[:resource_maker]
48
46
  return rules if rules.nil?
49
47
 
48
+ parsed_rules = []
50
49
  rules.each do |rule|
51
- if rule.is_a? IssuingRule
52
- parsed_rules.append(rule)
53
- next
50
+ unless rule.is_a? IssuingRule
51
+ rule = StarkInfra::Utils::API.from_api_json(rule_maker, rule)
54
52
  end
55
- parsed_rules.append(StarkInfra::Utils::API.from_api_json(rule_maker, rule))
53
+ parsed_rules << rule
56
54
  end
57
55
  parsed_rules
58
56
  end
@@ -62,16 +60,16 @@ module StarkInfra
62
60
  resource_name: 'IssuingRule',
63
61
  resource_maker: proc { |json|
64
62
  IssuingRule.new(
65
- name: json[:name],
66
- interval: json[:interval],
67
- amount: json[:amount],
68
- currency_code: json[:currency_code],
69
- counter_amount: json[:counter_amount],
70
- currency_name: json[:currency_name],
71
- currency_symbol: json[:currency_symbol],
72
- categories: json[:categories],
73
- countries: json[:countries],
74
- methods: json[:methods]
63
+ name: json['name'],
64
+ interval: json['interval'],
65
+ amount: json['amount'],
66
+ currency_code: json['currency_code'],
67
+ counter_amount: json['counter_amount'],
68
+ currency_name: json['currency_name'],
69
+ currency_symbol: json['currency_symbol'],
70
+ categories: json['categories'],
71
+ countries: json['countries'],
72
+ methods: json['methods']
75
73
  )
76
74
  }
77
75
  }
@@ -92,7 +92,7 @@ module StarkInfra
92
92
  # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
93
93
  # - status [string, default nil]: filter for status of retrieved objects. ex: 'approved', 'canceled', 'denied', 'confirmed' or 'voided'
94
94
  # - ids [list of strings, default nil]: purchase IDs
95
- # - limit [integer, default nil]: maximum number of objects to be retrieved. Max = 100. ex: 35
95
+ # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
96
96
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
97
97
  #
98
98
  # ## Return:
@@ -106,7 +106,7 @@ module StarkInfra
106
106
  #
107
107
  # ## Parameters (optional):
108
108
  # - cursor [string, default nil]: cursor returned on the previous page function call.
109
- # - limit [integer, default nil]: maximum number of objects to be retrieved. Max = 100. ex: 35
109
+ # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
110
110
  # - external_ids [list of strings, default []]: external IDs. ex: ['5656565656565656', '4545454545454545']
111
111
  # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
112
112
  # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
@@ -32,7 +32,8 @@ module StarkInfra
32
32
  # - created [DateTime]: creation datetime for the PixClaim. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
33
33
  # - updated [DateTime]: update datetime for the PixClaim. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
34
34
  class PixClaim < StarkInfra::Utils::Resource
35
- attr_reader :account_created, :account_number, :account_type, :branch_code, :name, :tax_id, :key_id, :id, :status, :type, :key_type, :agent, :bank_code, :claimed_bank_code, :created, :updated
35
+ attr_reader :account_created, :account_number, :account_type, :branch_code, :name, :tax_id, :key_id,
36
+ :id, :status, :type, :key_type, :agent, :bank_code, :claimed_bank_code, :created, :updated
36
37
  def initialize(
37
38
  account_created:, account_number:, account_type:, branch_code:, name:,
38
39
  tax_id:, key_id:, id: nil, status: nil, type: nil, key_type: nil, agent: nil,
data/lib/pixkey/pixkey.rb CHANGED
@@ -33,7 +33,8 @@ module StarkInfra
33
33
  # - type [string]: type of the PixKey. Options: 'cpf', 'cnpj', 'phone', 'email' and 'evp',
34
34
  # - created [DateTime]: creation datetime for the PixKey. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
35
35
  class PixKey < StarkInfra::Utils::Resource
36
- attr_reader :account_created, :account_number, :account_type, :branch_code, :name, :tax_id, :id, :tags, :owned, :owner_type, :status, :bank_code, :bank_name, :type, :created
36
+ attr_reader :account_created, :account_number, :account_type, :branch_code, :name, :tax_id, :id,
37
+ :tags, :owned, :owner_type, :status, :bank_code, :bank_name, :type, :created
37
38
  def initialize(
38
39
  account_created:, account_number:, account_type:, branch_code:, name:, tax_id:, id: nil, tags: nil, owned: nil,
39
40
  owner_type: nil, status: nil, bank_code: nil, bank_name: nil, type: nil, created: nil
@@ -30,7 +30,8 @@ module StarkInfra
30
30
  # - created [DateTime]: creation datetime for the PixReversal. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
31
31
  # - updated [DateTime]: latest update datetime for the PixReversal. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
32
32
  class PixReversal < StarkInfra::Utils::Resource;
33
- attr_reader :amount, :external_id, :end_to_end_id, :reason, :tags, :id, :return_id, :bank_code, :fee, :status, :flow, :created, :updated
33
+ attr_reader :amount, :external_id, :end_to_end_id, :reason, :tags, :id, :return_id, :bank_code, :fee,
34
+ :status, :flow, :created, :updated
34
35
  def initialize(
35
36
  amount:, external_id:, end_to_end_id:, reason:, tags: nil, id: nil, return_id: nil, bank_code: nil, fee: nil,
36
37
  status: nil, flow: nil, created: nil, updated: nil
data/lib/utils/request.rb CHANGED
@@ -61,7 +61,7 @@ module StarkInfra
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-Infra-0.0.3"
64
+ req['User-Agent'] = "Ruby-#{RUBY_VERSION}-SDK-Infra-0.1.0"
65
65
  req['Accept-Language'] = language
66
66
 
67
67
  request = Net::HTTP.start(uri.hostname, use_ssl: true) { |http| http.request(req) }
data/lib/utils/rest.rb CHANGED
@@ -61,11 +61,10 @@ module StarkInfra
61
61
  StarkInfra::Utils::API.from_api_json(resource_maker, entity)
62
62
  end
63
63
 
64
- def self.get_content(resource_name:, sub_resource_name:, id:, user: nil, **query)
64
+ def self.get_content(resource_name:, sub_resource_name:, id:, user: nil)
65
65
  StarkInfra::Utils::Request.fetch(
66
66
  method: 'GET',
67
67
  path: "#{StarkInfra::Utils::API.endpoint(resource_name)}/#{id}/#{sub_resource_name}",
68
- query: query,
69
68
  user: user
70
69
  ).content
71
70
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: starkinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - starkinfra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-31 00:00:00.000000000 Z
11
+ date: 2022-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: starkbank-ecdsa