Class: Increase::Client
Constant Summary
collapse
- DEFAULT_MAX_RETRIES =
Default max number of retries to attempt after a failed retryable request.
2
- DEFAULT_TIMEOUT_IN_SECONDS =
Default per-request timeout.
60.0
- DEFAULT_INITIAL_RETRY_DELAY =
Default initial retry delay in seconds. Overall delay is calculated using exponential backoff + jitter.
0.5
- DEFAULT_MAX_RETRY_DELAY =
Default max retry delay in seconds.
8.0
- ENVIRONMENTS =
rubocop:disable Style/MutableConstant
{production: "https://api.increase.com", sandbox: "https://sandbox.increase.com"}
Internal::Transport::BaseClient::MAX_REDIRECTS, Internal::Transport::BaseClient::PLATFORM_HEADERS
Instance Attribute Summary collapse
#base_url, #headers, #idempotency_header, #initial_retry_delay, #max_retries, #max_retry_delay, #requester, #timeout
Instance Method Summary
collapse
follow_redirect, #inspect, reap_connection!, #request, #send_request, should_retry?, validate!
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(api_key: ENV["INCREASE_API_KEY"], environment: nil, base_url: ENV["INCREASE_BASE_URL"], max_retries: self.class::DEFAULT_MAX_RETRIES, timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS, initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY, max_retry_delay: self.class::DEFAULT_MAX_RETRY_DELAY, idempotency_header: "Idempotency-Key") ⇒ Client
Creates and returns a new client for interacting with the API.
Each environment maps to a different base URL:
‘“api.example.com/v2/”`. Defaults to `ENV`
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
|
# File 'lib/increase/client.rb', line 229
def initialize(
api_key: ENV["INCREASE_API_KEY"],
environment: nil,
base_url: ENV["INCREASE_BASE_URL"],
max_retries: self.class::DEFAULT_MAX_RETRIES,
timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS,
initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY,
max_retry_delay: self.class::DEFAULT_MAX_RETRY_DELAY,
idempotency_header: "Idempotency-Key"
)
base_url ||= Increase::Client::ENVIRONMENTS.fetch(environment&.to_sym || :production) do
message = "environment must be one of #{Increase::Client::ENVIRONMENTS.keys}, got #{environment}"
raise ArgumentError.new(message)
end
if api_key.nil?
raise ArgumentError.new("api_key is required, and can be set via environ: \"INCREASE_API_KEY\"")
end
@api_key = api_key.to_s
super(
base_url: base_url,
timeout: timeout,
max_retries: max_retries,
initial_retry_delay: initial_retry_delay,
max_retry_delay: max_retry_delay,
idempotency_header:
)
@accounts = Increase::Resources::Accounts.new(client: self)
@account_numbers = Increase::Resources::AccountNumbers.new(client: self)
@account_transfers = Increase::Resources::AccountTransfers.new(client: self)
@cards = Increase::Resources::Cards.new(client: self)
@card_payments = Increase::Resources::CardPayments.new(client: self)
@card_purchase_supplements = Increase::Resources::CardPurchaseSupplements.new(client: self)
@card_disputes = Increase::Resources::CardDisputes.new(client: self)
@physical_cards = Increase::Resources::PhysicalCards.new(client: self)
@digital_card_profiles = Increase::Resources::DigitalCardProfiles.new(client: self)
@physical_card_profiles = Increase::Resources::PhysicalCardProfiles.new(client: self)
@digital_wallet_tokens = Increase::Resources::DigitalWalletTokens.new(client: self)
@transactions = Increase::Resources::Transactions.new(client: self)
@pending_transactions = Increase::Resources::PendingTransactions.new(client: self)
@declined_transactions = Increase::Resources::DeclinedTransactions.new(client: self)
@ach_transfers = Increase::Resources::ACHTransfers.new(client: self)
@ach_prenotifications = Increase::Resources::ACHPrenotifications.new(client: self)
@inbound_ach_transfers = Increase::Resources::InboundACHTransfers.new(client: self)
@wire_transfers = Increase::Resources::WireTransfers.new(client: self)
@inbound_wire_transfers = Increase::Resources::InboundWireTransfers.new(client: self)
@wire_drawdown_requests = Increase::Resources::WireDrawdownRequests.new(client: self)
@inbound_wire_drawdown_requests = Increase::Resources::InboundWireDrawdownRequests.new(client: self)
@check_transfers = Increase::Resources::CheckTransfers.new(client: self)
@inbound_check_deposits = Increase::Resources::InboundCheckDeposits.new(client: self)
@real_time_payments_transfers = Increase::Resources::RealTimePaymentsTransfers.new(client: self)
@inbound_real_time_payments_transfers =
Increase::Resources::InboundRealTimePaymentsTransfers.new(client: self)
@fednow_transfers = Increase::Resources::FednowTransfers.new(client: self)
@inbound_fednow_transfers = Increase::Resources::InboundFednowTransfers.new(client: self)
@check_deposits = Increase::Resources::CheckDeposits.new(client: self)
@lockboxes = Increase::Resources::Lockboxes.new(client: self)
@inbound_mail_items = Increase::Resources::InboundMailItems.new(client: self)
@routing_numbers = Increase::Resources::RoutingNumbers.new(client: self)
@external_accounts = Increase::Resources::ExternalAccounts.new(client: self)
@entities = Increase::Resources::Entities.new(client: self)
@supplemental_documents = Increase::Resources::SupplementalDocuments.new(client: self)
@programs = Increase::Resources::Programs.new(client: self)
@account_statements = Increase::Resources::AccountStatements.new(client: self)
@files = Increase::Resources::Files.new(client: self)
@file_links = Increase::Resources::FileLinks.new(client: self)
@documents = Increase::Resources::Documents.new(client: self)
@exports = Increase::Resources::Exports.new(client: self)
@events = Increase::Resources::Events.new(client: self)
@event_subscriptions = Increase::Resources::EventSubscriptions.new(client: self)
@real_time_decisions = Increase::Resources::RealTimeDecisions.new(client: self)
@bookkeeping_accounts = Increase::Resources::BookkeepingAccounts.new(client: self)
@bookkeeping_entry_sets = Increase::Resources::BookkeepingEntrySets.new(client: self)
@bookkeeping_entries = Increase::Resources::BookkeepingEntries.new(client: self)
@groups = Increase::Resources::Groups.new(client: self)
@oauth_applications = Increase::Resources::OAuthApplications.new(client: self)
@oauth_connections = Increase::Resources::OAuthConnections.new(client: self)
@oauth_tokens = Increase::Resources::OAuthTokens.new(client: self)
@intrafi_account_enrollments = Increase::Resources::IntrafiAccountEnrollments.new(client: self)
@intrafi_balances = Increase::Resources::IntrafiBalances.new(client: self)
@intrafi_exclusions = Increase::Resources::IntrafiExclusions.new(client: self)
@card_tokens = Increase::Resources::CardTokens.new(client: self)
@card_push_transfers = Increase::Resources::CardPushTransfers.new(client: self)
@card_validations = Increase::Resources::CardValidations.new(client: self)
@simulations = Increase::Resources::Simulations.new(client: self)
end
|
Instance Attribute Details
30
31
32
|
# File 'lib/increase/client.rb', line 30
def account_numbers
@account_numbers
end
|
132
133
134
|
# File 'lib/increase/client.rb', line 132
def account_statements
@account_statements
end
|
33
34
35
|
# File 'lib/increase/client.rb', line 33
def account_transfers
@account_transfers
end
|
27
28
29
|
# File 'lib/increase/client.rb', line 27
def accounts
@accounts
end
|
72
73
74
|
# File 'lib/increase/client.rb', line 72
def ach_prenotifications
@ach_prenotifications
end
|
69
70
71
|
# File 'lib/increase/client.rb', line 69
def ach_transfers
@ach_transfers
end
|
#api_key ⇒ String
24
25
26
|
# File 'lib/increase/client.rb', line 24
def api_key
@api_key
end
|
156
157
158
|
# File 'lib/increase/client.rb', line 156
def bookkeeping_accounts
@bookkeeping_accounts
end
|
162
163
164
|
# File 'lib/increase/client.rb', line 162
def bookkeeping_entries
@bookkeeping_entries
end
|
159
160
161
|
# File 'lib/increase/client.rb', line 159
def bookkeeping_entry_sets
@bookkeeping_entry_sets
end
|
45
46
47
|
# File 'lib/increase/client.rb', line 45
def card_disputes
@card_disputes
end
|
39
40
41
|
# File 'lib/increase/client.rb', line 39
def card_payments
@card_payments
end
|
42
43
44
|
# File 'lib/increase/client.rb', line 42
def card_purchase_supplements
@card_purchase_supplements
end
|
189
190
191
|
# File 'lib/increase/client.rb', line 189
def card_push_transfers
@card_push_transfers
end
|
186
187
188
|
# File 'lib/increase/client.rb', line 186
def card_tokens
@card_tokens
end
|
192
193
194
|
# File 'lib/increase/client.rb', line 192
def card_validations
@card_validations
end
|
36
37
38
|
# File 'lib/increase/client.rb', line 36
def cards
@cards
end
|
108
109
110
|
# File 'lib/increase/client.rb', line 108
def check_deposits
@check_deposits
end
|
90
91
92
|
# File 'lib/increase/client.rb', line 90
def check_transfers
@check_transfers
end
|
66
67
68
|
# File 'lib/increase/client.rb', line 66
def declined_transactions
@declined_transactions
end
|
51
52
53
|
# File 'lib/increase/client.rb', line 51
def digital_card_profiles
@digital_card_profiles
end
|
57
58
59
|
# File 'lib/increase/client.rb', line 57
def digital_wallet_tokens
@digital_wallet_tokens
end
|
141
142
143
|
# File 'lib/increase/client.rb', line 141
def documents
@documents
end
|
123
124
125
|
# File 'lib/increase/client.rb', line 123
def entities
@entities
end
|
150
151
152
|
# File 'lib/increase/client.rb', line 150
def event_subscriptions
@event_subscriptions
end
|
147
148
149
|
# File 'lib/increase/client.rb', line 147
def events
@events
end
|
144
145
146
|
# File 'lib/increase/client.rb', line 144
def exports
@exports
end
|
120
121
122
|
# File 'lib/increase/client.rb', line 120
def external_accounts
@external_accounts
end
|
102
103
104
|
# File 'lib/increase/client.rb', line 102
def fednow_transfers
@fednow_transfers
end
|
138
139
140
|
# File 'lib/increase/client.rb', line 138
def file_links
@file_links
end
|
135
136
137
|
# File 'lib/increase/client.rb', line 135
def files
@files
end
|
165
166
167
|
# File 'lib/increase/client.rb', line 165
def groups
@groups
end
|
75
76
77
|
# File 'lib/increase/client.rb', line 75
def inbound_ach_transfers
@inbound_ach_transfers
end
|
93
94
95
|
# File 'lib/increase/client.rb', line 93
def inbound_check_deposits
@inbound_check_deposits
end
|
105
106
107
|
# File 'lib/increase/client.rb', line 105
def inbound_fednow_transfers
@inbound_fednow_transfers
end
|
114
115
116
|
# File 'lib/increase/client.rb', line 114
def inbound_mail_items
@inbound_mail_items
end
|
99
100
101
|
# File 'lib/increase/client.rb', line 99
def inbound_real_time_payments_transfers
@inbound_real_time_payments_transfers
end
|
87
88
89
|
# File 'lib/increase/client.rb', line 87
def inbound_wire_drawdown_requests
@inbound_wire_drawdown_requests
end
|
81
82
83
|
# File 'lib/increase/client.rb', line 81
def inbound_wire_transfers
@inbound_wire_transfers
end
|
177
178
179
|
# File 'lib/increase/client.rb', line 177
def intrafi_account_enrollments
@intrafi_account_enrollments
end
|
180
181
182
|
# File 'lib/increase/client.rb', line 180
def intrafi_balances
@intrafi_balances
end
|
183
184
185
|
# File 'lib/increase/client.rb', line 183
def intrafi_exclusions
@intrafi_exclusions
end
|
111
112
113
|
# File 'lib/increase/client.rb', line 111
def lockboxes
@lockboxes
end
|
168
169
170
|
# File 'lib/increase/client.rb', line 168
def oauth_applications
@oauth_applications
end
|
171
172
173
|
# File 'lib/increase/client.rb', line 171
def oauth_connections
@oauth_connections
end
|
174
175
176
|
# File 'lib/increase/client.rb', line 174
def oauth_tokens
@oauth_tokens
end
|
63
64
65
|
# File 'lib/increase/client.rb', line 63
def pending_transactions
@pending_transactions
end
|
54
55
56
|
# File 'lib/increase/client.rb', line 54
def physical_card_profiles
@physical_card_profiles
end
|
48
49
50
|
# File 'lib/increase/client.rb', line 48
def physical_cards
@physical_cards
end
|
129
130
131
|
# File 'lib/increase/client.rb', line 129
def programs
@programs
end
|
153
154
155
|
# File 'lib/increase/client.rb', line 153
def real_time_decisions
@real_time_decisions
end
|
96
97
98
|
# File 'lib/increase/client.rb', line 96
def real_time_payments_transfers
@real_time_payments_transfers
end
|
117
118
119
|
# File 'lib/increase/client.rb', line 117
def routing_numbers
@routing_numbers
end
|
195
196
197
|
# File 'lib/increase/client.rb', line 195
def simulations
@simulations
end
|
126
127
128
|
# File 'lib/increase/client.rb', line 126
def supplemental_documents
@supplemental_documents
end
|
60
61
62
|
# File 'lib/increase/client.rb', line 60
def transactions
@transactions
end
|
84
85
86
|
# File 'lib/increase/client.rb', line 84
def wire_drawdown_requests
@wire_drawdown_requests
end
|
78
79
80
|
# File 'lib/increase/client.rb', line 78
def wire_transfers
@wire_transfers
end
|