Class: Increase::Client
- Inherits:
-
BaseClient
- Object
- BaseClient
- Increase::Client
- Defined in:
- lib/increase/client.rb
Constant Summary collapse
- DEFAULT_MAX_RETRIES =
Default max number of retries to attempt after a failed retryable request.
2
Instance Attribute Summary collapse
- #account_numbers ⇒ Increase::Resources::AccountNumbers readonly
- #account_statements ⇒ Increase::Resources::AccountStatements readonly
- #account_transfers ⇒ Increase::Resources::AccountTransfers readonly
- #accounts ⇒ Increase::Resources::Accounts readonly
- #ach_prenotifications ⇒ Increase::Resources::ACHPrenotifications readonly
- #ach_transfers ⇒ Increase::Resources::ACHTransfers readonly
-
#api_key ⇒ Object
readonly
Client options.
- #bookkeeping_accounts ⇒ Increase::Resources::BookkeepingAccounts readonly
- #bookkeeping_entries ⇒ Increase::Resources::BookkeepingEntries readonly
- #bookkeeping_entry_sets ⇒ Increase::Resources::BookkeepingEntrySets readonly
- #card_disputes ⇒ Increase::Resources::CardDisputes readonly
- #card_payments ⇒ Increase::Resources::CardPayments readonly
- #card_purchase_supplements ⇒ Increase::Resources::CardPurchaseSupplements readonly
- #cards ⇒ Increase::Resources::Cards readonly
- #check_deposits ⇒ Increase::Resources::CheckDeposits readonly
- #check_transfers ⇒ Increase::Resources::CheckTransfers readonly
- #declined_transactions ⇒ Increase::Resources::DeclinedTransactions readonly
- #digital_card_profiles ⇒ Increase::Resources::DigitalCardProfiles readonly
- #digital_wallet_tokens ⇒ Increase::Resources::DigitalWalletTokens readonly
- #documents ⇒ Increase::Resources::Documents readonly
- #entities ⇒ Increase::Resources::Entities readonly
- #event_subscriptions ⇒ Increase::Resources::EventSubscriptions readonly
- #events ⇒ Increase::Resources::Events readonly
- #exports ⇒ Increase::Resources::Exports readonly
- #external_accounts ⇒ Increase::Resources::ExternalAccounts readonly
- #files ⇒ Increase::Resources::Files readonly
- #groups ⇒ Increase::Resources::Groups readonly
- #inbound_ach_transfers ⇒ Increase::Resources::InboundACHTransfers readonly
- #inbound_check_deposits ⇒ Increase::Resources::InboundCheckDeposits readonly
- #inbound_mail_items ⇒ Increase::Resources::InboundMailItems readonly
- #inbound_wire_drawdown_requests ⇒ Increase::Resources::InboundWireDrawdownRequests readonly
- #inbound_wire_transfers ⇒ Increase::Resources::InboundWireTransfers readonly
- #intrafi_account_enrollments ⇒ Increase::Resources::IntrafiAccountEnrollments readonly
- #intrafi_balances ⇒ Increase::Resources::IntrafiBalances readonly
- #intrafi_exclusions ⇒ Increase::Resources::IntrafiExclusions readonly
- #lockboxes ⇒ Increase::Resources::Lockboxes readonly
- #oauth_connections ⇒ Increase::Resources::OAuthConnections readonly
- #oauth_tokens ⇒ Increase::Resources::OAuthTokens readonly
- #pending_transactions ⇒ Increase::Resources::PendingTransactions readonly
- #physical_card_profiles ⇒ Increase::Resources::PhysicalCardProfiles readonly
- #physical_cards ⇒ Increase::Resources::PhysicalCards readonly
- #programs ⇒ Increase::Resources::Programs readonly
- #proof_of_authorization_request_submissions ⇒ Increase::Resources::ProofOfAuthorizationRequestSubmissions readonly
- #proof_of_authorization_requests ⇒ Increase::Resources::ProofOfAuthorizationRequests readonly
- #real_time_decisions ⇒ Increase::Resources::RealTimeDecisions readonly
- #real_time_payments_request_for_payments ⇒ Increase::Resources::RealTimePaymentsRequestForPayments readonly
- #real_time_payments_transfers ⇒ Increase::Resources::RealTimePaymentsTransfers readonly
- #routing_numbers ⇒ Increase::Resources::RoutingNumbers readonly
- #simulations ⇒ Increase::Resources::Simulations readonly
- #supplemental_documents ⇒ Increase::Resources::SupplementalDocuments readonly
- #transactions ⇒ Increase::Resources::Transactions readonly
- #wire_drawdown_requests ⇒ Increase::Resources::WireDrawdownRequests readonly
- #wire_transfers ⇒ Increase::Resources::WireTransfers readonly
Instance Method Summary collapse
-
#initialize(environment: nil, base_url: nil, api_key: nil, max_retries: nil) ⇒ Client
constructor
Creates and returns a new client for interacting with the API.
Constructor Details
#initialize(environment: nil, base_url: nil, api_key: nil, max_retries: nil) ⇒ Client
Creates and returns a new client for interacting with the API.
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/increase/client.rb', line 173 def initialize(environment: nil, base_url: nil, api_key: nil, max_retries: nil) environments = {"production" => "https://api.increase.com", "sandbox" => "https://sandbox.increase.com"} if environment && base_url raise ArgumentError, "both environment and base_url given, expected only one" elsif environment if !environments.key?(environment.to_s) raise ArgumentError, "environment must be one of #{environments.keys}, got #{environment}" end base_url = environments[environment.to_s] elsif !base_url base_url = "https://api.increase.com" end max_retries ||= DEFAULT_MAX_RETRIES idempotency_header = "Idempotency-Key" @api_key = [api_key, ENV["INCREASE_API_KEY"]].find { |v| !v.nil? } if @api_key.nil? raise ArgumentError, "api_key is required" end super(base_url: base_url, max_retries: max_retries, idempotency_header: idempotency_header) @accounts = Increase::Resources::Accounts.new(client: self) @account_numbers = Increase::Resources::AccountNumbers.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) @account_transfers = Increase::Resources::AccountTransfers.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) @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) @proof_of_authorization_requests = Increase::Resources::ProofOfAuthorizationRequests.new(client: self) @proof_of_authorization_request_submissions = Increase::Resources::ProofOfAuthorizationRequestSubmissions.new(client: self) @account_statements = Increase::Resources::AccountStatements.new(client: self) @files = Increase::Resources::Files.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_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) @real_time_payments_request_for_payments = Increase::Resources::RealTimePaymentsRequestForPayments.new(client: self) @simulations = Increase::Resources::Simulations.new(client: self) end |
Instance Attribute Details
#account_numbers ⇒ Increase::Resources::AccountNumbers (readonly)
15 16 17 |
# File 'lib/increase/client.rb', line 15 def account_numbers @account_numbers end |
#account_statements ⇒ Increase::Resources::AccountStatements (readonly)
114 115 116 |
# File 'lib/increase/client.rb', line 114 def account_statements @account_statements end |
#account_transfers ⇒ Increase::Resources::AccountTransfers (readonly)
51 52 53 |
# File 'lib/increase/client.rb', line 51 def account_transfers @account_transfers end |
#accounts ⇒ Increase::Resources::Accounts (readonly)
12 13 14 |
# File 'lib/increase/client.rb', line 12 def accounts @accounts end |
#ach_prenotifications ⇒ Increase::Resources::ACHPrenotifications (readonly)
57 58 59 |
# File 'lib/increase/client.rb', line 57 def ach_prenotifications @ach_prenotifications end |
#ach_transfers ⇒ Increase::Resources::ACHTransfers (readonly)
54 55 56 |
# File 'lib/increase/client.rb', line 54 def ach_transfers @ach_transfers end |
#api_key ⇒ Object (readonly)
Client options.
9 10 11 |
# File 'lib/increase/client.rb', line 9 def api_key @api_key end |
#bookkeeping_accounts ⇒ Increase::Resources::BookkeepingAccounts (readonly)
135 136 137 |
# File 'lib/increase/client.rb', line 135 def bookkeeping_accounts @bookkeeping_accounts end |
#bookkeeping_entries ⇒ Increase::Resources::BookkeepingEntries (readonly)
141 142 143 |
# File 'lib/increase/client.rb', line 141 def bookkeeping_entries @bookkeeping_entries end |
#bookkeeping_entry_sets ⇒ Increase::Resources::BookkeepingEntrySets (readonly)
138 139 140 |
# File 'lib/increase/client.rb', line 138 def bookkeeping_entry_sets @bookkeeping_entry_sets end |
#card_disputes ⇒ Increase::Resources::CardDisputes (readonly)
27 28 29 |
# File 'lib/increase/client.rb', line 27 def card_disputes @card_disputes end |
#card_payments ⇒ Increase::Resources::CardPayments (readonly)
21 22 23 |
# File 'lib/increase/client.rb', line 21 def card_payments @card_payments end |
#card_purchase_supplements ⇒ Increase::Resources::CardPurchaseSupplements (readonly)
24 25 26 |
# File 'lib/increase/client.rb', line 24 def card_purchase_supplements @card_purchase_supplements end |
#cards ⇒ Increase::Resources::Cards (readonly)
18 19 20 |
# File 'lib/increase/client.rb', line 18 def cards @cards end |
#check_deposits ⇒ Increase::Resources::CheckDeposits (readonly)
84 85 86 |
# File 'lib/increase/client.rb', line 84 def check_deposits @check_deposits end |
#check_transfers ⇒ Increase::Resources::CheckTransfers (readonly)
75 76 77 |
# File 'lib/increase/client.rb', line 75 def check_transfers @check_transfers end |
#declined_transactions ⇒ Increase::Resources::DeclinedTransactions (readonly)
48 49 50 |
# File 'lib/increase/client.rb', line 48 def declined_transactions @declined_transactions end |
#digital_card_profiles ⇒ Increase::Resources::DigitalCardProfiles (readonly)
33 34 35 |
# File 'lib/increase/client.rb', line 33 def digital_card_profiles @digital_card_profiles end |
#digital_wallet_tokens ⇒ Increase::Resources::DigitalWalletTokens (readonly)
39 40 41 |
# File 'lib/increase/client.rb', line 39 def digital_wallet_tokens @digital_wallet_tokens end |
#documents ⇒ Increase::Resources::Documents (readonly)
120 121 122 |
# File 'lib/increase/client.rb', line 120 def documents @documents end |
#entities ⇒ Increase::Resources::Entities (readonly)
99 100 101 |
# File 'lib/increase/client.rb', line 99 def entities @entities end |
#event_subscriptions ⇒ Increase::Resources::EventSubscriptions (readonly)
129 130 131 |
# File 'lib/increase/client.rb', line 129 def event_subscriptions @event_subscriptions end |
#events ⇒ Increase::Resources::Events (readonly)
126 127 128 |
# File 'lib/increase/client.rb', line 126 def events @events end |
#exports ⇒ Increase::Resources::Exports (readonly)
123 124 125 |
# File 'lib/increase/client.rb', line 123 def exports @exports end |
#external_accounts ⇒ Increase::Resources::ExternalAccounts (readonly)
96 97 98 |
# File 'lib/increase/client.rb', line 96 def external_accounts @external_accounts end |
#files ⇒ Increase::Resources::Files (readonly)
117 118 119 |
# File 'lib/increase/client.rb', line 117 def files @files end |
#groups ⇒ Increase::Resources::Groups (readonly)
144 145 146 |
# File 'lib/increase/client.rb', line 144 def groups @groups end |
#inbound_ach_transfers ⇒ Increase::Resources::InboundACHTransfers (readonly)
60 61 62 |
# File 'lib/increase/client.rb', line 60 def inbound_ach_transfers @inbound_ach_transfers end |
#inbound_check_deposits ⇒ Increase::Resources::InboundCheckDeposits (readonly)
78 79 80 |
# File 'lib/increase/client.rb', line 78 def inbound_check_deposits @inbound_check_deposits end |
#inbound_mail_items ⇒ Increase::Resources::InboundMailItems (readonly)
90 91 92 |
# File 'lib/increase/client.rb', line 90 def inbound_mail_items @inbound_mail_items end |
#inbound_wire_drawdown_requests ⇒ Increase::Resources::InboundWireDrawdownRequests (readonly)
72 73 74 |
# File 'lib/increase/client.rb', line 72 def inbound_wire_drawdown_requests @inbound_wire_drawdown_requests end |
#inbound_wire_transfers ⇒ Increase::Resources::InboundWireTransfers (readonly)
66 67 68 |
# File 'lib/increase/client.rb', line 66 def inbound_wire_transfers @inbound_wire_transfers end |
#intrafi_account_enrollments ⇒ Increase::Resources::IntrafiAccountEnrollments (readonly)
153 154 155 |
# File 'lib/increase/client.rb', line 153 def intrafi_account_enrollments @intrafi_account_enrollments end |
#intrafi_balances ⇒ Increase::Resources::IntrafiBalances (readonly)
156 157 158 |
# File 'lib/increase/client.rb', line 156 def intrafi_balances @intrafi_balances end |
#intrafi_exclusions ⇒ Increase::Resources::IntrafiExclusions (readonly)
159 160 161 |
# File 'lib/increase/client.rb', line 159 def intrafi_exclusions @intrafi_exclusions end |
#lockboxes ⇒ Increase::Resources::Lockboxes (readonly)
87 88 89 |
# File 'lib/increase/client.rb', line 87 def lockboxes @lockboxes end |
#oauth_connections ⇒ Increase::Resources::OAuthConnections (readonly)
147 148 149 |
# File 'lib/increase/client.rb', line 147 def oauth_connections @oauth_connections end |
#oauth_tokens ⇒ Increase::Resources::OAuthTokens (readonly)
150 151 152 |
# File 'lib/increase/client.rb', line 150 def oauth_tokens @oauth_tokens end |
#pending_transactions ⇒ Increase::Resources::PendingTransactions (readonly)
45 46 47 |
# File 'lib/increase/client.rb', line 45 def pending_transactions @pending_transactions end |
#physical_card_profiles ⇒ Increase::Resources::PhysicalCardProfiles (readonly)
36 37 38 |
# File 'lib/increase/client.rb', line 36 def physical_card_profiles @physical_card_profiles end |
#physical_cards ⇒ Increase::Resources::PhysicalCards (readonly)
30 31 32 |
# File 'lib/increase/client.rb', line 30 def physical_cards @physical_cards end |
#programs ⇒ Increase::Resources::Programs (readonly)
105 106 107 |
# File 'lib/increase/client.rb', line 105 def programs @programs end |
#proof_of_authorization_request_submissions ⇒ Increase::Resources::ProofOfAuthorizationRequestSubmissions (readonly)
111 112 113 |
# File 'lib/increase/client.rb', line 111 def @proof_of_authorization_request_submissions end |
#proof_of_authorization_requests ⇒ Increase::Resources::ProofOfAuthorizationRequests (readonly)
108 109 110 |
# File 'lib/increase/client.rb', line 108 def @proof_of_authorization_requests end |
#real_time_decisions ⇒ Increase::Resources::RealTimeDecisions (readonly)
132 133 134 |
# File 'lib/increase/client.rb', line 132 def real_time_decisions @real_time_decisions end |
#real_time_payments_request_for_payments ⇒ Increase::Resources::RealTimePaymentsRequestForPayments (readonly)
162 163 164 |
# File 'lib/increase/client.rb', line 162 def real_time_payments_request_for_payments @real_time_payments_request_for_payments end |
#real_time_payments_transfers ⇒ Increase::Resources::RealTimePaymentsTransfers (readonly)
81 82 83 |
# File 'lib/increase/client.rb', line 81 def real_time_payments_transfers @real_time_payments_transfers end |
#routing_numbers ⇒ Increase::Resources::RoutingNumbers (readonly)
93 94 95 |
# File 'lib/increase/client.rb', line 93 def routing_numbers @routing_numbers end |
#simulations ⇒ Increase::Resources::Simulations (readonly)
165 166 167 |
# File 'lib/increase/client.rb', line 165 def simulations @simulations end |
#supplemental_documents ⇒ Increase::Resources::SupplementalDocuments (readonly)
102 103 104 |
# File 'lib/increase/client.rb', line 102 def supplemental_documents @supplemental_documents end |
#transactions ⇒ Increase::Resources::Transactions (readonly)
42 43 44 |
# File 'lib/increase/client.rb', line 42 def transactions @transactions end |
#wire_drawdown_requests ⇒ Increase::Resources::WireDrawdownRequests (readonly)
69 70 71 |
# File 'lib/increase/client.rb', line 69 def wire_drawdown_requests @wire_drawdown_requests end |
#wire_transfers ⇒ Increase::Resources::WireTransfers (readonly)
63 64 65 |
# File 'lib/increase/client.rb', line 63 def wire_transfers @wire_transfers end |